Add admin state up switch

Add admin state up switches to various steps of load balancer creation.

Change-Id: Ib4008fa1e1d00921040320e2d1b44d35bd38cef9
This commit is contained in:
Tom Weininger 2023-02-16 12:17:56 +01:00
parent a9370ef261
commit f6535f71d8
7 changed files with 60 additions and 7 deletions

View File

@ -0,0 +1,5 @@
---
features:
- |
Added "Admin State Up" switch to load balancer steps base, listener, pool
and health monitor.

View File

@ -82,6 +82,7 @@
"Additional routes announced to the instance, one entry per line(e.g. {ip})": "Additional routes announced to the instance, one entry per line(e.g. {ip})",
"Addresses": "Addresses",
"Admin State": "Admin State",
"Admin State Up": "Admin State Up",
"Admin Status": "Admin Status",
"Administrator": "Administrator",
"Adopt Complete": "Adopt Complete",
@ -634,6 +635,10 @@
"Default Policy": "Default Policy",
"Default is slaac, for details, see https://docs.openstack.org/neutron/latest/admin/config-ipv6.html": "Default is slaac, for details, see https://docs.openstack.org/neutron/latest/admin/config-ipv6.html",
"Defaults": "Defaults",
"Defines the admin state of the health monitor.": "Defines the admin state of the health monitor.",
"Defines the admin state of the listener.": "Defines the admin state of the listener.",
"Defines the admin state of the pool.": "Defines the admin state of the pool.",
"Defines the admin state of the port.": "Defines the admin state of the port.",
"Degraded": "Degraded",
"Delay Interval(s)": "Delay Interval(s)",
"Delete": "Delete",

View File

@ -12,11 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import { inject, observer } from 'mobx-react';
import Base from 'components/Form';
import { LbaasStore } from 'stores/octavia/loadbalancer';
import { inject, observer } from 'mobx-react';
import { NetworkStore } from 'stores/neutron/network';
import { SubnetStore } from 'stores/neutron/subnet';
import { LbaasStore } from 'stores/octavia/loadbalancer';
export class BaseStep extends Base {
init() {
@ -40,6 +40,7 @@ export class BaseStep extends Base {
get defaultValue() {
return {
project_id: this.props.rootStore.user.project.id,
admin_state_enabled: true,
};
}
@ -79,7 +80,10 @@ export class BaseStep extends Base {
};
get formItems() {
const { network_id, subnetDetails = [] } = this.state;
const {
network_id,
subnetDetails = [],
} = this.state;
return [
{
name: 'name',
@ -110,6 +114,12 @@ export class BaseStep extends Base {
hidden: !network_id,
required: true,
},
{
name: 'admin_state_enabled',
label: t('Admin State Up'),
type: 'switch',
tip: t('Defines the admin state of the port.'),
},
];
}
}

View File

@ -82,6 +82,7 @@ export class StepCreate extends StepAction {
description,
vip_address,
vip_network_id,
admin_state_enabled,
enableHealthMonitor,
listener_protocol,
listener_ssl_parsing_method,
@ -89,6 +90,9 @@ export class StepCreate extends StepAction {
listener_default_tls_container_ref,
listener_client_ca_tls_container_ref,
listener_sni_container_refs,
listener_admin_state_up,
pool_admin_state_up,
monitor_admin_state_up,
...rest
} = values;
const data = {
@ -101,8 +105,10 @@ export class StepCreate extends StepAction {
if (ip_address && ip_address.ip) {
data.vip_address = ip_address.ip;
}
data.admin_state_up = admin_state_enabled;
const listenerData = {
admin_state_up: listener_admin_state_up,
protocol: listener_protocol,
};
@ -127,8 +133,8 @@ export class StepCreate extends StepAction {
}
}
const poolData = {};
const healthMonitorData = {};
const poolData = { admin_state_up: pool_admin_state_up };
const healthMonitorData = { admin_state_up: monitor_admin_state_up };
Object.keys(rest).forEach((i) => {
if (i.indexOf('listener') === 0) {
listenerData[i.replace('listener_', '')] = values[i];

View File

@ -41,13 +41,15 @@ export class HealthMonitorStep extends Base {
health_timeout: 3,
health_max_retries: 3,
health_type: '',
monitor_admin_state_up: true,
};
}
allowed = () => Promise.resolve();
get formItems() {
const { health_delay, enableHealthMonitor } = this.state;
const {health_delay, enableHealthMonitor} =
this.state;
return [
{
name: 'enableHealthMonitor',
@ -116,6 +118,12 @@ export class HealthMonitorStep extends Base {
required: true,
hidden: !enableHealthMonitor,
},
{
name: 'monitor_admin_state_up',
label: t('Admin State Up'),
type: 'switch',
tip: t('Defines the admin state of the health monitor.'),
},
];
}
}

View File

@ -67,6 +67,7 @@ export class ListenerStep extends Base {
listener_ssl_parsing_method: 'one-way',
listener_sni_enabled: false,
listener_connection_limit: -1,
listener_admin_state_up: true,
};
}
@ -195,6 +196,12 @@ export class ListenerStep extends Base {
extra: t('-1 means no connection limit'),
required: true,
},
{
name: 'listener_admin_state_up',
label: t('Admin State Up'),
type: 'switch',
tip: t('Defines the admin state of the listener.'),
},
];
}
}

View File

@ -49,8 +49,14 @@ export class PoolStep extends Base {
});
};
get defaultValue() {
return {
pool_admin_state_up: true,
};
}
get formItems() {
const { pool_lb_algorithm } = this.state;
const {pool_lb_algorithm} = this.state;
return [
{
name: 'pool_name',
@ -84,6 +90,12 @@ export class PoolStep extends Base {
},
required: true,
},
{
name: 'pool_admin_state_up',
label: t('Admin State Up'),
type: 'switch',
tip: t('Defines the admin state of the pool.'),
},
];
}
}