repo
stringlengths
7
55
path
stringlengths
4
127
func_name
stringlengths
1
88
original_string
stringlengths
75
19.8k
language
stringclasses
1 value
code
stringlengths
75
19.8k
code_tokens
list
docstring
stringlengths
3
17.3k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
87
242
partition
stringclasses
1 value
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py
CiscoNexusMechanismDriver._init_baremetal_trunk_interfaces
def _init_baremetal_trunk_interfaces(self, port_seg, segment): """Initialize baremetal switch interfaces and DB entry. With baremetal transactions, the interfaces are not known during initialization so they must be initialized when the transactions are received. * Reserved switc...
python
def _init_baremetal_trunk_interfaces(self, port_seg, segment): """Initialize baremetal switch interfaces and DB entry. With baremetal transactions, the interfaces are not known during initialization so they must be initialized when the transactions are received. * Reserved switc...
[ "def", "_init_baremetal_trunk_interfaces", "(", "self", ",", "port_seg", ",", "segment", ")", ":", "list_to_init", "=", "[", "]", "inactive_switch", "=", "[", "]", "connections", "=", "self", ".", "_get_baremetal_connections", "(", "port_seg", ",", "False", ",",...
Initialize baremetal switch interfaces and DB entry. With baremetal transactions, the interfaces are not known during initialization so they must be initialized when the transactions are received. * Reserved switch entries are added if needed. * Reserved port entries are added. ...
[ "Initialize", "baremetal", "switch", "interfaces", "and", "DB", "entry", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py#L806-L862
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py
CiscoNexusMechanismDriver._get_host_switches
def _get_host_switches(self, host_id): """Get switch IPs from configured host mapping. This method is used to extract switch information from transactions where VNIC_TYPE is normal. Information is extracted from ini file which is stored in _nexus_switches. :param host_i...
python
def _get_host_switches(self, host_id): """Get switch IPs from configured host mapping. This method is used to extract switch information from transactions where VNIC_TYPE is normal. Information is extracted from ini file which is stored in _nexus_switches. :param host_i...
[ "def", "_get_host_switches", "(", "self", ",", "host_id", ")", ":", "all_switches", "=", "set", "(", ")", "active_switches", "=", "set", "(", ")", "try", ":", "host_list", "=", "nxos_db", ".", "get_host_mappings", "(", "host_id", ")", "for", "mapping", "in...
Get switch IPs from configured host mapping. This method is used to extract switch information from transactions where VNIC_TYPE is normal. Information is extracted from ini file which is stored in _nexus_switches. :param host_id: host_name from transaction :returns: li...
[ "Get", "switch", "IPs", "from", "configured", "host", "mapping", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py#L864-L889
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py
CiscoNexusMechanismDriver._get_host_connections
def _get_host_connections(self, host_id, only_active_switch=False): """Get switch IPs and interfaces from config host mapping. This method is used to extract switch/interface information from ini files when VNIC_TYPE is normal. The ini files contain host t...
python
def _get_host_connections(self, host_id, only_active_switch=False): """Get switch IPs and interfaces from config host mapping. This method is used to extract switch/interface information from ini files when VNIC_TYPE is normal. The ini files contain host t...
[ "def", "_get_host_connections", "(", "self", ",", "host_id", ",", "only_active_switch", "=", "False", ")", ":", "host_found", "=", "False", "host_connections", "=", "[", "]", "try", ":", "host_ifs", "=", "nxos_db", ".", "get_host_mappings", "(", "host_id", ")"...
Get switch IPs and interfaces from config host mapping. This method is used to extract switch/interface information from ini files when VNIC_TYPE is normal. The ini files contain host to interface mappings. :param host_id: Host name from transaction :param only_active_...
[ "Get", "switch", "IPs", "and", "interfaces", "from", "config", "host", "mapping", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py#L891-L928
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py
CiscoNexusMechanismDriver._get_switch_interfaces
def _get_switch_interfaces(self, requested_switch_ip, cfg_only=False): """Get switch interfaces from host mapping DB. For a given switch, this returns all known port interfaces for a given switch. These have been learned from received baremetal transactions and from configurati...
python
def _get_switch_interfaces(self, requested_switch_ip, cfg_only=False): """Get switch interfaces from host mapping DB. For a given switch, this returns all known port interfaces for a given switch. These have been learned from received baremetal transactions and from configurati...
[ "def", "_get_switch_interfaces", "(", "self", ",", "requested_switch_ip", ",", "cfg_only", "=", "False", ")", ":", "switch_ifs", "=", "[", "]", "try", ":", "port_info", "=", "nxos_db", ".", "get_switch_host_mappings", "(", "requested_switch_ip", ")", "except", "...
Get switch interfaces from host mapping DB. For a given switch, this returns all known port interfaces for a given switch. These have been learned from received baremetal transactions and from configuration file. :param requested_switch_ip: switch_ip :returns: list of ...
[ "Get", "switch", "interfaces", "from", "host", "mapping", "DB", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py#L940-L968
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py
CiscoNexusMechanismDriver._configure_nve_db
def _configure_nve_db(self, vni, device_id, mcast_group, host_id): """Create the nexus NVE database entry. Called during update precommit port event. """ host_nve_connections = self._get_switch_nve_info(host_id) for switch_ip in host_nve_connections: if not nxos_db.g...
python
def _configure_nve_db(self, vni, device_id, mcast_group, host_id): """Create the nexus NVE database entry. Called during update precommit port event. """ host_nve_connections = self._get_switch_nve_info(host_id) for switch_ip in host_nve_connections: if not nxos_db.g...
[ "def", "_configure_nve_db", "(", "self", ",", "vni", ",", "device_id", ",", "mcast_group", ",", "host_id", ")", ":", "host_nve_connections", "=", "self", ".", "_get_switch_nve_info", "(", "host_id", ")", "for", "switch_ip", "in", "host_nve_connections", ":", "if...
Create the nexus NVE database entry. Called during update precommit port event.
[ "Create", "the", "nexus", "NVE", "database", "entry", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py#L992-L1002
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py
CiscoNexusMechanismDriver._configure_nve_member
def _configure_nve_member(self, vni, device_id, mcast_group, host_id): """Add "member vni" configuration to the NVE interface. Called during update postcommit port event. """ host_nve_connections = self._get_switch_nve_info(host_id) for switch_ip in host_nve_connections: ...
python
def _configure_nve_member(self, vni, device_id, mcast_group, host_id): """Add "member vni" configuration to the NVE interface. Called during update postcommit port event. """ host_nve_connections = self._get_switch_nve_info(host_id) for switch_ip in host_nve_connections: ...
[ "def", "_configure_nve_member", "(", "self", ",", "vni", ",", "device_id", ",", "mcast_group", ",", "host_id", ")", ":", "host_nve_connections", "=", "self", ".", "_get_switch_nve_info", "(", "host_id", ")", "for", "switch_ip", "in", "host_nve_connections", ":", ...
Add "member vni" configuration to the NVE interface. Called during update postcommit port event.
[ "Add", "member", "vni", "configuration", "to", "the", "NVE", "interface", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py#L1008-L1035
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py
CiscoNexusMechanismDriver._delete_nve_db
def _delete_nve_db(self, vni, device_id, mcast_group, host_id): """Delete the nexus NVE database entry. Called during delete precommit port event. """ rows = nxos_db.get_nve_vni_deviceid_bindings(vni, device_id) for row in rows: nxos_db.remove_nexusnve_binding(vni, r...
python
def _delete_nve_db(self, vni, device_id, mcast_group, host_id): """Delete the nexus NVE database entry. Called during delete precommit port event. """ rows = nxos_db.get_nve_vni_deviceid_bindings(vni, device_id) for row in rows: nxos_db.remove_nexusnve_binding(vni, r...
[ "def", "_delete_nve_db", "(", "self", ",", "vni", ",", "device_id", ",", "mcast_group", ",", "host_id", ")", ":", "rows", "=", "nxos_db", ".", "get_nve_vni_deviceid_bindings", "(", "vni", ",", "device_id", ")", "for", "row", "in", "rows", ":", "nxos_db", "...
Delete the nexus NVE database entry. Called during delete precommit port event.
[ "Delete", "the", "nexus", "NVE", "database", "entry", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py#L1037-L1044
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py
CiscoNexusMechanismDriver._delete_nve_member
def _delete_nve_member(self, vni, device_id, mcast_group, host_id): """Remove "member vni" configuration from the NVE interface. Called during delete postcommit port event. """ host_nve_connections = self._get_switch_nve_info(host_id) for switch_ip in host_nve_connections: ...
python
def _delete_nve_member(self, vni, device_id, mcast_group, host_id): """Remove "member vni" configuration from the NVE interface. Called during delete postcommit port event. """ host_nve_connections = self._get_switch_nve_info(host_id) for switch_ip in host_nve_connections: ...
[ "def", "_delete_nve_member", "(", "self", ",", "vni", ",", "device_id", ",", "mcast_group", ",", "host_id", ")", ":", "host_nve_connections", "=", "self", ".", "_get_switch_nve_info", "(", "host_id", ")", "for", "switch_ip", "in", "host_nve_connections", ":", "i...
Remove "member vni" configuration from the NVE interface. Called during delete postcommit port event.
[ "Remove", "member", "vni", "configuration", "from", "the", "NVE", "interface", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py#L1046-L1059
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py
CiscoNexusMechanismDriver._configure_nxos_db
def _configure_nxos_db(self, port, vlan_id, device_id, host_id, vni, is_provider_vlan): """Create the nexus database entry. Called during update precommit port event. """ connections = self._get_port_connections(port, host_id) for switch_ip, intf_type,...
python
def _configure_nxos_db(self, port, vlan_id, device_id, host_id, vni, is_provider_vlan): """Create the nexus database entry. Called during update precommit port event. """ connections = self._get_port_connections(port, host_id) for switch_ip, intf_type,...
[ "def", "_configure_nxos_db", "(", "self", ",", "port", ",", "vlan_id", ",", "device_id", ",", "host_id", ",", "vni", ",", "is_provider_vlan", ")", ":", "connections", "=", "self", ".", "_get_port_connections", "(", "port", ",", "host_id", ")", "for", "switch...
Create the nexus database entry. Called during update precommit port event.
[ "Create", "the", "nexus", "database", "entry", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py#L1061-L1077
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py
CiscoNexusMechanismDriver._gather_config_parms
def _gather_config_parms(self, is_provider_vlan, vlan_id): """Collect auto_create, auto_trunk from config.""" if is_provider_vlan: auto_create = cfg.CONF.ml2_cisco.provider_vlan_auto_create auto_trunk = cfg.CONF.ml2_cisco.provider_vlan_auto_trunk else: auto_cr...
python
def _gather_config_parms(self, is_provider_vlan, vlan_id): """Collect auto_create, auto_trunk from config.""" if is_provider_vlan: auto_create = cfg.CONF.ml2_cisco.provider_vlan_auto_create auto_trunk = cfg.CONF.ml2_cisco.provider_vlan_auto_trunk else: auto_cr...
[ "def", "_gather_config_parms", "(", "self", ",", "is_provider_vlan", ",", "vlan_id", ")", ":", "if", "is_provider_vlan", ":", "auto_create", "=", "cfg", ".", "CONF", ".", "ml2_cisco", ".", "provider_vlan_auto_create", "auto_trunk", "=", "cfg", ".", "CONF", ".", ...
Collect auto_create, auto_trunk from config.
[ "Collect", "auto_create", "auto_trunk", "from", "config", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py#L1079-L1087
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py
CiscoNexusMechanismDriver._configure_port_binding
def _configure_port_binding(self, is_provider_vlan, duplicate_type, is_native, switch_ip, vlan_id, intf_type, nexus_port, vni): """Conditionally calls vlan and port Nexus drivers.""" # This implies VLAN, VNI...
python
def _configure_port_binding(self, is_provider_vlan, duplicate_type, is_native, switch_ip, vlan_id, intf_type, nexus_port, vni): """Conditionally calls vlan and port Nexus drivers.""" # This implies VLAN, VNI...
[ "def", "_configure_port_binding", "(", "self", ",", "is_provider_vlan", ",", "duplicate_type", ",", "is_native", ",", "switch_ip", ",", "vlan_id", ",", "intf_type", ",", "nexus_port", ",", "vni", ")", ":", "if", "duplicate_type", "==", "const", ".", "DUPLICATE_P...
Conditionally calls vlan and port Nexus drivers.
[ "Conditionally", "calls", "vlan", "and", "port", "Nexus", "drivers", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py#L1089-L1119
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py
CiscoNexusMechanismDriver._get_compressed_vlan_list
def _get_compressed_vlan_list(self, pvlan_ids): """Generate a compressed vlan list ready for XML using a vlan set. Sample Use Case: Input vlan set: -------------- 1 - s = set([11, 50, 25, 30, 15, 16, 3, 8, 2, 1]) 2 - s = set([87, 11, 50, 25, 30, 15, 16, 3, 8, 2, 1, 88])...
python
def _get_compressed_vlan_list(self, pvlan_ids): """Generate a compressed vlan list ready for XML using a vlan set. Sample Use Case: Input vlan set: -------------- 1 - s = set([11, 50, 25, 30, 15, 16, 3, 8, 2, 1]) 2 - s = set([87, 11, 50, 25, 30, 15, 16, 3, 8, 2, 1, 88])...
[ "def", "_get_compressed_vlan_list", "(", "self", ",", "pvlan_ids", ")", ":", "if", "not", "pvlan_ids", ":", "return", "[", "]", "pvlan_list", "=", "list", "(", "pvlan_ids", ")", "pvlan_list", ".", "sort", "(", ")", "compressed_list", "=", "[", "]", "begin"...
Generate a compressed vlan list ready for XML using a vlan set. Sample Use Case: Input vlan set: -------------- 1 - s = set([11, 50, 25, 30, 15, 16, 3, 8, 2, 1]) 2 - s = set([87, 11, 50, 25, 30, 15, 16, 3, 8, 2, 1, 88]) Returned compressed XML list: -----------...
[ "Generate", "a", "compressed", "vlan", "list", "ready", "for", "XML", "using", "a", "vlan", "set", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py#L1121-L1166
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py
CiscoNexusMechanismDriver._restore_port_binding
def _restore_port_binding(self, switch_ip, pvlan_ids, port, native_vlan): """Restores a set of vlans for a given port.""" intf_type, nexus_port = nexus_help.split_interface_name(port) # If native_vlan is configured, this is isolated sin...
python
def _restore_port_binding(self, switch_ip, pvlan_ids, port, native_vlan): """Restores a set of vlans for a given port.""" intf_type, nexus_port = nexus_help.split_interface_name(port) # If native_vlan is configured, this is isolated sin...
[ "def", "_restore_port_binding", "(", "self", ",", "switch_ip", ",", "pvlan_ids", ",", "port", ",", "native_vlan", ")", ":", "intf_type", ",", "nexus_port", "=", "nexus_help", ".", "split_interface_name", "(", "port", ")", "if", "native_vlan", "!=", "0", ":", ...
Restores a set of vlans for a given port.
[ "Restores", "a", "set", "of", "vlans", "for", "a", "given", "port", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py#L1168-L1205
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py
CiscoNexusMechanismDriver._restore_vxlan_entries
def _restore_vxlan_entries(self, switch_ip, vlans): """Restore vxlan entries on a Nexus switch.""" count = 1 conf_str = '' vnsegment_sent = 0 path_str, conf_str = self.driver.start_create_vlan() # At this time, this will only configure vni information when needed ...
python
def _restore_vxlan_entries(self, switch_ip, vlans): """Restore vxlan entries on a Nexus switch.""" count = 1 conf_str = '' vnsegment_sent = 0 path_str, conf_str = self.driver.start_create_vlan() # At this time, this will only configure vni information when needed ...
[ "def", "_restore_vxlan_entries", "(", "self", ",", "switch_ip", ",", "vlans", ")", ":", "count", "=", "1", "conf_str", "=", "''", "vnsegment_sent", "=", "0", "path_str", ",", "conf_str", "=", "self", ".", "driver", ".", "start_create_vlan", "(", ")", "whil...
Restore vxlan entries on a Nexus switch.
[ "Restore", "vxlan", "entries", "on", "a", "Nexus", "switch", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py#L1207-L1238
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py
CiscoNexusMechanismDriver._configure_port_entries
def _configure_port_entries(self, port, vlan_id, device_id, host_id, vni, is_provider_vlan): """Create a nexus switch entry. if needed, create a VLAN in the appropriate switch or port and configure the appropriate interfaces for this VLAN. Called during ...
python
def _configure_port_entries(self, port, vlan_id, device_id, host_id, vni, is_provider_vlan): """Create a nexus switch entry. if needed, create a VLAN in the appropriate switch or port and configure the appropriate interfaces for this VLAN. Called during ...
[ "def", "_configure_port_entries", "(", "self", ",", "port", ",", "vlan_id", ",", "device_id", ",", "host_id", ",", "vni", ",", "is_provider_vlan", ")", ":", "connections", "=", "self", ".", "_get_active_port_connections", "(", "port", ",", "host_id", ")", "vla...
Create a nexus switch entry. if needed, create a VLAN in the appropriate switch or port and configure the appropriate interfaces for this VLAN. Called during update postcommit port event.
[ "Create", "a", "nexus", "switch", "entry", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py#L1240-L1296
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py
CiscoNexusMechanismDriver.configure_next_batch_of_vlans
def configure_next_batch_of_vlans(self, switch_ip): """Get next batch of vlans and send them to Nexus.""" next_range = self._pop_vlan_range( switch_ip, const.CREATE_VLAN_BATCH) if next_range: try: self.driver.set_all_vlan_states( ...
python
def configure_next_batch_of_vlans(self, switch_ip): """Get next batch of vlans and send them to Nexus.""" next_range = self._pop_vlan_range( switch_ip, const.CREATE_VLAN_BATCH) if next_range: try: self.driver.set_all_vlan_states( ...
[ "def", "configure_next_batch_of_vlans", "(", "self", ",", "switch_ip", ")", ":", "next_range", "=", "self", ".", "_pop_vlan_range", "(", "switch_ip", ",", "const", ".", "CREATE_VLAN_BATCH", ")", "if", "next_range", ":", "try", ":", "self", ".", "driver", ".", ...
Get next batch of vlans and send them to Nexus.
[ "Get", "next", "batch", "of", "vlans", "and", "send", "them", "to", "Nexus", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py#L1298-L1336
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py
CiscoNexusMechanismDriver.configure_switch_entries
def configure_switch_entries(self, switch_ip, port_bindings): """Create a nexus switch entry in Nexus. The port_bindings is sorted by vlan_id, vni, port_id. When there is a change in vlan_id or vni, then vlan data is configured in Nexus device. Otherwise we check if there is a c...
python
def configure_switch_entries(self, switch_ip, port_bindings): """Create a nexus switch entry in Nexus. The port_bindings is sorted by vlan_id, vni, port_id. When there is a change in vlan_id or vni, then vlan data is configured in Nexus device. Otherwise we check if there is a c...
[ "def", "configure_switch_entries", "(", "self", ",", "switch_ip", ",", "port_bindings", ")", ":", "prev_vlan", "=", "-", "1", "prev_vni", "=", "-", "1", "prev_port", "=", "None", "prev_native_vlan", "=", "0", "starttime", "=", "time", ".", "time", "(", ")"...
Create a nexus switch entry in Nexus. The port_bindings is sorted by vlan_id, vni, port_id. When there is a change in vlan_id or vni, then vlan data is configured in Nexus device. Otherwise we check if there is a change in port_id where we configure the port with vlan trunk conf...
[ "Create", "a", "nexus", "switch", "entry", "in", "Nexus", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py#L1338-L1436
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py
CiscoNexusMechanismDriver._delete_nxos_db
def _delete_nxos_db(self, unused, vlan_id, device_id, host_id, vni, is_provider_vlan): """Delete the nexus database entry. Called during delete precommit port event. """ try: rows = nxos_db.get_nexusvm_bindings(vlan_id, device_id) for row ...
python
def _delete_nxos_db(self, unused, vlan_id, device_id, host_id, vni, is_provider_vlan): """Delete the nexus database entry. Called during delete precommit port event. """ try: rows = nxos_db.get_nexusvm_bindings(vlan_id, device_id) for row ...
[ "def", "_delete_nxos_db", "(", "self", ",", "unused", ",", "vlan_id", ",", "device_id", ",", "host_id", ",", "vni", ",", "is_provider_vlan", ")", ":", "try", ":", "rows", "=", "nxos_db", ".", "get_nexusvm_bindings", "(", "vlan_id", ",", "device_id", ")", "...
Delete the nexus database entry. Called during delete precommit port event.
[ "Delete", "the", "nexus", "database", "entry", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py#L1438-L1450
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py
CiscoNexusMechanismDriver._delete_port_channel_resources
def _delete_port_channel_resources(self, host_id, switch_ip, intf_type, nexus_port, port_id): '''This determines if port channel id needs to be freed.''' # if this connection is not a port-channel, nothing to do. if intf_type != 'port-channel': ...
python
def _delete_port_channel_resources(self, host_id, switch_ip, intf_type, nexus_port, port_id): '''This determines if port channel id needs to be freed.''' # if this connection is not a port-channel, nothing to do. if intf_type != 'port-channel': ...
[ "def", "_delete_port_channel_resources", "(", "self", ",", "host_id", ",", "switch_ip", ",", "intf_type", ",", "nexus_port", ",", "port_id", ")", ":", "if", "intf_type", "!=", "'port-channel'", ":", "return", "try", ":", "vpc", "=", "nxos_db", ".", "get_switch...
This determines if port channel id needs to be freed.
[ "This", "determines", "if", "port", "channel", "id", "needs", "to", "be", "freed", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py#L1452-L1522
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py
CiscoNexusMechanismDriver._delete_switch_entry
def _delete_switch_entry(self, port, vlan_id, device_id, host_id, vni, is_provider_vlan): """Delete the nexus switch entry. By accessing the current db entries determine if switch configuration can be removed. Called during delete postcommit port event. ...
python
def _delete_switch_entry(self, port, vlan_id, device_id, host_id, vni, is_provider_vlan): """Delete the nexus switch entry. By accessing the current db entries determine if switch configuration can be removed. Called during delete postcommit port event. ...
[ "def", "_delete_switch_entry", "(", "self", ",", "port", ",", "vlan_id", ",", "device_id", ",", "host_id", ",", "vni", ",", "is_provider_vlan", ")", ":", "connections", "=", "self", ".", "_get_active_port_connections", "(", "port", ",", "host_id", ")", "vlan_a...
Delete the nexus switch entry. By accessing the current db entries determine if switch configuration can be removed. Called during delete postcommit port event.
[ "Delete", "the", "nexus", "switch", "entry", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py#L1524-L1596
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py
CiscoNexusMechanismDriver.create_port_postcommit
def create_port_postcommit(self, context): """Create port non-database commit event.""" # No new events are handled until replay # thread has put the switch in active state. # If a switch is in active state, verify # the switch is still in active state # before accepting...
python
def create_port_postcommit(self, context): """Create port non-database commit event.""" # No new events are handled until replay # thread has put the switch in active state. # If a switch is in active state, verify # the switch is still in active state # before accepting...
[ "def", "create_port_postcommit", "(", "self", ",", "context", ")", ":", "vlan_segment", ",", "vxlan_segment", "=", "self", ".", "_get_segments", "(", "context", ".", "top_bound_segment", ",", "context", ".", "bottom_bound_segment", ")", "if", "not", "self", ".",...
Create port non-database commit event.
[ "Create", "port", "non", "-", "database", "commit", "event", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py#L1700-L1757
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py
CiscoNexusMechanismDriver.update_port_precommit
def update_port_precommit(self, context): """Update port pre-database transaction commit event.""" vlan_segment, vxlan_segment = self._get_segments( context.top_bound_segment, context.bottom_bound_segment) orig_vlan_segment, orig_vxlan_segment = self._get_segments( contex...
python
def update_port_precommit(self, context): """Update port pre-database transaction commit event.""" vlan_segment, vxlan_segment = self._get_segments( context.top_bound_segment, context.bottom_bound_segment) orig_vlan_segment, orig_vxlan_segment = self._get_segments( contex...
[ "def", "update_port_precommit", "(", "self", ",", "context", ")", ":", "vlan_segment", ",", "vxlan_segment", "=", "self", ".", "_get_segments", "(", "context", ".", "top_bound_segment", ",", "context", ".", "bottom_bound_segment", ")", "orig_vlan_segment", ",", "o...
Update port pre-database transaction commit event.
[ "Update", "port", "pre", "-", "database", "transaction", "commit", "event", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py#L1760-L1779
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py
CiscoNexusMechanismDriver.update_port_postcommit
def update_port_postcommit(self, context): """Update port non-database commit event.""" vlan_segment, vxlan_segment = self._get_segments( context.top_bound_segment, context.bottom_bound_segment) orig_vlan_segment, orig_vxlan_segment = self._get_segments( context.original_...
python
def update_port_postcommit(self, context): """Update port non-database commit event.""" vlan_segment, vxlan_segment = self._get_segments( context.top_bound_segment, context.bottom_bound_segment) orig_vlan_segment, orig_vxlan_segment = self._get_segments( context.original_...
[ "def", "update_port_postcommit", "(", "self", ",", "context", ")", ":", "vlan_segment", ",", "vxlan_segment", "=", "self", ".", "_get_segments", "(", "context", ".", "top_bound_segment", ",", "context", ".", "bottom_bound_segment", ")", "orig_vlan_segment", ",", "...
Update port non-database commit event.
[ "Update", "port", "non", "-", "database", "commit", "event", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py#L1782-L1815
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py
CiscoNexusMechanismDriver.delete_port_precommit
def delete_port_precommit(self, context): """Delete port pre-database commit event.""" if self._is_supported_deviceowner(context.current): vlan_segment, vxlan_segment = self._get_segments( context.top_bound_segment, ...
python
def delete_port_precommit(self, context): """Delete port pre-database commit event.""" if self._is_supported_deviceowner(context.current): vlan_segment, vxlan_segment = self._get_segments( context.top_bound_segment, ...
[ "def", "delete_port_precommit", "(", "self", ",", "context", ")", ":", "if", "self", ".", "_is_supported_deviceowner", "(", "context", ".", "current", ")", ":", "vlan_segment", ",", "vxlan_segment", "=", "self", ".", "_get_segments", "(", "context", ".", "top_...
Delete port pre-database commit event.
[ "Delete", "port", "pre", "-", "database", "commit", "event", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py#L1818-L1827
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py
CiscoNexusMechanismDriver.delete_port_postcommit
def delete_port_postcommit(self, context): """Delete port non-database commit event.""" if self._is_supported_deviceowner(context.current): vlan_segment, vxlan_segment = self._get_segments( context.top_bound_segment, ...
python
def delete_port_postcommit(self, context): """Delete port non-database commit event.""" if self._is_supported_deviceowner(context.current): vlan_segment, vxlan_segment = self._get_segments( context.top_bound_segment, ...
[ "def", "delete_port_postcommit", "(", "self", ",", "context", ")", ":", "if", "self", ".", "_is_supported_deviceowner", "(", "context", ".", "current", ")", ":", "vlan_segment", ",", "vxlan_segment", "=", "self", ".", "_get_segments", "(", "context", ".", "top...
Delete port non-database commit event.
[ "Delete", "port", "non", "-", "database", "commit", "event", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py#L1830-L1839
train
openstack/networking-cisco
networking_cisco/apps/saf/server/cisco_dfa_rest.py
DFARESTClient._detect_iplus
def _detect_iplus(self): """Check the DCNM version and determine if it's for iplus""" ver_expr = "([0-9]+)\.([0-9]+)\((.*)\)" re.compile(ver_expr) v1 = re.match(ver_expr, self._cur_ver) v2 = re.match(ver_expr, self._base_ver) if int(v1.group(1)) > int(v2.group(1)): ...
python
def _detect_iplus(self): """Check the DCNM version and determine if it's for iplus""" ver_expr = "([0-9]+)\.([0-9]+)\((.*)\)" re.compile(ver_expr) v1 = re.match(ver_expr, self._cur_ver) v2 = re.match(ver_expr, self._base_ver) if int(v1.group(1)) > int(v2.group(1)): ...
[ "def", "_detect_iplus", "(", "self", ")", ":", "ver_expr", "=", "\"([0-9]+)\\.([0-9]+)\\((.*)\\)\"", "re", ".", "compile", "(", "ver_expr", ")", "v1", "=", "re", ".", "match", "(", "ver_expr", ",", "self", ".", "_cur_ver", ")", "v2", "=", "re", ".", "mat...
Check the DCNM version and determine if it's for iplus
[ "Check", "the", "DCNM", "version", "and", "determine", "if", "it", "s", "for", "iplus" ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/cisco_dfa_rest.py#L75-L92
train
openstack/networking-cisco
networking_cisco/apps/saf/server/cisco_dfa_rest.py
DFARESTClient.get_segmentid_range
def get_segmentid_range(self, orchestrator_id): """Get segment id range from DCNM. """ url = "%s/%s" % (self._segmentid_ranges_url, orchestrator_id) res = self._send_request('GET', url, None, 'segment-id range') if res and res.status_code in self._resp_ok: return res.json()
python
def get_segmentid_range(self, orchestrator_id): """Get segment id range from DCNM. """ url = "%s/%s" % (self._segmentid_ranges_url, orchestrator_id) res = self._send_request('GET', url, None, 'segment-id range') if res and res.status_code in self._resp_ok: return res.json()
[ "def", "get_segmentid_range", "(", "self", ",", "orchestrator_id", ")", ":", "url", "=", "\"%s/%s\"", "%", "(", "self", ".", "_segmentid_ranges_url", ",", "orchestrator_id", ")", "res", "=", "self", ".", "_send_request", "(", "'GET'", ",", "url", ",", "None"...
Get segment id range from DCNM.
[ "Get", "segment", "id", "range", "from", "DCNM", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/cisco_dfa_rest.py#L97-L104
train
openstack/networking-cisco
networking_cisco/apps/saf/server/cisco_dfa_rest.py
DFARESTClient.set_segmentid_range
def set_segmentid_range(self, orchestrator_id, segid_min, segid_max): """set segment id range in DCNM. """ url = self._segmentid_ranges_url payload = {'orchestratorId': orchestrator_id, 'segmentIdRanges': "%s-%s" % (segid_min, segid_max)} res = self._send_request('P...
python
def set_segmentid_range(self, orchestrator_id, segid_min, segid_max): """set segment id range in DCNM. """ url = self._segmentid_ranges_url payload = {'orchestratorId': orchestrator_id, 'segmentIdRanges': "%s-%s" % (segid_min, segid_max)} res = self._send_request('P...
[ "def", "set_segmentid_range", "(", "self", ",", "orchestrator_id", ",", "segid_min", ",", "segid_max", ")", ":", "url", "=", "self", ".", "_segmentid_ranges_url", "payload", "=", "{", "'orchestratorId'", ":", "orchestrator_id", ",", "'segmentIdRanges'", ":", "\"%s...
set segment id range in DCNM.
[ "set", "segment", "id", "range", "in", "DCNM", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/cisco_dfa_rest.py#L106-L119
train
openstack/networking-cisco
networking_cisco/apps/saf/server/cisco_dfa_rest.py
DFARESTClient._set_default_cfg_profile
def _set_default_cfg_profile(self): """Set default network config profile. Check whether the default_cfg_profile value exist in the current version of DCNM. If not, set it to new default value which is supported by latest version. """ try: cfgplist = self.con...
python
def _set_default_cfg_profile(self): """Set default network config profile. Check whether the default_cfg_profile value exist in the current version of DCNM. If not, set it to new default value which is supported by latest version. """ try: cfgplist = self.con...
[ "def", "_set_default_cfg_profile", "(", "self", ")", ":", "try", ":", "cfgplist", "=", "self", ".", "config_profile_list", "(", ")", "if", "self", ".", "default_cfg_profile", "not", "in", "cfgplist", ":", "self", ".", "default_cfg_profile", "=", "(", "'default...
Set default network config profile. Check whether the default_cfg_profile value exist in the current version of DCNM. If not, set it to new default value which is supported by latest version.
[ "Set", "default", "network", "config", "profile", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/cisco_dfa_rest.py#L135-L150
train
openstack/networking-cisco
networking_cisco/apps/saf/server/cisco_dfa_rest.py
DFARESTClient._create_network
def _create_network(self, network_info): """Send create network request to DCNM. :param network_info: network parameters to be created on DCNM """ url = self._create_network_url % (network_info['organizationName'], network_info['partitionName'])...
python
def _create_network(self, network_info): """Send create network request to DCNM. :param network_info: network parameters to be created on DCNM """ url = self._create_network_url % (network_info['organizationName'], network_info['partitionName'])...
[ "def", "_create_network", "(", "self", ",", "network_info", ")", ":", "url", "=", "self", ".", "_create_network_url", "%", "(", "network_info", "[", "'organizationName'", "]", ",", "network_info", "[", "'partitionName'", "]", ")", "payload", "=", "network_info",...
Send create network request to DCNM. :param network_info: network parameters to be created on DCNM
[ "Send", "create", "network", "request", "to", "DCNM", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/cisco_dfa_rest.py#L152-L163
train
openstack/networking-cisco
networking_cisco/apps/saf/server/cisco_dfa_rest.py
DFARESTClient._config_profile_get
def _config_profile_get(self, thisprofile): """Get information of a config profile from DCNM. :param thisprofile: network config profile in request """ url = self._cfg_profile_get_url % (thisprofile) payload = {} res = self._send_request('GET', url, payload, 'config-pro...
python
def _config_profile_get(self, thisprofile): """Get information of a config profile from DCNM. :param thisprofile: network config profile in request """ url = self._cfg_profile_get_url % (thisprofile) payload = {} res = self._send_request('GET', url, payload, 'config-pro...
[ "def", "_config_profile_get", "(", "self", ",", "thisprofile", ")", ":", "url", "=", "self", ".", "_cfg_profile_get_url", "%", "(", "thisprofile", ")", "payload", "=", "{", "}", "res", "=", "self", ".", "_send_request", "(", "'GET'", ",", "url", ",", "pa...
Get information of a config profile from DCNM. :param thisprofile: network config profile in request
[ "Get", "information", "of", "a", "config", "profile", "from", "DCNM", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/cisco_dfa_rest.py#L165-L175
train
openstack/networking-cisco
networking_cisco/apps/saf/server/cisco_dfa_rest.py
DFARESTClient._config_profile_list
def _config_profile_list(self): """Get list of supported config profile from DCNM.""" url = self._cfg_profile_list_url payload = {} try: res = self._send_request('GET', url, payload, 'config-profile') if res and res.status_code in self._resp_ok: r...
python
def _config_profile_list(self): """Get list of supported config profile from DCNM.""" url = self._cfg_profile_list_url payload = {} try: res = self._send_request('GET', url, payload, 'config-profile') if res and res.status_code in self._resp_ok: r...
[ "def", "_config_profile_list", "(", "self", ")", ":", "url", "=", "self", ".", "_cfg_profile_list_url", "payload", "=", "{", "}", "try", ":", "res", "=", "self", ".", "_send_request", "(", "'GET'", ",", "url", ",", "payload", ",", "'config-profile'", ")", ...
Get list of supported config profile from DCNM.
[ "Get", "list", "of", "supported", "config", "profile", "from", "DCNM", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/cisco_dfa_rest.py#L177-L187
train
openstack/networking-cisco
networking_cisco/apps/saf/server/cisco_dfa_rest.py
DFARESTClient._get_settings
def _get_settings(self): """Get global mobility domain from DCNM.""" url = self._global_settings_url payload = {} res = self._send_request('GET', url, payload, 'settings') if res and res.status_code in self._resp_ok: return res.json()
python
def _get_settings(self): """Get global mobility domain from DCNM.""" url = self._global_settings_url payload = {} res = self._send_request('GET', url, payload, 'settings') if res and res.status_code in self._resp_ok: return res.json()
[ "def", "_get_settings", "(", "self", ")", ":", "url", "=", "self", ".", "_global_settings_url", "payload", "=", "{", "}", "res", "=", "self", ".", "_send_request", "(", "'GET'", ",", "url", ",", "payload", ",", "'settings'", ")", "if", "res", "and", "r...
Get global mobility domain from DCNM.
[ "Get", "global", "mobility", "domain", "from", "DCNM", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/cisco_dfa_rest.py#L189-L195
train
openstack/networking-cisco
networking_cisco/apps/saf/server/cisco_dfa_rest.py
DFARESTClient._create_org
def _create_org(self, orch_id, name, desc): """Create organization on the DCNM. :param orch_id: orchestrator ID :param name: Name of organization :param desc: Description of organization """ url = self._org_url payload = { "organizationName": name, ...
python
def _create_org(self, orch_id, name, desc): """Create organization on the DCNM. :param orch_id: orchestrator ID :param name: Name of organization :param desc: Description of organization """ url = self._org_url payload = { "organizationName": name, ...
[ "def", "_create_org", "(", "self", ",", "orch_id", ",", "name", ",", "desc", ")", ":", "url", "=", "self", ".", "_org_url", "payload", "=", "{", "\"organizationName\"", ":", "name", ",", "\"description\"", ":", "name", "if", "len", "(", "desc", ")", "=...
Create organization on the DCNM. :param orch_id: orchestrator ID :param name: Name of organization :param desc: Description of organization
[ "Create", "organization", "on", "the", "DCNM", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/cisco_dfa_rest.py#L208-L221
train
openstack/networking-cisco
networking_cisco/apps/saf/server/cisco_dfa_rest.py
DFARESTClient._create_or_update_partition
def _create_or_update_partition(self, org_name, part_name, desc, dci_id=UNKNOWN_DCI_ID, vrf_prof=None, service_node_ip=UNKNOWN_SRVN_NODE_IP, operation='POST'): """Send create or update partition request t...
python
def _create_or_update_partition(self, org_name, part_name, desc, dci_id=UNKNOWN_DCI_ID, vrf_prof=None, service_node_ip=UNKNOWN_SRVN_NODE_IP, operation='POST'): """Send create or update partition request t...
[ "def", "_create_or_update_partition", "(", "self", ",", "org_name", ",", "part_name", ",", "desc", ",", "dci_id", "=", "UNKNOWN_DCI_ID", ",", "vrf_prof", "=", "None", ",", "service_node_ip", "=", "UNKNOWN_SRVN_NODE_IP", ",", "operation", "=", "'POST'", ")", ":",...
Send create or update partition request to the DCNM. :param org_name: name of organization :param part_name: name of partition :param desc: description of partition :dci_id: DCI ID for inter-DC :vrf_prof: VRF Profile Name :service_node_ip: Service Node's Address
[ "Send", "create", "or", "update", "partition", "request", "to", "the", "DCNM", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/cisco_dfa_rest.py#L223-L271
train
openstack/networking-cisco
networking_cisco/apps/saf/server/cisco_dfa_rest.py
DFARESTClient._get_partition
def _get_partition(self, org_name, part_name=None): """send get partition request to the DCNM. :param org_name: name of organization :param part_name: name of partition """ if part_name is None: part_name = self._part_name url = self._update_part_url % (org_n...
python
def _get_partition(self, org_name, part_name=None): """send get partition request to the DCNM. :param org_name: name of organization :param part_name: name of partition """ if part_name is None: part_name = self._part_name url = self._update_part_url % (org_n...
[ "def", "_get_partition", "(", "self", ",", "org_name", ",", "part_name", "=", "None", ")", ":", "if", "part_name", "is", "None", ":", "part_name", "=", "self", ".", "_part_name", "url", "=", "self", ".", "_update_part_url", "%", "(", "org_name", ",", "pa...
send get partition request to the DCNM. :param org_name: name of organization :param part_name: name of partition
[ "send", "get", "partition", "request", "to", "the", "DCNM", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/cisco_dfa_rest.py#L273-L284
train
openstack/networking-cisco
networking_cisco/apps/saf/server/cisco_dfa_rest.py
DFARESTClient.update_partition_static_route
def update_partition_static_route(self, org_name, part_name, static_ip_list, vrf_prof=None, service_node_ip=None): """Send static route update requests to DCNM. :param org_name: name of organization :param part_name: na...
python
def update_partition_static_route(self, org_name, part_name, static_ip_list, vrf_prof=None, service_node_ip=None): """Send static route update requests to DCNM. :param org_name: name of organization :param part_name: na...
[ "def", "update_partition_static_route", "(", "self", ",", "org_name", ",", "part_name", ",", "static_ip_list", ",", "vrf_prof", "=", "None", ",", "service_node_ip", "=", "None", ")", ":", "if", "part_name", "is", "None", ":", "part_name", "=", "self", ".", "...
Send static route update requests to DCNM. :param org_name: name of organization :param part_name: name of partition :static_ip_list: List of static IP addresses :vrf_prof: VRF Profile :service_node_ip: Service Node IP address
[ "Send", "static", "route", "update", "requests", "to", "DCNM", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/cisco_dfa_rest.py#L286-L323
train
openstack/networking-cisco
networking_cisco/apps/saf/server/cisco_dfa_rest.py
DFARESTClient._delete_org
def _delete_org(self, org_name): """Send organization delete request to DCNM. :param org_name: name of organization to be deleted """ url = self._del_org_url % (org_name) return self._send_request('DELETE', url, '', 'organization')
python
def _delete_org(self, org_name): """Send organization delete request to DCNM. :param org_name: name of organization to be deleted """ url = self._del_org_url % (org_name) return self._send_request('DELETE', url, '', 'organization')
[ "def", "_delete_org", "(", "self", ",", "org_name", ")", ":", "url", "=", "self", ".", "_del_org_url", "%", "(", "org_name", ")", "return", "self", ".", "_send_request", "(", "'DELETE'", ",", "url", ",", "''", ",", "'organization'", ")" ]
Send organization delete request to DCNM. :param org_name: name of organization to be deleted
[ "Send", "organization", "delete", "request", "to", "DCNM", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/cisco_dfa_rest.py#L325-L331
train
openstack/networking-cisco
networking_cisco/apps/saf/server/cisco_dfa_rest.py
DFARESTClient._delete_network
def _delete_network(self, network_info): """Send network delete request to DCNM. :param network_info: contains network info to be deleted. """ org_name = network_info.get('organizationName', '') part_name = network_info.get('partitionName', '') segment_id = network_info[...
python
def _delete_network(self, network_info): """Send network delete request to DCNM. :param network_info: contains network info to be deleted. """ org_name = network_info.get('organizationName', '') part_name = network_info.get('partitionName', '') segment_id = network_info[...
[ "def", "_delete_network", "(", "self", ",", "network_info", ")", ":", "org_name", "=", "network_info", ".", "get", "(", "'organizationName'", ",", "''", ")", "part_name", "=", "network_info", ".", "get", "(", "'partitionName'", ",", "''", ")", "segment_id", ...
Send network delete request to DCNM. :param network_info: contains network info to be deleted.
[ "Send", "network", "delete", "request", "to", "DCNM", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/cisco_dfa_rest.py#L342-L357
train
openstack/networking-cisco
networking_cisco/apps/saf/server/cisco_dfa_rest.py
DFARESTClient._get_network
def _get_network(self, network_info): """Send network get request to DCNM. :param network_info: contains network info to query. """ org_name = network_info.get('organizationName', '') part_name = network_info.get('partitionName', '') segment_id = network_info['segmentId'...
python
def _get_network(self, network_info): """Send network get request to DCNM. :param network_info: contains network info to query. """ org_name = network_info.get('organizationName', '') part_name = network_info.get('partitionName', '') segment_id = network_info['segmentId'...
[ "def", "_get_network", "(", "self", ",", "network_info", ")", ":", "org_name", "=", "network_info", ".", "get", "(", "'organizationName'", ",", "''", ")", "part_name", "=", "network_info", ".", "get", "(", "'partitionName'", ",", "''", ")", "segment_id", "="...
Send network get request to DCNM. :param network_info: contains network info to query.
[ "Send", "network", "get", "request", "to", "DCNM", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/cisco_dfa_rest.py#L359-L368
train
openstack/networking-cisco
networking_cisco/apps/saf/server/cisco_dfa_rest.py
DFARESTClient._login_request
def _login_request(self, url_login): """Internal function to send login request. """ expiration_time = self._exp_time payload = {'expirationTime': expiration_time} # TODO(padkrish), after testing with certificates, make the # verify option configurable. res = requests.po...
python
def _login_request(self, url_login): """Internal function to send login request. """ expiration_time = self._exp_time payload = {'expirationTime': expiration_time} # TODO(padkrish), after testing with certificates, make the # verify option configurable. res = requests.po...
[ "def", "_login_request", "(", "self", ",", "url_login", ")", ":", "expiration_time", "=", "self", ".", "_exp_time", "payload", "=", "{", "'expirationTime'", ":", "expiration_time", "}", "res", "=", "requests", ".", "post", "(", "url_login", ",", "data", "=",...
Internal function to send login request.
[ "Internal", "function", "to", "send", "login", "request", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/cisco_dfa_rest.py#L370-L385
train
openstack/networking-cisco
networking_cisco/apps/saf/server/cisco_dfa_rest.py
DFARESTClient._logout_request
def _logout_request(self, url_logout): """Internal logout request to DCNM. """ requests.post(url_logout, headers=self._req_headers, timeout=self.timeout_resp, verify=False)
python
def _logout_request(self, url_logout): """Internal logout request to DCNM. """ requests.post(url_logout, headers=self._req_headers, timeout=self.timeout_resp, verify=False)
[ "def", "_logout_request", "(", "self", ",", "url_logout", ")", ":", "requests", ".", "post", "(", "url_logout", ",", "headers", "=", "self", ".", "_req_headers", ",", "timeout", "=", "self", ".", "timeout_resp", ",", "verify", "=", "False", ")" ]
Internal logout request to DCNM.
[ "Internal", "logout", "request", "to", "DCNM", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/cisco_dfa_rest.py#L392-L397
train
openstack/networking-cisco
networking_cisco/apps/saf/server/cisco_dfa_rest.py
DFARESTClient._send_request
def _send_request(self, operation, url, payload, desc): """Send request to DCNM.""" res = None try: payload_json = None if payload and payload != '': payload_json = jsonutils.dumps(payload) self._login() desc_lookup = {'POST': ' cr...
python
def _send_request(self, operation, url, payload, desc): """Send request to DCNM.""" res = None try: payload_json = None if payload and payload != '': payload_json = jsonutils.dumps(payload) self._login() desc_lookup = {'POST': ' cr...
[ "def", "_send_request", "(", "self", ",", "operation", ",", "url", ",", "payload", ",", "desc", ")", ":", "res", "=", "None", "try", ":", "payload_json", "=", "None", "if", "payload", "and", "payload", "!=", "''", ":", "payload_json", "=", "jsonutils", ...
Send request to DCNM.
[ "Send", "request", "to", "DCNM", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/cisco_dfa_rest.py#L404-L429
train
openstack/networking-cisco
networking_cisco/apps/saf/server/cisco_dfa_rest.py
DFARESTClient.config_profile_list
def config_profile_list(self): """Return config profile list from DCNM.""" these_profiles = self._config_profile_list() or [] profile_list = [q for p in these_profiles for q in [p.get('profileName')]] return profile_list
python
def config_profile_list(self): """Return config profile list from DCNM.""" these_profiles = self._config_profile_list() or [] profile_list = [q for p in these_profiles for q in [p.get('profileName')]] return profile_list
[ "def", "config_profile_list", "(", "self", ")", ":", "these_profiles", "=", "self", ".", "_config_profile_list", "(", ")", "or", "[", "]", "profile_list", "=", "[", "q", "for", "p", "in", "these_profiles", "for", "q", "in", "[", "p", ".", "get", "(", "...
Return config profile list from DCNM.
[ "Return", "config", "profile", "list", "from", "DCNM", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/cisco_dfa_rest.py#L431-L437
train
openstack/networking-cisco
networking_cisco/apps/saf/server/cisco_dfa_rest.py
DFARESTClient.config_profile_fwding_mode_get
def config_profile_fwding_mode_get(self, profile_name): """Return forwarding mode of given config profile.""" profile_params = self._config_profile_get(profile_name) fwd_cli = 'fabric forwarding mode proxy-gateway' if profile_params and fwd_cli in profile_params['configCommands']: ...
python
def config_profile_fwding_mode_get(self, profile_name): """Return forwarding mode of given config profile.""" profile_params = self._config_profile_get(profile_name) fwd_cli = 'fabric forwarding mode proxy-gateway' if profile_params and fwd_cli in profile_params['configCommands']: ...
[ "def", "config_profile_fwding_mode_get", "(", "self", ",", "profile_name", ")", ":", "profile_params", "=", "self", ".", "_config_profile_get", "(", "profile_name", ")", "fwd_cli", "=", "'fabric forwarding mode proxy-gateway'", "if", "profile_params", "and", "fwd_cli", ...
Return forwarding mode of given config profile.
[ "Return", "forwarding", "mode", "of", "given", "config", "profile", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/cisco_dfa_rest.py#L439-L447
train
openstack/networking-cisco
networking_cisco/apps/saf/server/cisco_dfa_rest.py
DFARESTClient.get_config_profile_for_network
def get_config_profile_for_network(self, net_name): """Get the list of profiles.""" cfgplist = self.config_profile_list() cfgname = net_name.partition(':')[2] cfgtuple = set() for cfg_prof in cfgplist: if cfg_prof.startswith('defaultNetwork'): cfg_al...
python
def get_config_profile_for_network(self, net_name): """Get the list of profiles.""" cfgplist = self.config_profile_list() cfgname = net_name.partition(':')[2] cfgtuple = set() for cfg_prof in cfgplist: if cfg_prof.startswith('defaultNetwork'): cfg_al...
[ "def", "get_config_profile_for_network", "(", "self", ",", "net_name", ")", ":", "cfgplist", "=", "self", ".", "config_profile_list", "(", ")", "cfgname", "=", "net_name", ".", "partition", "(", "':'", ")", "[", "2", "]", "cfgtuple", "=", "set", "(", ")", ...
Get the list of profiles.
[ "Get", "the", "list", "of", "profiles", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/cisco_dfa_rest.py#L449-L468
train
openstack/networking-cisco
networking_cisco/apps/saf/server/cisco_dfa_rest.py
DFARESTClient.delete_network
def delete_network(self, tenant_name, network): """Delete network on the DCNM. :param tenant_name: name of tenant the network belongs to :param network: object that contains network parameters """ seg_id = network.segmentation_id network_info = { 'organizatio...
python
def delete_network(self, tenant_name, network): """Delete network on the DCNM. :param tenant_name: name of tenant the network belongs to :param network: object that contains network parameters """ seg_id = network.segmentation_id network_info = { 'organizatio...
[ "def", "delete_network", "(", "self", ",", "tenant_name", ",", "network", ")", ":", "seg_id", "=", "network", ".", "segmentation_id", "network_info", "=", "{", "'organizationName'", ":", "tenant_name", ",", "'partitionName'", ":", "self", ".", "_part_name", ",",...
Delete network on the DCNM. :param tenant_name: name of tenant the network belongs to :param network: object that contains network parameters
[ "Delete", "network", "on", "the", "DCNM", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/cisco_dfa_rest.py#L615-L635
train
openstack/networking-cisco
networking_cisco/apps/saf/server/cisco_dfa_rest.py
DFARESTClient.delete_service_network
def delete_service_network(self, tenant_name, network): """Delete service network on the DCNM. :param tenant_name: name of tenant the network belongs to :param network: object that contains network parameters """ network_info = {} part_name = network.part_name i...
python
def delete_service_network(self, tenant_name, network): """Delete service network on the DCNM. :param tenant_name: name of tenant the network belongs to :param network: object that contains network parameters """ network_info = {} part_name = network.part_name i...
[ "def", "delete_service_network", "(", "self", ",", "tenant_name", ",", "network", ")", ":", "network_info", "=", "{", "}", "part_name", "=", "network", ".", "part_name", "if", "not", "part_name", ":", "part_name", "=", "self", ".", "_part_name", "seg_id", "=...
Delete service network on the DCNM. :param tenant_name: name of tenant the network belongs to :param network: object that contains network parameters
[ "Delete", "service", "network", "on", "the", "DCNM", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/cisco_dfa_rest.py#L637-L681
train
openstack/networking-cisco
networking_cisco/apps/saf/server/cisco_dfa_rest.py
DFARESTClient.delete_project
def delete_project(self, tenant_name, part_name): """Delete project on the DCNM. :param tenant_name: name of project. :param part_name: name of partition. """ res = self._delete_partition(tenant_name, part_name) if res and res.status_code in self._resp_ok: LO...
python
def delete_project(self, tenant_name, part_name): """Delete project on the DCNM. :param tenant_name: name of project. :param part_name: name of partition. """ res = self._delete_partition(tenant_name, part_name) if res and res.status_code in self._resp_ok: LO...
[ "def", "delete_project", "(", "self", ",", "tenant_name", ",", "part_name", ")", ":", "res", "=", "self", ".", "_delete_partition", "(", "tenant_name", ",", "part_name", ")", "if", "res", "and", "res", ".", "status_code", "in", "self", ".", "_resp_ok", ":"...
Delete project on the DCNM. :param tenant_name: name of project. :param part_name: name of partition.
[ "Delete", "project", "on", "the", "DCNM", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/cisco_dfa_rest.py#L683-L703
train
openstack/networking-cisco
networking_cisco/apps/saf/server/cisco_dfa_rest.py
DFARESTClient.create_project
def create_project(self, orch_id, org_name, part_name, dci_id, desc=None): """Create project on the DCNM. :param orch_id: orchestrator ID :param org_name: name of organization. :param part_name: name of partition. :param dci_id: Data Center interconnect id. :param desc: ...
python
def create_project(self, orch_id, org_name, part_name, dci_id, desc=None): """Create project on the DCNM. :param orch_id: orchestrator ID :param org_name: name of organization. :param part_name: name of partition. :param dci_id: Data Center interconnect id. :param desc: ...
[ "def", "create_project", "(", "self", ",", "orch_id", ",", "org_name", ",", "part_name", ",", "dci_id", ",", "desc", "=", "None", ")", ":", "desc", "=", "desc", "or", "org_name", "res", "=", "self", ".", "_create_org", "(", "orch_id", ",", "org_name", ...
Create project on the DCNM. :param orch_id: orchestrator ID :param org_name: name of organization. :param part_name: name of partition. :param dci_id: Data Center interconnect id. :param desc: description of project.
[ "Create", "project", "on", "the", "DCNM", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/cisco_dfa_rest.py#L719-L738
train
openstack/networking-cisco
networking_cisco/apps/saf/server/cisco_dfa_rest.py
DFARESTClient.update_project
def update_project(self, org_name, part_name, dci_id=UNKNOWN_DCI_ID, service_node_ip=UNKNOWN_SRVN_NODE_IP, vrf_prof=None, desc=None): """Update project on the DCNM. :param org_name: name of organization. :param part_name: name of partition. ...
python
def update_project(self, org_name, part_name, dci_id=UNKNOWN_DCI_ID, service_node_ip=UNKNOWN_SRVN_NODE_IP, vrf_prof=None, desc=None): """Update project on the DCNM. :param org_name: name of organization. :param part_name: name of partition. ...
[ "def", "update_project", "(", "self", ",", "org_name", ",", "part_name", ",", "dci_id", "=", "UNKNOWN_DCI_ID", ",", "service_node_ip", "=", "UNKNOWN_SRVN_NODE_IP", ",", "vrf_prof", "=", "None", ",", "desc", "=", "None", ")", ":", "desc", "=", "desc", "or", ...
Update project on the DCNM. :param org_name: name of organization. :param part_name: name of partition. :param dci_id: Data Center interconnect id. :param desc: description of project.
[ "Update", "project", "on", "the", "DCNM", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/cisco_dfa_rest.py#L740-L761
train
openstack/networking-cisco
networking_cisco/apps/saf/server/cisco_dfa_rest.py
DFARESTClient.create_partition
def create_partition(self, org_name, part_name, dci_id, vrf_prof, service_node_ip=None, desc=None): """Create partition on the DCNM. :param org_name: name of organization to be created :param part_name: name of partition to be created :param dci_id: DCI ID ...
python
def create_partition(self, org_name, part_name, dci_id, vrf_prof, service_node_ip=None, desc=None): """Create partition on the DCNM. :param org_name: name of organization to be created :param part_name: name of partition to be created :param dci_id: DCI ID ...
[ "def", "create_partition", "(", "self", ",", "org_name", ",", "part_name", ",", "dci_id", ",", "vrf_prof", ",", "service_node_ip", "=", "None", ",", "desc", "=", "None", ")", ":", "desc", "=", "desc", "or", "org_name", "res", "=", "self", ".", "_create_o...
Create partition on the DCNM. :param org_name: name of organization to be created :param part_name: name of partition to be created :param dci_id: DCI ID :vrf_prof: VRF profile for the partition :param service_node_ip: Specifies the Default route IP address. :param desc:...
[ "Create", "partition", "on", "the", "DCNM", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/cisco_dfa_rest.py#L763-L784
train
openstack/networking-cisco
networking_cisco/apps/saf/server/cisco_dfa_rest.py
DFARESTClient.get_partition_vrfProf
def get_partition_vrfProf(self, org_name, part_name=None, part_info=None): """get VRF Profile for the partition from the DCNM. :param org_name: name of organization :param part_name: name of partition """ vrf_profile = None if part_info is None: part_info = s...
python
def get_partition_vrfProf(self, org_name, part_name=None, part_info=None): """get VRF Profile for the partition from the DCNM. :param org_name: name of organization :param part_name: name of partition """ vrf_profile = None if part_info is None: part_info = s...
[ "def", "get_partition_vrfProf", "(", "self", ",", "org_name", ",", "part_name", "=", "None", ",", "part_info", "=", "None", ")", ":", "vrf_profile", "=", "None", "if", "part_info", "is", "None", ":", "part_info", "=", "self", ".", "_get_partition", "(", "o...
get VRF Profile for the partition from the DCNM. :param org_name: name of organization :param part_name: name of partition
[ "get", "VRF", "Profile", "for", "the", "partition", "from", "the", "DCNM", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/cisco_dfa_rest.py#L786-L799
train
openstack/networking-cisco
networking_cisco/apps/saf/server/cisco_dfa_rest.py
DFARESTClient.get_partition_dciId
def get_partition_dciId(self, org_name, part_name, part_info=None): """get DCI ID for the partition. :param org_name: name of organization :param part_name: name of partition """ if part_info is None: part_info = self._get_partition(org_name, part_name) L...
python
def get_partition_dciId(self, org_name, part_name, part_info=None): """get DCI ID for the partition. :param org_name: name of organization :param part_name: name of partition """ if part_info is None: part_info = self._get_partition(org_name, part_name) L...
[ "def", "get_partition_dciId", "(", "self", ",", "org_name", ",", "part_name", ",", "part_info", "=", "None", ")", ":", "if", "part_info", "is", "None", ":", "part_info", "=", "self", ".", "_get_partition", "(", "org_name", ",", "part_name", ")", "LOG", "."...
get DCI ID for the partition. :param org_name: name of organization :param part_name: name of partition
[ "get", "DCI", "ID", "for", "the", "partition", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/cisco_dfa_rest.py#L801-L812
train
openstack/networking-cisco
networking_cisco/apps/saf/server/cisco_dfa_rest.py
DFARESTClient.list_networks
def list_networks(self, org, part): """Return list of networks from DCNM. :param org: name of organization. :param part: name of partition. """ if org and part: list_url = self._del_part + '/networks' list_url = list_url % (org, part) res = se...
python
def list_networks(self, org, part): """Return list of networks from DCNM. :param org: name of organization. :param part: name of partition. """ if org and part: list_url = self._del_part + '/networks' list_url = list_url % (org, part) res = se...
[ "def", "list_networks", "(", "self", ",", "org", ",", "part", ")", ":", "if", "org", "and", "part", ":", "list_url", "=", "self", ".", "_del_part", "+", "'/networks'", "list_url", "=", "list_url", "%", "(", "org", ",", "part", ")", "res", "=", "self"...
Return list of networks from DCNM. :param org: name of organization. :param part: name of partition.
[ "Return", "list", "of", "networks", "from", "DCNM", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/cisco_dfa_rest.py#L840-L851
train
openstack/networking-cisco
networking_cisco/apps/saf/server/cisco_dfa_rest.py
DFARESTClient.list_organizations
def list_organizations(self): """Return list of organizations from DCNM.""" try: res = self._send_request('GET', self._org_url, '', 'organizations') if res and res.status_code in self._resp_ok: return res.json() except dexc.DfaClientRequestFailed: ...
python
def list_organizations(self): """Return list of organizations from DCNM.""" try: res = self._send_request('GET', self._org_url, '', 'organizations') if res and res.status_code in self._resp_ok: return res.json() except dexc.DfaClientRequestFailed: ...
[ "def", "list_organizations", "(", "self", ")", ":", "try", ":", "res", "=", "self", ".", "_send_request", "(", "'GET'", ",", "self", ".", "_org_url", ",", "''", ",", "'organizations'", ")", "if", "res", "and", "res", ".", "status_code", "in", "self", "...
Return list of organizations from DCNM.
[ "Return", "list", "of", "organizations", "from", "DCNM", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/cisco_dfa_rest.py#L853-L861
train
openstack/networking-cisco
networking_cisco/apps/saf/server/cisco_dfa_rest.py
DFARESTClient.get_network
def get_network(self, org, segid): """Return given network from DCNM. :param org: name of organization. :param segid: segmentation id of the network. """ network_info = { 'organizationName': org, 'partitionName': self._part_name, 'segmentId': ...
python
def get_network(self, org, segid): """Return given network from DCNM. :param org: name of organization. :param segid: segmentation id of the network. """ network_info = { 'organizationName': org, 'partitionName': self._part_name, 'segmentId': ...
[ "def", "get_network", "(", "self", ",", "org", ",", "segid", ")", ":", "network_info", "=", "{", "'organizationName'", ":", "org", ",", "'partitionName'", ":", "self", ".", "_part_name", ",", "'segmentId'", ":", "segid", ",", "}", "res", "=", "self", "."...
Return given network from DCNM. :param org: name of organization. :param segid: segmentation id of the network.
[ "Return", "given", "network", "from", "DCNM", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/cisco_dfa_rest.py#L863-L876
train
openstack/networking-cisco
networking_cisco/apps/saf/server/cisco_dfa_rest.py
DFARESTClient.get_version
def get_version(self): """Get the DCNM version.""" url = '%s://%s/rest/dcnm-version' % (self.dcnm_protocol, self._ip) payload = {} try: res = self._send_request('GET', url, payload, 'dcnm-version') if res and res.status_code in self._resp_ok: ret...
python
def get_version(self): """Get the DCNM version.""" url = '%s://%s/rest/dcnm-version' % (self.dcnm_protocol, self._ip) payload = {} try: res = self._send_request('GET', url, payload, 'dcnm-version') if res and res.status_code in self._resp_ok: ret...
[ "def", "get_version", "(", "self", ")", ":", "url", "=", "'%s://%s/rest/dcnm-version'", "%", "(", "self", ".", "dcnm_protocol", ",", "self", ".", "_ip", ")", "payload", "=", "{", "}", "try", ":", "res", "=", "self", ".", "_send_request", "(", "'GET'", ...
Get the DCNM version.
[ "Get", "the", "DCNM", "version", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/cisco_dfa_rest.py#L878-L890
train
openstack/networking-cisco
networking_cisco/apps/saf/server/cisco_dfa_rest.py
DFARESTClient.fill_urls
def fill_urls(self): """This assigns the URL's based on the protocol. """ protocol = self.dcnm_protocol self._org_url = '%s://%s/rest/auto-config/organizations' % ( (protocol, self._ip)) self._create_network_url = ('%s://%s/' % (protocol, self._ip) + ...
python
def fill_urls(self): """This assigns the URL's based on the protocol. """ protocol = self.dcnm_protocol self._org_url = '%s://%s/rest/auto-config/organizations' % ( (protocol, self._ip)) self._create_network_url = ('%s://%s/' % (protocol, self._ip) + ...
[ "def", "fill_urls", "(", "self", ")", ":", "protocol", "=", "self", ".", "dcnm_protocol", "self", ".", "_org_url", "=", "'%s://%s/rest/auto-config/organizations'", "%", "(", "(", "protocol", ",", "self", ".", "_ip", ")", ")", "self", ".", "_create_network_url"...
This assigns the URL's based on the protocol.
[ "This", "assigns", "the", "URL", "s", "based", "on", "the", "protocol", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/cisco_dfa_rest.py#L923-L958
train
openstack/networking-cisco
networking_cisco/db/migration/alembic_migrations/versions/mitaka/expand/9148d96f9b39_rename_tenantid_to_projectid.py
contract_creation_exceptions
def contract_creation_exceptions(): """Special migration for the blueprint to support Keystone V3. We drop all tenant_id columns and create project_id columns instead. """ return { sa.Column: ['.'.join([table, 'project_id']) for table in get_tables()], sa.Index: get_tables() }
python
def contract_creation_exceptions(): """Special migration for the blueprint to support Keystone V3. We drop all tenant_id columns and create project_id columns instead. """ return { sa.Column: ['.'.join([table, 'project_id']) for table in get_tables()], sa.Index: get_tables() }
[ "def", "contract_creation_exceptions", "(", ")", ":", "return", "{", "sa", ".", "Column", ":", "[", "'.'", ".", "join", "(", "[", "table", ",", "'project_id'", "]", ")", "for", "table", "in", "get_tables", "(", ")", "]", ",", "sa", ".", "Index", ":",...
Special migration for the blueprint to support Keystone V3. We drop all tenant_id columns and create project_id columns instead.
[ "Special", "migration", "for", "the", "blueprint", "to", "support", "Keystone", "V3", ".", "We", "drop", "all", "tenant_id", "columns", "and", "create", "project_id", "columns", "instead", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/db/migration/alembic_migrations/versions/mitaka/expand/9148d96f9b39_rename_tenantid_to_projectid.py#L133-L140
train
openstack/networking-cisco
networking_cisco/plugins/cisco/l3/rpc/l3_router_rpc_cfg_agent_api.py
L3RouterCfgAgentNotifyAPI._agent_notification_bulk
def _agent_notification_bulk(self, context, method, routers, hosting_device, operation): """Notify the Cisco cfg agent handling a particular hosting_device. A single notification can contain multiple routers. """ admin_context = context.is_admin and cont...
python
def _agent_notification_bulk(self, context, method, routers, hosting_device, operation): """Notify the Cisco cfg agent handling a particular hosting_device. A single notification can contain multiple routers. """ admin_context = context.is_admin and cont...
[ "def", "_agent_notification_bulk", "(", "self", ",", "context", ",", "method", ",", "routers", ",", "hosting_device", ",", "operation", ")", ":", "admin_context", "=", "context", ".", "is_admin", "and", "context", "or", "context", ".", "elevated", "(", ")", ...
Notify the Cisco cfg agent handling a particular hosting_device. A single notification can contain multiple routers.
[ "Notify", "the", "Cisco", "cfg", "agent", "handling", "a", "particular", "hosting_device", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/l3/rpc/l3_router_rpc_cfg_agent_api.py#L43-L66
train
openstack/networking-cisco
networking_cisco/plugins/cisco/l3/rpc/l3_router_rpc_cfg_agent_api.py
L3RouterCfgAgentNotifyAPI._notification
def _notification(self, context, method, routers, operation, shuffle_agents): """Notify all or individual Cisco cfg agents.""" if extensions.is_extension_supported(self._l3plugin, L3AGENT_SCHED): adm_context = (context.is_admin and context or context.elevated()) ...
python
def _notification(self, context, method, routers, operation, shuffle_agents): """Notify all or individual Cisco cfg agents.""" if extensions.is_extension_supported(self._l3plugin, L3AGENT_SCHED): adm_context = (context.is_admin and context or context.elevated()) ...
[ "def", "_notification", "(", "self", ",", "context", ",", "method", ",", "routers", ",", "operation", ",", "shuffle_agents", ")", ":", "if", "extensions", ".", "is_extension_supported", "(", "self", ".", "_l3plugin", ",", "L3AGENT_SCHED", ")", ":", "adm_contex...
Notify all or individual Cisco cfg agents.
[ "Notify", "all", "or", "individual", "Cisco", "cfg", "agents", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/l3/rpc/l3_router_rpc_cfg_agent_api.py#L92-L103
train
openstack/networking-cisco
networking_cisco/plugins/cisco/l3/rpc/l3_router_rpc_cfg_agent_api.py
L3RouterCfgAgentNotifyAPI.routers_updated
def routers_updated(self, context, routers, operation=None, data=None, shuffle_agents=False): """Notify cfg agents about configuration changes to routers. This includes operations performed on the router like when a router interface is added or removed. """ ...
python
def routers_updated(self, context, routers, operation=None, data=None, shuffle_agents=False): """Notify cfg agents about configuration changes to routers. This includes operations performed on the router like when a router interface is added or removed. """ ...
[ "def", "routers_updated", "(", "self", ",", "context", ",", "routers", ",", "operation", "=", "None", ",", "data", "=", "None", ",", "shuffle_agents", "=", "False", ")", ":", "if", "routers", ":", "self", ".", "_notification", "(", "context", ",", "'rout...
Notify cfg agents about configuration changes to routers. This includes operations performed on the router like when a router interface is added or removed.
[ "Notify", "cfg", "agents", "about", "configuration", "changes", "to", "routers", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/l3/rpc/l3_router_rpc_cfg_agent_api.py#L110-L119
train
openstack/networking-cisco
networking_cisco/plugins/cisco/l3/rpc/l3_router_rpc_cfg_agent_api.py
L3RouterCfgAgentNotifyAPI.router_removed_from_hosting_device
def router_removed_from_hosting_device(self, context, router): """Notify cfg agent about router removed from hosting device.""" self._notification(context, 'router_removed_from_hosting_device', [router], operation=None, shuffle_agents=False)
python
def router_removed_from_hosting_device(self, context, router): """Notify cfg agent about router removed from hosting device.""" self._notification(context, 'router_removed_from_hosting_device', [router], operation=None, shuffle_agents=False)
[ "def", "router_removed_from_hosting_device", "(", "self", ",", "context", ",", "router", ")", ":", "self", ".", "_notification", "(", "context", ",", "'router_removed_from_hosting_device'", ",", "[", "router", "]", ",", "operation", "=", "None", ",", "shuffle_agen...
Notify cfg agent about router removed from hosting device.
[ "Notify", "cfg", "agent", "about", "router", "removed", "from", "hosting", "device", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/l3/rpc/l3_router_rpc_cfg_agent_api.py#L121-L124
train
openstack/networking-cisco
networking_cisco/plugins/cisco/l3/rpc/l3_router_rpc_cfg_agent_api.py
L3RouterCfgAgentNotifyAPI.router_added_to_hosting_device
def router_added_to_hosting_device(self, context, router): """Notify cfg agent about router added to hosting device.""" self._notification(context, 'router_added_to_hosting_device', [router], operation=None, shuffle_agents=False)
python
def router_added_to_hosting_device(self, context, router): """Notify cfg agent about router added to hosting device.""" self._notification(context, 'router_added_to_hosting_device', [router], operation=None, shuffle_agents=False)
[ "def", "router_added_to_hosting_device", "(", "self", ",", "context", ",", "router", ")", ":", "self", ".", "_notification", "(", "context", ",", "'router_added_to_hosting_device'", ",", "[", "router", "]", ",", "operation", "=", "None", ",", "shuffle_agents", "...
Notify cfg agent about router added to hosting device.
[ "Notify", "cfg", "agent", "about", "router", "added", "to", "hosting", "device", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/l3/rpc/l3_router_rpc_cfg_agent_api.py#L126-L129
train
openstack/networking-cisco
networking_cisco/plugins/cisco/l3/rpc/l3_router_rpc_cfg_agent_api.py
L3RouterCfgAgentNotifyAPI.routers_removed_from_hosting_device
def routers_removed_from_hosting_device(self, context, router_ids, hosting_device): """Notify cfg agent that routers have been removed from hosting device. @param: context - information about tenant, user etc @param: router-ids - list of ids @p...
python
def routers_removed_from_hosting_device(self, context, router_ids, hosting_device): """Notify cfg agent that routers have been removed from hosting device. @param: context - information about tenant, user etc @param: router-ids - list of ids @p...
[ "def", "routers_removed_from_hosting_device", "(", "self", ",", "context", ",", "router_ids", ",", "hosting_device", ")", ":", "self", ".", "_agent_notification_bulk", "(", "context", ",", "'router_removed_from_hosting_device'", ",", "router_ids", ",", "hosting_device", ...
Notify cfg agent that routers have been removed from hosting device. @param: context - information about tenant, user etc @param: router-ids - list of ids @param: hosting_device - device hosting the routers
[ "Notify", "cfg", "agent", "that", "routers", "have", "been", "removed", "from", "hosting", "device", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/l3/rpc/l3_router_rpc_cfg_agent_api.py#L131-L140
train
openstack/networking-cisco
networking_cisco/apps/saf/server/dfa_listen_dcnm.py
DCNMListener.process_amqp_msgs
def process_amqp_msgs(self): """Process AMQP queue messages. It connects to AMQP server and calls callbacks to process DCNM events, i.e. routing key containing '.cisco.dcnm.', once they arrive in the queue. """ LOG.info('Starting process_amqp_msgs...') while Tru...
python
def process_amqp_msgs(self): """Process AMQP queue messages. It connects to AMQP server and calls callbacks to process DCNM events, i.e. routing key containing '.cisco.dcnm.', once they arrive in the queue. """ LOG.info('Starting process_amqp_msgs...') while Tru...
[ "def", "process_amqp_msgs", "(", "self", ")", ":", "LOG", ".", "info", "(", "'Starting process_amqp_msgs...'", ")", "while", "True", ":", "(", "mtd_fr", ",", "hdr_fr", ",", "body", ")", "=", "(", "None", ",", "None", ",", "None", ")", "try", ":", "if",...
Process AMQP queue messages. It connects to AMQP server and calls callbacks to process DCNM events, i.e. routing key containing '.cisco.dcnm.', once they arrive in the queue.
[ "Process", "AMQP", "queue", "messages", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/dfa_listen_dcnm.py#L149-L184
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/device_status.py
_is_pingable
def _is_pingable(ip): """Checks whether an IP address is reachable by pinging. Use linux utils to execute the ping (ICMP ECHO) command. Sends 5 packets with an interval of 0.2 seconds and timeout of 1 seconds. Runtime error implies unreachability else IP is pingable. :param ip: IP to check :ret...
python
def _is_pingable(ip): """Checks whether an IP address is reachable by pinging. Use linux utils to execute the ping (ICMP ECHO) command. Sends 5 packets with an interval of 0.2 seconds and timeout of 1 seconds. Runtime error implies unreachability else IP is pingable. :param ip: IP to check :ret...
[ "def", "_is_pingable", "(", "ip", ")", ":", "ping_cmd", "=", "[", "'ping'", ",", "'-c'", ",", "'5'", ",", "'-W'", ",", "'1'", ",", "'-i'", ",", "'0.2'", ",", "ip", "]", "try", ":", "linux_utils", ".", "execute", "(", "ping_cmd", ",", "check_exit_code...
Checks whether an IP address is reachable by pinging. Use linux utils to execute the ping (ICMP ECHO) command. Sends 5 packets with an interval of 0.2 seconds and timeout of 1 seconds. Runtime error implies unreachability else IP is pingable. :param ip: IP to check :return: bool - True or False dep...
[ "Checks", "whether", "an", "IP", "address", "is", "reachable", "by", "pinging", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_status.py#L46-L65
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/device_status.py
_can_connect
def _can_connect(ip, port): """Checks if a TCP port at IP address is possible to connect to""" cs = socket.socket() try: cs.connect((ip, port)) cs.close() return True except socket.error: return False
python
def _can_connect(ip, port): """Checks if a TCP port at IP address is possible to connect to""" cs = socket.socket() try: cs.connect((ip, port)) cs.close() return True except socket.error: return False
[ "def", "_can_connect", "(", "ip", ",", "port", ")", ":", "cs", "=", "socket", ".", "socket", "(", ")", "try", ":", "cs", ".", "connect", "(", "(", "ip", ",", "port", ")", ")", "cs", ".", "close", "(", ")", "return", "True", "except", "socket", ...
Checks if a TCP port at IP address is possible to connect to
[ "Checks", "if", "a", "TCP", "port", "at", "IP", "address", "is", "possible", "to", "connect", "to" ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_status.py#L68-L76
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/device_status.py
DeviceStatus.get_monitored_hosting_devices_info
def get_monitored_hosting_devices_info(self, hd_state_filter=None): """ This function returns a list of all hosting devices monitored by this agent """ wait_time = datetime.timedelta( seconds=cfg.CONF.cfg_agent.hosting_device_dead_timeout) resp = [] fo...
python
def get_monitored_hosting_devices_info(self, hd_state_filter=None): """ This function returns a list of all hosting devices monitored by this agent """ wait_time = datetime.timedelta( seconds=cfg.CONF.cfg_agent.hosting_device_dead_timeout) resp = [] fo...
[ "def", "get_monitored_hosting_devices_info", "(", "self", ",", "hd_state_filter", "=", "None", ")", ":", "wait_time", "=", "datetime", ".", "timedelta", "(", "seconds", "=", "cfg", ".", "CONF", ".", "cfg_agent", ".", "hosting_device_dead_timeout", ")", "resp", "...
This function returns a list of all hosting devices monitored by this agent
[ "This", "function", "returns", "a", "list", "of", "all", "hosting", "devices", "monitored", "by", "this", "agent" ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_status.py#L134-L167
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/device_status.py
DeviceStatus.is_hosting_device_reachable
def is_hosting_device_reachable(self, hosting_device): """Check the hosting device which hosts this resource is reachable. If the resource is not reachable, it is added to the backlog. * heartbeat revision We want to enqueue all hosting-devices into the backlog for monitoring ...
python
def is_hosting_device_reachable(self, hosting_device): """Check the hosting device which hosts this resource is reachable. If the resource is not reachable, it is added to the backlog. * heartbeat revision We want to enqueue all hosting-devices into the backlog for monitoring ...
[ "def", "is_hosting_device_reachable", "(", "self", ",", "hosting_device", ")", ":", "ret_val", "=", "False", "hd", "=", "hosting_device", "hd_id", "=", "hosting_device", "[", "'id'", "]", "hd_mgmt_ip", "=", "hosting_device", "[", "'management_ip_address'", "]", "d...
Check the hosting device which hosts this resource is reachable. If the resource is not reachable, it is added to the backlog. * heartbeat revision We want to enqueue all hosting-devices into the backlog for monitoring purposes adds key/value pairs to hd (aka hosting_device ...
[ "Check", "the", "hosting", "device", "which", "hosts", "this", "resource", "is", "reachable", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_status.py#L169-L221
train
openstack/networking-cisco
networking_cisco/plugins/cisco/service_plugins/cisco_router_plugin.py
CiscoRouterPlugin.create_floatingip
def create_floatingip(self, context, floatingip): """Create floating IP. :param context: Neutron request context :param floatingip: data for the floating IP being created :returns: A floating IP object on success As the l3 router plugin asynchronously creates floating IPs ...
python
def create_floatingip(self, context, floatingip): """Create floating IP. :param context: Neutron request context :param floatingip: data for the floating IP being created :returns: A floating IP object on success As the l3 router plugin asynchronously creates floating IPs ...
[ "def", "create_floatingip", "(", "self", ",", "context", ",", "floatingip", ")", ":", "return", "super", "(", "CiscoRouterPlugin", ",", "self", ")", ".", "create_floatingip", "(", "context", ",", "floatingip", ",", "initial_status", "=", "bc", ".", "constants"...
Create floating IP. :param context: Neutron request context :param floatingip: data for the floating IP being created :returns: A floating IP object on success As the l3 router plugin asynchronously creates floating IPs leveraging the l3 agent and l3 cfg agent, the initial stat...
[ "Create", "floating", "IP", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/service_plugins/cisco_router_plugin.py#L109-L122
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/drivers/native.py
NativeFirewall.attach_intf_router
def attach_intf_router(self, tenant_id, tenant_name, router_id): """Routine to attach the interface to the router. """ in_sub = self.get_in_subnet_id(tenant_id) out_sub = self.get_out_subnet_id(tenant_id) # Modify Hard coded Name fixme subnet_lst = set() subnet_lst.add(in...
python
def attach_intf_router(self, tenant_id, tenant_name, router_id): """Routine to attach the interface to the router. """ in_sub = self.get_in_subnet_id(tenant_id) out_sub = self.get_out_subnet_id(tenant_id) # Modify Hard coded Name fixme subnet_lst = set() subnet_lst.add(in...
[ "def", "attach_intf_router", "(", "self", ",", "tenant_id", ",", "tenant_name", ",", "router_id", ")", ":", "in_sub", "=", "self", ".", "get_in_subnet_id", "(", "tenant_id", ")", "out_sub", "=", "self", ".", "get_out_subnet_id", "(", "tenant_id", ")", "subnet_...
Routine to attach the interface to the router.
[ "Routine", "to", "attach", "the", "interface", "to", "the", "router", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/drivers/native.py#L82-L91
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/drivers/native.py
NativeFirewall.get_router_id
def get_router_id(self, tenant_id, tenant_name): """Retrieve the router ID. """ router_id = None if tenant_id in self.tenant_dict: router_id = self.tenant_dict.get(tenant_id).get('router_id') if not router_id: router_list = self.os_helper.get_rtr_by_name( ...
python
def get_router_id(self, tenant_id, tenant_name): """Retrieve the router ID. """ router_id = None if tenant_id in self.tenant_dict: router_id = self.tenant_dict.get(tenant_id).get('router_id') if not router_id: router_list = self.os_helper.get_rtr_by_name( ...
[ "def", "get_router_id", "(", "self", ",", "tenant_id", ",", "tenant_name", ")", ":", "router_id", "=", "None", "if", "tenant_id", "in", "self", ".", "tenant_dict", ":", "router_id", "=", "self", ".", "tenant_dict", ".", "get", "(", "tenant_id", ")", ".", ...
Retrieve the router ID.
[ "Retrieve", "the", "router", "ID", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/drivers/native.py#L93-L103
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/drivers/native.py
NativeFirewall.delete_intf_router
def delete_intf_router(self, tenant_id, tenant_name, router_id): """Routine to delete the router. """ in_sub = self.get_in_subnet_id(tenant_id) out_sub = self.get_out_subnet_id(tenant_id) subnet_lst = set() subnet_lst.add(in_sub) subnet_lst.add(out_sub) router_id ...
python
def delete_intf_router(self, tenant_id, tenant_name, router_id): """Routine to delete the router. """ in_sub = self.get_in_subnet_id(tenant_id) out_sub = self.get_out_subnet_id(tenant_id) subnet_lst = set() subnet_lst.add(in_sub) subnet_lst.add(out_sub) router_id ...
[ "def", "delete_intf_router", "(", "self", ",", "tenant_id", ",", "tenant_name", ",", "router_id", ")", ":", "in_sub", "=", "self", ".", "get_in_subnet_id", "(", "tenant_id", ")", "out_sub", "=", "self", ".", "get_out_subnet_id", "(", "tenant_id", ")", "subnet_...
Routine to delete the router.
[ "Routine", "to", "delete", "the", "router", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/drivers/native.py#L105-L122
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/drivers/native.py
NativeFirewall.prepare_router_vm_msg
def prepare_router_vm_msg(self, tenant_id, tenant_name, router_id, net_id, subnet_id, seg, status): """Prepare the message to be sent to Event queue for VDP trigger. This is actually called for a subnet add to a router. This function prepares a VM's VNIC create/del...
python
def prepare_router_vm_msg(self, tenant_id, tenant_name, router_id, net_id, subnet_id, seg, status): """Prepare the message to be sent to Event queue for VDP trigger. This is actually called for a subnet add to a router. This function prepares a VM's VNIC create/del...
[ "def", "prepare_router_vm_msg", "(", "self", ",", "tenant_id", ",", "tenant_name", ",", "router_id", ",", "net_id", ",", "subnet_id", ",", "seg", ",", "status", ")", ":", "max_get_router_info_retry", "=", "True", "attempt", "=", "0", "while", "max_get_router_inf...
Prepare the message to be sent to Event queue for VDP trigger. This is actually called for a subnet add to a router. This function prepares a VM's VNIC create/delete message.
[ "Prepare", "the", "message", "to", "be", "sent", "to", "Event", "queue", "for", "VDP", "trigger", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/drivers/native.py#L124-L173
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/drivers/native.py
NativeFirewall.send_router_port_msg
def send_router_port_msg(self, tenant_id, tenant_name, router_id, net_id, subnet_id, seg, status): """Sends the router port message to the queue. """ data = self.prepare_router_vm_msg(tenant_id, tenant_name, router_id, net_id, subnet...
python
def send_router_port_msg(self, tenant_id, tenant_name, router_id, net_id, subnet_id, seg, status): """Sends the router port message to the queue. """ data = self.prepare_router_vm_msg(tenant_id, tenant_name, router_id, net_id, subnet...
[ "def", "send_router_port_msg", "(", "self", ",", "tenant_id", ",", "tenant_name", ",", "router_id", ",", "net_id", ",", "subnet_id", ",", "seg", ",", "status", ")", ":", "data", "=", "self", ".", "prepare_router_vm_msg", "(", "tenant_id", ",", "tenant_name", ...
Sends the router port message to the queue.
[ "Sends", "the", "router", "port", "message", "to", "the", "queue", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/drivers/native.py#L175-L187
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/drivers/native.py
NativeFirewall.update_dcnm_partition_static_route
def update_dcnm_partition_static_route(self, tenant_id, arg_dict): """Add static route in DCNM's partition. This gets pushed to the relevant leaf switches. """ ip_list = self.os_helper.get_subnet_nwk_excl(tenant_id, arg_dict.get('excl...
python
def update_dcnm_partition_static_route(self, tenant_id, arg_dict): """Add static route in DCNM's partition. This gets pushed to the relevant leaf switches. """ ip_list = self.os_helper.get_subnet_nwk_excl(tenant_id, arg_dict.get('excl...
[ "def", "update_dcnm_partition_static_route", "(", "self", ",", "tenant_id", ",", "arg_dict", ")", ":", "ip_list", "=", "self", ".", "os_helper", ".", "get_subnet_nwk_excl", "(", "tenant_id", ",", "arg_dict", ".", "get", "(", "'excl_list'", ")", ")", "srvc_node_i...
Add static route in DCNM's partition. This gets pushed to the relevant leaf switches.
[ "Add", "static", "route", "in", "DCNM", "s", "partition", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/drivers/native.py#L275-L293
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/drivers/native.py
NativeFirewall._create_arg_dict
def _create_arg_dict(self, tenant_id, data, in_sub, out_sub): """Create the argument dictionary. """ in_seg, in_vlan = self.get_in_seg_vlan(tenant_id) out_seg, out_vlan = self.get_out_seg_vlan(tenant_id) in_ip_dict = self.get_in_ip_addr(tenant_id) out_ip_dict = self.get_out_ip_ad...
python
def _create_arg_dict(self, tenant_id, data, in_sub, out_sub): """Create the argument dictionary. """ in_seg, in_vlan = self.get_in_seg_vlan(tenant_id) out_seg, out_vlan = self.get_out_seg_vlan(tenant_id) in_ip_dict = self.get_in_ip_addr(tenant_id) out_ip_dict = self.get_out_ip_ad...
[ "def", "_create_arg_dict", "(", "self", ",", "tenant_id", ",", "data", ",", "in_sub", ",", "out_sub", ")", ":", "in_seg", ",", "in_vlan", "=", "self", ".", "get_in_seg_vlan", "(", "tenant_id", ")", "out_seg", ",", "out_vlan", "=", "self", ".", "get_out_seg...
Create the argument dictionary.
[ "Create", "the", "argument", "dictionary", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/drivers/native.py#L295-L312
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/drivers/native.py
NativeFirewall._create_fw
def _create_fw(self, tenant_id, data): """Internal routine that gets called when a FW is created. """ LOG.debug("In creating Native FW data is %s", data) # TODO(padkrish): # Check if router is already added and only then add, needed for # restart cases since native doesn't have a...
python
def _create_fw(self, tenant_id, data): """Internal routine that gets called when a FW is created. """ LOG.debug("In creating Native FW data is %s", data) # TODO(padkrish): # Check if router is already added and only then add, needed for # restart cases since native doesn't have a...
[ "def", "_create_fw", "(", "self", ",", "tenant_id", ",", "data", ")", ":", "LOG", ".", "debug", "(", "\"In creating Native FW data is %s\"", ",", "data", ")", "ret", ",", "in_sub", ",", "out_sub", "=", "self", ".", "attach_intf_router", "(", "tenant_id", ","...
Internal routine that gets called when a FW is created.
[ "Internal", "routine", "that", "gets", "called", "when", "a", "FW", "is", "created", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/drivers/native.py#L314-L352
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/drivers/native.py
NativeFirewall.create_fw
def create_fw(self, tenant_id, data): """Top level routine called when a FW is created. """ try: return self._create_fw(tenant_id, data) except Exception as exc: LOG.error("Failed to create FW for device native, tenant " "%(tenant)s data %(data)s Exc...
python
def create_fw(self, tenant_id, data): """Top level routine called when a FW is created. """ try: return self._create_fw(tenant_id, data) except Exception as exc: LOG.error("Failed to create FW for device native, tenant " "%(tenant)s data %(data)s Exc...
[ "def", "create_fw", "(", "self", ",", "tenant_id", ",", "data", ")", ":", "try", ":", "return", "self", ".", "_create_fw", "(", "tenant_id", ",", "data", ")", "except", "Exception", "as", "exc", ":", "LOG", ".", "error", "(", "\"Failed to create FW for dev...
Top level routine called when a FW is created.
[ "Top", "level", "routine", "called", "when", "a", "FW", "is", "created", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/drivers/native.py#L354-L362
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/drivers/native.py
NativeFirewall._delete_fw
def _delete_fw(self, tenant_id, data): """Internal routine called when a FW is deleted. """ LOG.debug("In Delete fw data is %s", data) in_sub = self.get_in_subnet_id(tenant_id) out_sub = self.get_out_subnet_id(tenant_id) arg_dict = self._create_arg_dict(tenant_id, data, in_sub, o...
python
def _delete_fw(self, tenant_id, data): """Internal routine called when a FW is deleted. """ LOG.debug("In Delete fw data is %s", data) in_sub = self.get_in_subnet_id(tenant_id) out_sub = self.get_out_subnet_id(tenant_id) arg_dict = self._create_arg_dict(tenant_id, data, in_sub, o...
[ "def", "_delete_fw", "(", "self", ",", "tenant_id", ",", "data", ")", ":", "LOG", ".", "debug", "(", "\"In Delete fw data is %s\"", ",", "data", ")", "in_sub", "=", "self", ".", "get_in_subnet_id", "(", "tenant_id", ")", "out_sub", "=", "self", ".", "get_o...
Internal routine called when a FW is deleted.
[ "Internal", "routine", "called", "when", "a", "FW", "is", "deleted", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/drivers/native.py#L364-L393
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/drivers/native.py
NativeFirewall.delete_fw
def delete_fw(self, tenant_id, data): """Top level routine called when a FW is deleted. """ try: ret = self._delete_fw(tenant_id, data) return ret except Exception as exc: LOG.error("Failed to delete FW for device native, tenant " "%(tena...
python
def delete_fw(self, tenant_id, data): """Top level routine called when a FW is deleted. """ try: ret = self._delete_fw(tenant_id, data) return ret except Exception as exc: LOG.error("Failed to delete FW for device native, tenant " "%(tena...
[ "def", "delete_fw", "(", "self", ",", "tenant_id", ",", "data", ")", ":", "try", ":", "ret", "=", "self", ".", "_delete_fw", "(", "tenant_id", ",", "data", ")", "return", "ret", "except", "Exception", "as", "exc", ":", "LOG", ".", "error", "(", "\"Fa...
Top level routine called when a FW is deleted.
[ "Top", "level", "routine", "called", "when", "a", "FW", "is", "deleted", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/drivers/native.py#L395-L404
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/drivers/native.py
NativeFirewall._program_dcnm_static_route
def _program_dcnm_static_route(self, tenant_id, tenant_name): """Program DCNM Static Route. """ in_ip_dict = self.get_in_ip_addr(tenant_id) in_gw = in_ip_dict.get('gateway') in_ip = in_ip_dict.get('subnet') if in_gw is None: LOG.error("No FW service GW present") ...
python
def _program_dcnm_static_route(self, tenant_id, tenant_name): """Program DCNM Static Route. """ in_ip_dict = self.get_in_ip_addr(tenant_id) in_gw = in_ip_dict.get('gateway') in_ip = in_ip_dict.get('subnet') if in_gw is None: LOG.error("No FW service GW present") ...
[ "def", "_program_dcnm_static_route", "(", "self", ",", "tenant_id", ",", "tenant_name", ")", ":", "in_ip_dict", "=", "self", ".", "get_in_ip_addr", "(", "tenant_id", ")", "in_gw", "=", "in_ip_dict", ".", "get", "(", "'gateway'", ")", "in_ip", "=", "in_ip_dict"...
Program DCNM Static Route.
[ "Program", "DCNM", "Static", "Route", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/drivers/native.py#L414-L443
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/drivers/native.py
NativeFirewall.network_create_notif
def network_create_notif(self, tenant_id, tenant_name, cidr): """Tenant Network create Notification. Restart is not supported currently for this. fixme(padkrish). """ router_id = self.get_router_id(tenant_id, tenant_name) if not router_id: LOG.error("Rout ID not pres...
python
def network_create_notif(self, tenant_id, tenant_name, cidr): """Tenant Network create Notification. Restart is not supported currently for this. fixme(padkrish). """ router_id = self.get_router_id(tenant_id, tenant_name) if not router_id: LOG.error("Rout ID not pres...
[ "def", "network_create_notif", "(", "self", ",", "tenant_id", ",", "tenant_name", ",", "cidr", ")", ":", "router_id", "=", "self", ".", "get_router_id", "(", "tenant_id", ",", "tenant_name", ")", "if", "not", "router_id", ":", "LOG", ".", "error", "(", "\"...
Tenant Network create Notification. Restart is not supported currently for this. fixme(padkrish).
[ "Tenant", "Network", "create", "Notification", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/drivers/native.py#L445-L472
train
openstack/networking-cisco
networking_cisco/apps/saf/server/services/firewall/native/drivers/native.py
NativeFirewall.network_delete_notif
def network_delete_notif(self, tenant_id, tenant_name, network_id): """Tenant Network delete Notification. Restart is not supported currently for this. fixme(padkrish). """ router_id = self.get_router_id(tenant_id, tenant_name) if router_id is None: LOG.error("Rout I...
python
def network_delete_notif(self, tenant_id, tenant_name, network_id): """Tenant Network delete Notification. Restart is not supported currently for this. fixme(padkrish). """ router_id = self.get_router_id(tenant_id, tenant_name) if router_id is None: LOG.error("Rout I...
[ "def", "network_delete_notif", "(", "self", ",", "tenant_id", ",", "tenant_name", ",", "network_id", ")", ":", "router_id", "=", "self", ".", "get_router_id", "(", "tenant_id", ",", "tenant_name", ")", "if", "router_id", "is", "None", ":", "LOG", ".", "error...
Tenant Network delete Notification. Restart is not supported currently for this. fixme(padkrish).
[ "Tenant", "Network", "delete", "Notification", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/services/firewall/native/drivers/native.py#L474-L510
train
openstack/networking-cisco
networking_cisco/plugins/cisco/device_manager/plugging_drivers/vif_hotplug_plugging_driver.py
VIFHotPlugPluggingDriver.create_hosting_device_resources
def create_hosting_device_resources(self, context, complementary_id, tenant_id, mgmt_context, max_hosted): """Create resources for a hosting device in a plugin specific way.""" mgmt_port = None if mgmt_context and mgmt_context.get('mgmt_nw_id') and tenant_...
python
def create_hosting_device_resources(self, context, complementary_id, tenant_id, mgmt_context, max_hosted): """Create resources for a hosting device in a plugin specific way.""" mgmt_port = None if mgmt_context and mgmt_context.get('mgmt_nw_id') and tenant_...
[ "def", "create_hosting_device_resources", "(", "self", ",", "context", ",", "complementary_id", ",", "tenant_id", ",", "mgmt_context", ",", "max_hosted", ")", ":", "mgmt_port", "=", "None", "if", "mgmt_context", "and", "mgmt_context", ".", "get", "(", "'mgmt_nw_id...
Create resources for a hosting device in a plugin specific way.
[ "Create", "resources", "for", "a", "hosting", "device", "in", "a", "plugin", "specific", "way", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/device_manager/plugging_drivers/vif_hotplug_plugging_driver.py#L59-L86
train
openstack/networking-cisco
networking_cisco/plugins/cisco/device_manager/plugging_drivers/vif_hotplug_plugging_driver.py
VIFHotPlugPluggingDriver.get_hosting_device_resources
def get_hosting_device_resources(self, context, id, complementary_id, tenant_id, mgmt_nw_id): """Returns information about all resources for a hosting device.""" mgmt_port = None # Ports for hosting device may not yet have 'device_id' set to # Nova as...
python
def get_hosting_device_resources(self, context, id, complementary_id, tenant_id, mgmt_nw_id): """Returns information about all resources for a hosting device.""" mgmt_port = None # Ports for hosting device may not yet have 'device_id' set to # Nova as...
[ "def", "get_hosting_device_resources", "(", "self", ",", "context", ",", "id", ",", "complementary_id", ",", "tenant_id", ",", "mgmt_nw_id", ")", ":", "mgmt_port", "=", "None", "query", "=", "context", ".", "session", ".", "query", "(", "models_v2", ".", "Po...
Returns information about all resources for a hosting device.
[ "Returns", "information", "about", "all", "resources", "for", "a", "hosting", "device", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/device_manager/plugging_drivers/vif_hotplug_plugging_driver.py#L88-L105
train
openstack/networking-cisco
networking_cisco/plugins/cisco/device_manager/plugging_drivers/vif_hotplug_plugging_driver.py
VIFHotPlugPluggingDriver.delete_hosting_device_resources
def delete_hosting_device_resources(self, context, tenant_id, mgmt_port, **kwargs): """Deletes resources for a hosting device in a plugin specific way.""" if mgmt_port is not None: try: self._cleanup_hosting_port(context, mgmt_port['id...
python
def delete_hosting_device_resources(self, context, tenant_id, mgmt_port, **kwargs): """Deletes resources for a hosting device in a plugin specific way.""" if mgmt_port is not None: try: self._cleanup_hosting_port(context, mgmt_port['id...
[ "def", "delete_hosting_device_resources", "(", "self", ",", "context", ",", "tenant_id", ",", "mgmt_port", ",", "**", "kwargs", ")", ":", "if", "mgmt_port", "is", "not", "None", ":", "try", ":", "self", ".", "_cleanup_hosting_port", "(", "context", ",", "mgm...
Deletes resources for a hosting device in a plugin specific way.
[ "Deletes", "resources", "for", "a", "hosting", "device", "in", "a", "plugin", "specific", "way", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/device_manager/plugging_drivers/vif_hotplug_plugging_driver.py#L107-L119
train
openstack/networking-cisco
networking_cisco/plugins/cisco/device_manager/plugging_drivers/vif_hotplug_plugging_driver.py
VIFHotPlugPluggingDriver.setup_logical_port_connectivity
def setup_logical_port_connectivity(self, context, port_db, hosting_device_id): """Establishes connectivity for a logical port. This is done by hot plugging the interface(VIF) corresponding to the port from the VM. """ hosting_port = port_...
python
def setup_logical_port_connectivity(self, context, port_db, hosting_device_id): """Establishes connectivity for a logical port. This is done by hot plugging the interface(VIF) corresponding to the port from the VM. """ hosting_port = port_...
[ "def", "setup_logical_port_connectivity", "(", "self", ",", "context", ",", "port_db", ",", "hosting_device_id", ")", ":", "hosting_port", "=", "port_db", ".", "hosting_info", ".", "hosting_port", "if", "hosting_port", ":", "try", ":", "self", ".", "_dev_mgr", "...
Establishes connectivity for a logical port. This is done by hot plugging the interface(VIF) corresponding to the port from the VM.
[ "Establishes", "connectivity", "for", "a", "logical", "port", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/device_manager/plugging_drivers/vif_hotplug_plugging_driver.py#L164-L189
train
openstack/networking-cisco
networking_cisco/plugins/cisco/device_manager/plugging_drivers/vif_hotplug_plugging_driver.py
VIFHotPlugPluggingDriver.teardown_logical_port_connectivity
def teardown_logical_port_connectivity(self, context, port_db, hosting_device_id): """Removes connectivity for a logical port. Unplugs the corresponding data interface from the VM. """ if port_db is None or port_db.get('id') is None: ...
python
def teardown_logical_port_connectivity(self, context, port_db, hosting_device_id): """Removes connectivity for a logical port. Unplugs the corresponding data interface from the VM. """ if port_db is None or port_db.get('id') is None: ...
[ "def", "teardown_logical_port_connectivity", "(", "self", ",", "context", ",", "port_db", ",", "hosting_device_id", ")", ":", "if", "port_db", "is", "None", "or", "port_db", ".", "get", "(", "'id'", ")", "is", "None", ":", "LOG", ".", "warning", "(", "\"Po...
Removes connectivity for a logical port. Unplugs the corresponding data interface from the VM.
[ "Removes", "connectivity", "for", "a", "logical", "port", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/device_manager/plugging_drivers/vif_hotplug_plugging_driver.py#L191-L214
train
openstack/networking-cisco
networking_cisco/plugins/cisco/device_manager/plugging_drivers/vif_hotplug_plugging_driver.py
VIFHotPlugPluggingDriver.allocate_hosting_port
def allocate_hosting_port(self, context, router_id, port_db, network_type, hosting_device_id): """Allocates a hosting port for a logical port. We create a hosting port for the router port """ l3admin_tenant_id = self._dev_mgr.l3_tenant_id() hostingp...
python
def allocate_hosting_port(self, context, router_id, port_db, network_type, hosting_device_id): """Allocates a hosting port for a logical port. We create a hosting port for the router port """ l3admin_tenant_id = self._dev_mgr.l3_tenant_id() hostingp...
[ "def", "allocate_hosting_port", "(", "self", ",", "context", ",", "router_id", ",", "port_db", ",", "network_type", ",", "hosting_device_id", ")", ":", "l3admin_tenant_id", "=", "self", ".", "_dev_mgr", ".", "l3_tenant_id", "(", ")", "hostingport_name", "=", "'h...
Allocates a hosting port for a logical port. We create a hosting port for the router port
[ "Allocates", "a", "hosting", "port", "for", "a", "logical", "port", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/device_manager/plugging_drivers/vif_hotplug_plugging_driver.py#L221-L252
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cpnr/dhcp_driver.py
RemoteServerDriver.disable
def disable(self, retain_port=False): """Teardown DHCP. Disable DHCP for this network by updating the remote server and then destroying any local device and namespace. """ self.update_server(disabled=True) if retain_port: return self.update_device(dis...
python
def disable(self, retain_port=False): """Teardown DHCP. Disable DHCP for this network by updating the remote server and then destroying any local device and namespace. """ self.update_server(disabled=True) if retain_port: return self.update_device(dis...
[ "def", "disable", "(", "self", ",", "retain_port", "=", "False", ")", ":", "self", ".", "update_server", "(", "disabled", "=", "True", ")", "if", "retain_port", ":", "return", "self", ".", "update_device", "(", "disabled", "=", "True", ")", "if", "self",...
Teardown DHCP. Disable DHCP for this network by updating the remote server and then destroying any local device and namespace.
[ "Teardown", "DHCP", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cpnr/dhcp_driver.py#L98-L115
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cpnr/dhcp_driver.py
RemoteServerDriver.recover_devices
def recover_devices(cls): """Track devices. Creates global dict to track device names across driver invocations and populates based on current devices configured on the system. """ if "_devices" in globals(): return global _devices confs_dir = os.pa...
python
def recover_devices(cls): """Track devices. Creates global dict to track device names across driver invocations and populates based on current devices configured on the system. """ if "_devices" in globals(): return global _devices confs_dir = os.pa...
[ "def", "recover_devices", "(", "cls", ")", ":", "if", "\"_devices\"", "in", "globals", "(", ")", ":", "return", "global", "_devices", "confs_dir", "=", "os", ".", "path", ".", "abspath", "(", "os", ".", "path", ".", "normpath", "(", "cfg", ".", "CONF",...
Track devices. Creates global dict to track device names across driver invocations and populates based on current devices configured on the system.
[ "Track", "devices", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cpnr/dhcp_driver.py#L160-L183
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cpnr/dhcp_driver.py
SimpleCpnrDriver.check_version
def check_version(cls): """Checks server version against minimum required version.""" super(SimpleCpnrDriver, cls).check_version() model.configure_pnr() cls.recover_networks() ver = model.get_version() if ver < cls.MIN_VERSION: LOG.warning("CPNR version does n...
python
def check_version(cls): """Checks server version against minimum required version.""" super(SimpleCpnrDriver, cls).check_version() model.configure_pnr() cls.recover_networks() ver = model.get_version() if ver < cls.MIN_VERSION: LOG.warning("CPNR version does n...
[ "def", "check_version", "(", "cls", ")", ":", "super", "(", "SimpleCpnrDriver", ",", "cls", ")", ".", "check_version", "(", ")", "model", ".", "configure_pnr", "(", ")", "cls", ".", "recover_networks", "(", ")", "ver", "=", "model", ".", "get_version", "...
Checks server version against minimum required version.
[ "Checks", "server", "version", "against", "minimum", "required", "version", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cpnr/dhcp_driver.py#L263-L273
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cpnr/dhcp_driver.py
SimpleCpnrDriver.existing_dhcp_networks
def existing_dhcp_networks(cls, conf): """Return a list of existing networks ids that we have configs for.""" global _networks sup = super(SimpleCpnrDriver, cls) superkeys = sup.existing_dhcp_networks(conf) return set(_networks.keys()) & set(superkeys)
python
def existing_dhcp_networks(cls, conf): """Return a list of existing networks ids that we have configs for.""" global _networks sup = super(SimpleCpnrDriver, cls) superkeys = sup.existing_dhcp_networks(conf) return set(_networks.keys()) & set(superkeys)
[ "def", "existing_dhcp_networks", "(", "cls", ",", "conf", ")", ":", "global", "_networks", "sup", "=", "super", "(", "SimpleCpnrDriver", ",", "cls", ")", "superkeys", "=", "sup", ".", "existing_dhcp_networks", "(", "conf", ")", "return", "set", "(", "_networ...
Return a list of existing networks ids that we have configs for.
[ "Return", "a", "list", "of", "existing", "networks", "ids", "that", "we", "have", "configs", "for", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cpnr/dhcp_driver.py#L276-L281
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cpnr/dhcp_driver.py
SimpleCpnrDriver._unsafe_update_server
def _unsafe_update_server(self, disabled=False): """Update server with latest network configuration.""" id = self.network.id net = model.Network.from_neutron(self.network) if id not in _networks: if disabled: return _networks[id] = net ...
python
def _unsafe_update_server(self, disabled=False): """Update server with latest network configuration.""" id = self.network.id net = model.Network.from_neutron(self.network) if id not in _networks: if disabled: return _networks[id] = net ...
[ "def", "_unsafe_update_server", "(", "self", ",", "disabled", "=", "False", ")", ":", "id", "=", "self", ".", "network", ".", "id", "net", "=", "model", ".", "Network", ".", "from_neutron", "(", "self", ".", "network", ")", "if", "id", "not", "in", "...
Update server with latest network configuration.
[ "Update", "server", "with", "latest", "network", "configuration", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cpnr/dhcp_driver.py#L291-L305
train
openstack/networking-cisco
networking_cisco/apps/saf/server/dfa_openstack_helper.py
DfaNeutronHelper.create_network
def create_network(self, name, tenant_id, subnet, gw=None): """Create the openstack network, including the subnet. """ try: body = {'network': {'name': name, 'tenant_id': tenant_id, 'admin_state_up': True}} netw = self.neutronclient.create_network...
python
def create_network(self, name, tenant_id, subnet, gw=None): """Create the openstack network, including the subnet. """ try: body = {'network': {'name': name, 'tenant_id': tenant_id, 'admin_state_up': True}} netw = self.neutronclient.create_network...
[ "def", "create_network", "(", "self", ",", "name", ",", "tenant_id", ",", "subnet", ",", "gw", "=", "None", ")", ":", "try", ":", "body", "=", "{", "'network'", ":", "{", "'name'", ":", "name", ",", "'tenant_id'", ":", "tenant_id", ",", "'admin_state_u...
Create the openstack network, including the subnet.
[ "Create", "the", "openstack", "network", "including", "the", "subnet", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/dfa_openstack_helper.py#L40-L80
train
openstack/networking-cisco
networking_cisco/apps/saf/server/dfa_openstack_helper.py
DfaNeutronHelper.delete_network
def delete_network(self, name, tenant_id, subnet_id, net_id): """Delete the openstack subnet and network. """ try: self.neutronclient.delete_subnet(subnet_id) except Exception as exc: LOG.error("Failed to delete subnet %(sub)s exc %(exc)s", {'sub': s...
python
def delete_network(self, name, tenant_id, subnet_id, net_id): """Delete the openstack subnet and network. """ try: self.neutronclient.delete_subnet(subnet_id) except Exception as exc: LOG.error("Failed to delete subnet %(sub)s exc %(exc)s", {'sub': s...
[ "def", "delete_network", "(", "self", ",", "name", ",", "tenant_id", ",", "subnet_id", ",", "net_id", ")", ":", "try", ":", "self", ".", "neutronclient", ".", "delete_subnet", "(", "subnet_id", ")", "except", "Exception", "as", "exc", ":", "LOG", ".", "e...
Delete the openstack subnet and network.
[ "Delete", "the", "openstack", "subnet", "and", "network", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/dfa_openstack_helper.py#L82-L94
train
openstack/networking-cisco
networking_cisco/apps/saf/server/dfa_openstack_helper.py
DfaNeutronHelper.delete_network_all_subnets
def delete_network_all_subnets(self, net_id): """Delete the openstack network including all its subnets. """ try: body = {'network_id': net_id} subnet_list = self.neutronclient.list_subnets(body=body) subnet_list = subnet_list.get('subnets') for subnet in ...
python
def delete_network_all_subnets(self, net_id): """Delete the openstack network including all its subnets. """ try: body = {'network_id': net_id} subnet_list = self.neutronclient.list_subnets(body=body) subnet_list = subnet_list.get('subnets') for subnet in ...
[ "def", "delete_network_all_subnets", "(", "self", ",", "net_id", ")", ":", "try", ":", "body", "=", "{", "'network_id'", ":", "net_id", "}", "subnet_list", "=", "self", ".", "neutronclient", ".", "list_subnets", "(", "body", "=", "body", ")", "subnet_list", ...
Delete the openstack network including all its subnets.
[ "Delete", "the", "openstack", "network", "including", "all", "its", "subnets", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/dfa_openstack_helper.py#L97-L117
train