The congress.datasources.neutron_driver Module

class congress.datasources.neutron_driver.NeutronDriver(name='', args=None)

Bases: congress.datasources.datasource_driver.PollingDataSourceDriver, congress.datasources.datasource_driver.ExecutionDriver

NETWORKS = 'networks'
NETWORKS_SUBNETS = 'networks.subnets'
PORTS = 'ports'
PORTS_ADDR_PAIRS = 'ports.address_pairs'
PORTS_BINDING_CAPABILITIES = 'ports.binding_capabilities'
PORTS_EXTRA_DHCP_OPTS = 'ports.extra_dhcp_opts'
PORTS_FIXED_IPS = 'ports.fixed_ips'
PORTS_FIXED_IPS_GROUPS = 'ports.fixed_ips_groups'
PORTS_SECURITY_GROUPS = 'ports.security_groups'
ROUTERS = 'routers'
ROUTERS_EXTERNAL_GATEWAYS = 'routers.external_gateways'
SECURITY_GROUPS = 'security_groups'
TRANSLATORS = [{'table-name': 'networks', 'field-translators': ({'translator': {'translation-type': 'VALUE'}, 'fieldname': 'status'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'name'}, {'translator': {'id-col': 'subnet_group_id', 'translator': {'translation-type': 'VALUE'}, 'table-name': 'networks.subnets', 'val-col': 'subnet', 'translation-type': 'LIST'}, 'fieldname': 'subnets', 'col': 'subnet_group_id'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'provider:physical_network'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'admin_state_up'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'tenant_id'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'provider:network_type'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'router:external'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'shared'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'id'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'provider:segmentation_id'}), 'selector-type': 'DICT_SELECTOR', 'translation-type': 'HDICT'}, {'table-name': 'ports', 'field-translators': ({'translator': {'id-col': 'allowed_address_pairs_id', 'translator': {'translation-type': 'VALUE'}, 'table-name': 'ports.address_pairs', 'val-col': 'address', 'translation-type': 'LIST'}, 'fieldname': 'allowed_address_pairs', 'col': 'allowed_address_pairs_id'}, {'translator': {'id-col': 'security_groups_id', 'translator': {'translation-type': 'VALUE'}, 'table-name': 'ports.security_groups', 'val-col': 'security_group_id', 'translation-type': 'LIST'}, 'fieldname': 'security_groups', 'col': 'security_groups_id'}, {'translator': {'id-col': 'extra_dhcp_opt_group_id', 'translator': {'translation-type': 'VALUE'}, 'table-name': 'ports.extra_dhcp_opts', 'val-col': 'dhcp_opt', 'translation-type': 'LIST'}, 'fieldname': 'extra_dhcp_opts', 'col': 'extra_dhcp_opt_group_id'}, {'translator': {'id-col': 'binding:capabilities_id', 'val-col': 'value', 'translation-type': 'VDICT', 'translator': {'translation-type': 'VALUE'}, 'table-name': 'ports.binding_capabilities', 'key-col': 'key'}, 'fieldname': 'binding:capabilities', 'col': 'binding:capabilities_id'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'status'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'name'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'admin_state_up'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'network_id'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'tenant_id'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'binding:vif_type'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'device_owner'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'mac_address'}, {'translator': {'id-col': 'fixed_ips_group_id', 'translator': {'id-col': 'fixed_ip_id', 'val-col': 'value', 'translation-type': 'VDICT', 'translator': {'translation-type': 'VALUE'}, 'table-name': 'ports.fixed_ips', 'key-col': 'key'}, 'table-name': 'ports.fixed_ips_groups', 'val-col': 'fixed_ip_id', 'translation-type': 'LIST'}, 'fieldname': 'fixed_ips', 'col': 'fixed_ips'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'id'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'device_id'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'binding:host_id'}), 'selector-type': 'DICT_SELECTOR', 'translation-type': 'HDICT'}, {'table-name': 'routers', 'field-translators': ({'translator': {'translation-type': 'VALUE'}, 'fieldname': 'status'}, {'translator': {'id-col': 'external_gateway_info', 'val-col': 'value', 'translation-type': 'VDICT', 'translator': {'translation-type': 'VALUE'}, 'table-name': 'routers.external_gateways', 'key-col': 'key'}, 'fieldname': 'external_gateway_info'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'networks'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'name'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'admin_state_up'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'tenant_id'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'id'}), 'selector-type': 'DICT_SELECTOR', 'translation-type': 'HDICT'}, {'table-name': 'security_groups', 'field-translators': ({'translator': {'translation-type': 'VALUE'}, 'fieldname': 'tenant_id'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'name'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'description'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'id'}), 'selector-type': 'DICT_SELECTOR', 'translation-type': 'HDICT'}]
execute(action, action_args)

Overwrite ExecutionDriver.execute().

static get_datasource_info()
get_neutron_credentials(creds)
initialize_update_methods()
networks_translator = {'table-name': 'networks', 'field-translators': ({'translator': {'translation-type': 'VALUE'}, 'fieldname': 'status'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'name'}, {'translator': {'id-col': 'subnet_group_id', 'translator': {'translation-type': 'VALUE'}, 'table-name': 'networks.subnets', 'val-col': 'subnet', 'translation-type': 'LIST'}, 'fieldname': 'subnets', 'col': 'subnet_group_id'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'provider:physical_network'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'admin_state_up'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'tenant_id'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'provider:network_type'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'router:external'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'shared'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'id'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'provider:segmentation_id'}), 'selector-type': 'DICT_SELECTOR', 'translation-type': 'HDICT'}
ports_translator = {'table-name': 'ports', 'field-translators': ({'translator': {'id-col': 'allowed_address_pairs_id', 'translator': {'translation-type': 'VALUE'}, 'table-name': 'ports.address_pairs', 'val-col': 'address', 'translation-type': 'LIST'}, 'fieldname': 'allowed_address_pairs', 'col': 'allowed_address_pairs_id'}, {'translator': {'id-col': 'security_groups_id', 'translator': {'translation-type': 'VALUE'}, 'table-name': 'ports.security_groups', 'val-col': 'security_group_id', 'translation-type': 'LIST'}, 'fieldname': 'security_groups', 'col': 'security_groups_id'}, {'translator': {'id-col': 'extra_dhcp_opt_group_id', 'translator': {'translation-type': 'VALUE'}, 'table-name': 'ports.extra_dhcp_opts', 'val-col': 'dhcp_opt', 'translation-type': 'LIST'}, 'fieldname': 'extra_dhcp_opts', 'col': 'extra_dhcp_opt_group_id'}, {'translator': {'id-col': 'binding:capabilities_id', 'val-col': 'value', 'translation-type': 'VDICT', 'translator': {'translation-type': 'VALUE'}, 'table-name': 'ports.binding_capabilities', 'key-col': 'key'}, 'fieldname': 'binding:capabilities', 'col': 'binding:capabilities_id'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'status'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'name'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'admin_state_up'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'network_id'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'tenant_id'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'binding:vif_type'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'device_owner'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'mac_address'}, {'translator': {'id-col': 'fixed_ips_group_id', 'translator': {'id-col': 'fixed_ip_id', 'val-col': 'value', 'translation-type': 'VDICT', 'translator': {'translation-type': 'VALUE'}, 'table-name': 'ports.fixed_ips', 'key-col': 'key'}, 'table-name': 'ports.fixed_ips_groups', 'val-col': 'fixed_ip_id', 'translation-type': 'LIST'}, 'fieldname': 'fixed_ips', 'col': 'fixed_ips'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'id'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'device_id'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'binding:host_id'}), 'selector-type': 'DICT_SELECTOR', 'translation-type': 'HDICT'}
routers_translator = {'table-name': 'routers', 'field-translators': ({'translator': {'translation-type': 'VALUE'}, 'fieldname': 'status'}, {'translator': {'id-col': 'external_gateway_info', 'val-col': 'value', 'translation-type': 'VDICT', 'translator': {'translation-type': 'VALUE'}, 'table-name': 'routers.external_gateways', 'key-col': 'key'}, 'fieldname': 'external_gateway_info'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'networks'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'name'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'admin_state_up'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'tenant_id'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'id'}), 'selector-type': 'DICT_SELECTOR', 'translation-type': 'HDICT'}
security_groups_translator = {'table-name': 'security_groups', 'field-translators': ({'translator': {'translation-type': 'VALUE'}, 'fieldname': 'tenant_id'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'name'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'description'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'id'}), 'selector-type': 'DICT_SELECTOR', 'translation-type': 'HDICT'}
value_trans = {'translation-type': 'VALUE'}