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’, ‘selector-type’: ‘DICT_SELECTOR’, ‘translation-type’: ‘HDICT’, ‘field-translators’: ({‘fieldname’: ‘status’, ‘translator’: {‘translation-type’: ‘VALUE’}}, {‘fieldname’: ‘name’, ‘translator’: {‘translation-type’: ‘VALUE’}}, {‘fieldname’: ‘subnets’, ‘col’: ‘subnet_group_id’, ‘translator’: {‘table-name’: ‘networks.subnets’, ‘id-col’: ‘subnet_group_id’, ‘translation-type’: ‘LIST’, ‘translator’: {‘translation-type’: ‘VALUE’}, ‘val-col’: ‘subnet’}}, {‘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’, ‘translator’: {‘translation-type’: ‘VALUE’}})}, {‘table-name’: ‘ports’, ‘selector-type’: ‘DICT_SELECTOR’, ‘translation-type’: ‘HDICT’, ‘field-translators’: ({‘fieldname’: ‘allowed_address_pairs’, ‘col’: ‘allowed_address_pairs_id’, ‘translator’: {‘table-name’: ‘ports.address_pairs’, ‘id-col’: ‘allowed_address_pairs_id’, ‘translation-type’: ‘LIST’, ‘translator’: {‘translation-type’: ‘VALUE’}, ‘val-col’: ‘address’}}, {‘fieldname’: ‘security_groups’, ‘col’: ‘security_groups_id’, ‘translator’: {‘table-name’: ‘ports.security_groups’, ‘id-col’: ‘security_groups_id’, ‘translation-type’: ‘LIST’, ‘translator’: {‘translation-type’: ‘VALUE’}, ‘val-col’: ‘security_group_id’}}, {‘fieldname’: ‘extra_dhcp_opts’, ‘col’: ‘extra_dhcp_opt_group_id’, ‘translator’: {‘table-name’: ‘ports.extra_dhcp_opts’, ‘id-col’: ‘extra_dhcp_opt_group_id’, ‘translation-type’: ‘LIST’, ‘translator’: {‘translation-type’: ‘VALUE’}, ‘val-col’: ‘dhcp_opt’}}, {‘fieldname’: ‘binding:capabilities’, ‘col’: ‘binding:capabilities_id’, ‘translator’: {‘table-name’: ‘ports.binding_capabilities’, ‘translator’: {‘translation-type’: ‘VALUE’}, ‘translation-type’: ‘VDICT’, ‘val-col’: ‘value’, ‘id-col’: ‘binding:capabilities_id’, ‘key-col’: ‘key’}}, {‘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’: {‘translation-type’: ‘VALUE’}}, {‘fieldname’: ‘fixed_ips’, ‘col’: ‘fixed_ips’, ‘translator’: {‘table-name’: ‘ports.fixed_ips_groups’, ‘id-col’: ‘fixed_ips_group_id’, ‘translation-type’: ‘LIST’, ‘translator’: {‘table-name’: ‘ports.fixed_ips’, ‘translator’: {‘translation-type’: ‘VALUE’}, ‘translation-type’: ‘VDICT’, ‘val-col’: ‘value’, ‘id-col’: ‘fixed_ip_id’, ‘key-col’: ‘key’}, ‘val-col’: ‘fixed_ip_id’}}, {‘fieldname’: ‘id’, ‘translator’: {‘translation-type’: ‘VALUE’}}, {‘fieldname’: ‘device_id’, ‘translator’: {‘translation-type’: ‘VALUE’}}, {‘fieldname’: ‘binding:host_id’, ‘translator’: {‘translation-type’: ‘VALUE’}})}, {‘table-name’: ‘routers’, ‘selector-type’: ‘DICT_SELECTOR’, ‘translation-type’: ‘HDICT’, ‘field-translators’: ({‘fieldname’: ‘status’, ‘translator’: {‘translation-type’: ‘VALUE’}}, {‘fieldname’: ‘external_gateway_info’, ‘translator’: {‘table-name’: ‘routers.external_gateways’, ‘translator’: {‘translation-type’: ‘VALUE’}, ‘translation-type’: ‘VDICT’, ‘val-col’: ‘value’, ‘id-col’: ‘external_gateway_info’, ‘key-col’: ‘key’}}, {‘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’, ‘translator’: {‘translation-type’: ‘VALUE’}})}, {‘table-name’: ‘security_groups’, ‘selector-type’: ‘DICT_SELECTOR’, ‘translation-type’: ‘HDICT’, ‘field-translators’: ({‘fieldname’: ‘tenant_id’, ‘translator’: {‘translation-type’: ‘VALUE’}}, {‘fieldname’: ‘name’, ‘translator’: {‘translation-type’: ‘VALUE’}}, {‘fieldname’: ‘description’, ‘translator’: {‘translation-type’: ‘VALUE’}}, {‘fieldname’: ‘id’, ‘translator’: {‘translation-type’: ‘VALUE’}})}]
execute(action, action_args)

Overwrite ExecutionDriver.execute().

static get_datasource_info()
get_neutron_credentials(creds)
initialize_update_methods()
networks_translator = {‘table-name’: ‘networks’, ‘selector-type’: ‘DICT_SELECTOR’, ‘translation-type’: ‘HDICT’, ‘field-translators’: ({‘fieldname’: ‘status’, ‘translator’: {‘translation-type’: ‘VALUE’}}, {‘fieldname’: ‘name’, ‘translator’: {‘translation-type’: ‘VALUE’}}, {‘fieldname’: ‘subnets’, ‘col’: ‘subnet_group_id’, ‘translator’: {‘table-name’: ‘networks.subnets’, ‘id-col’: ‘subnet_group_id’, ‘translation-type’: ‘LIST’, ‘translator’: {‘translation-type’: ‘VALUE’}, ‘val-col’: ‘subnet’}}, {‘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’, ‘translator’: {‘translation-type’: ‘VALUE’}})}
ports_translator = {‘table-name’: ‘ports’, ‘selector-type’: ‘DICT_SELECTOR’, ‘translation-type’: ‘HDICT’, ‘field-translators’: ({‘fieldname’: ‘allowed_address_pairs’, ‘col’: ‘allowed_address_pairs_id’, ‘translator’: {‘table-name’: ‘ports.address_pairs’, ‘id-col’: ‘allowed_address_pairs_id’, ‘translation-type’: ‘LIST’, ‘translator’: {‘translation-type’: ‘VALUE’}, ‘val-col’: ‘address’}}, {‘fieldname’: ‘security_groups’, ‘col’: ‘security_groups_id’, ‘translator’: {‘table-name’: ‘ports.security_groups’, ‘id-col’: ‘security_groups_id’, ‘translation-type’: ‘LIST’, ‘translator’: {‘translation-type’: ‘VALUE’}, ‘val-col’: ‘security_group_id’}}, {‘fieldname’: ‘extra_dhcp_opts’, ‘col’: ‘extra_dhcp_opt_group_id’, ‘translator’: {‘table-name’: ‘ports.extra_dhcp_opts’, ‘id-col’: ‘extra_dhcp_opt_group_id’, ‘translation-type’: ‘LIST’, ‘translator’: {‘translation-type’: ‘VALUE’}, ‘val-col’: ‘dhcp_opt’}}, {‘fieldname’: ‘binding:capabilities’, ‘col’: ‘binding:capabilities_id’, ‘translator’: {‘table-name’: ‘ports.binding_capabilities’, ‘translator’: {‘translation-type’: ‘VALUE’}, ‘translation-type’: ‘VDICT’, ‘val-col’: ‘value’, ‘id-col’: ‘binding:capabilities_id’, ‘key-col’: ‘key’}}, {‘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’: {‘translation-type’: ‘VALUE’}}, {‘fieldname’: ‘fixed_ips’, ‘col’: ‘fixed_ips’, ‘translator’: {‘table-name’: ‘ports.fixed_ips_groups’, ‘id-col’: ‘fixed_ips_group_id’, ‘translation-type’: ‘LIST’, ‘translator’: {‘table-name’: ‘ports.fixed_ips’, ‘translator’: {‘translation-type’: ‘VALUE’}, ‘translation-type’: ‘VDICT’, ‘val-col’: ‘value’, ‘id-col’: ‘fixed_ip_id’, ‘key-col’: ‘key’}, ‘val-col’: ‘fixed_ip_id’}}, {‘fieldname’: ‘id’, ‘translator’: {‘translation-type’: ‘VALUE’}}, {‘fieldname’: ‘device_id’, ‘translator’: {‘translation-type’: ‘VALUE’}}, {‘fieldname’: ‘binding:host_id’, ‘translator’: {‘translation-type’: ‘VALUE’}})}
routers_translator = {‘table-name’: ‘routers’, ‘selector-type’: ‘DICT_SELECTOR’, ‘translation-type’: ‘HDICT’, ‘field-translators’: ({‘fieldname’: ‘status’, ‘translator’: {‘translation-type’: ‘VALUE’}}, {‘fieldname’: ‘external_gateway_info’, ‘translator’: {‘table-name’: ‘routers.external_gateways’, ‘translator’: {‘translation-type’: ‘VALUE’}, ‘translation-type’: ‘VDICT’, ‘val-col’: ‘value’, ‘id-col’: ‘external_gateway_info’, ‘key-col’: ‘key’}}, {‘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’, ‘translator’: {‘translation-type’: ‘VALUE’}})}
security_groups_translator = {‘table-name’: ‘security_groups’, ‘selector-type’: ‘DICT_SELECTOR’, ‘translation-type’: ‘HDICT’, ‘field-translators’: ({‘fieldname’: ‘tenant_id’, ‘translator’: {‘translation-type’: ‘VALUE’}}, {‘fieldname’: ‘name’, ‘translator’: {‘translation-type’: ‘VALUE’}}, {‘fieldname’: ‘description’, ‘translator’: {‘translation-type’: ‘VALUE’}}, {‘fieldname’: ‘id’, ‘translator’: {‘translation-type’: ‘VALUE’}})}
value_trans = {‘translation-type’: ‘VALUE’}