repository_name stringlengths 7 55 | func_path_in_repository stringlengths 4 223 | func_name stringlengths 1 134 | whole_func_string stringlengths 75 104k | language stringclasses 1
value | func_code_string stringlengths 75 104k | func_code_tokens listlengths 19 28.4k | func_documentation_string stringlengths 1 46.9k | func_documentation_tokens listlengths 1 1.97k | split_name stringclasses 1
value | func_code_url stringlengths 87 315 |
|---|---|---|---|---|---|---|---|---|---|---|
openstack/networking-cisco | networking_cisco/apps/saf/server/dfa_instance_api.py | DFAInstanceAPI._get_instances_for_project | def _get_instances_for_project(self, project_id):
"""Return all instances for a given project.
:project_id: UUID of project (tenant)
"""
search_opts = {'marker': None,
'all_tenants': True,
'project_id': project_id}
try:
s... | python | def _get_instances_for_project(self, project_id):
"""Return all instances for a given project.
:project_id: UUID of project (tenant)
"""
search_opts = {'marker': None,
'all_tenants': True,
'project_id': project_id}
try:
s... | [
"def",
"_get_instances_for_project",
"(",
"self",
",",
"project_id",
")",
":",
"search_opts",
"=",
"{",
"'marker'",
":",
"None",
",",
"'all_tenants'",
":",
"True",
",",
"'project_id'",
":",
"project_id",
"}",
"try",
":",
"servers",
"=",
"self",
".",
"_novacl... | Return all instances for a given project.
:project_id: UUID of project (tenant) | [
"Return",
"all",
"instances",
"for",
"a",
"given",
"project",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/dfa_instance_api.py#L65-L86 |
openstack/networking-cisco | networking_cisco/apps/saf/server/dfa_instance_api.py | DFAInstanceAPI.get_instance_for_uuid | def get_instance_for_uuid(self, uuid, project_id):
"""Return instance name for given uuid of an instance and project.
:uuid: Instance's UUID
:project_id: UUID of project (tenant)
"""
instance_name = self._inst_info_cache.get((uuid, project_id))
if instance_name:
... | python | def get_instance_for_uuid(self, uuid, project_id):
"""Return instance name for given uuid of an instance and project.
:uuid: Instance's UUID
:project_id: UUID of project (tenant)
"""
instance_name = self._inst_info_cache.get((uuid, project_id))
if instance_name:
... | [
"def",
"get_instance_for_uuid",
"(",
"self",
",",
"uuid",
",",
"project_id",
")",
":",
"instance_name",
"=",
"self",
".",
"_inst_info_cache",
".",
"get",
"(",
"(",
"uuid",
",",
"project_id",
")",
")",
"if",
"instance_name",
":",
"return",
"instance_name",
"i... | Return instance name for given uuid of an instance and project.
:uuid: Instance's UUID
:project_id: UUID of project (tenant) | [
"Return",
"instance",
"name",
"for",
"given",
"uuid",
"of",
"an",
"instance",
"and",
"project",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/dfa_instance_api.py#L88-L104 |
openstack/networking-cisco | networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py | HostingDeviceManagerMixin.l3_tenant_id | def l3_tenant_id(cls):
"""Returns id of tenant owning hosting device resources."""
if cls._l3_tenant_uuid is None:
if hasattr(cfg.CONF.keystone_authtoken, 'project_domain_id'):
# TODO(sridar): hack for now to determing if keystone v3
# API is to be used.
... | python | def l3_tenant_id(cls):
"""Returns id of tenant owning hosting device resources."""
if cls._l3_tenant_uuid is None:
if hasattr(cfg.CONF.keystone_authtoken, 'project_domain_id'):
# TODO(sridar): hack for now to determing if keystone v3
# API is to be used.
... | [
"def",
"l3_tenant_id",
"(",
"cls",
")",
":",
"if",
"cls",
".",
"_l3_tenant_uuid",
"is",
"None",
":",
"if",
"hasattr",
"(",
"cfg",
".",
"CONF",
".",
"keystone_authtoken",
",",
"'project_domain_id'",
")",
":",
"# TODO(sridar): hack for now to determing if keystone v3"... | Returns id of tenant owning hosting device resources. | [
"Returns",
"id",
"of",
"tenant",
"owning",
"hosting",
"device",
"resources",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py#L192-L201 |
openstack/networking-cisco | networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py | HostingDeviceManagerMixin.mgmt_nw_id | def mgmt_nw_id(cls):
"""Returns id of the management network."""
if cls._mgmt_nw_uuid is None:
tenant_id = cls.l3_tenant_id()
if not tenant_id:
return
net = bc.get_plugin().get_networks(
bc.context.get_admin_context(),
{... | python | def mgmt_nw_id(cls):
"""Returns id of the management network."""
if cls._mgmt_nw_uuid is None:
tenant_id = cls.l3_tenant_id()
if not tenant_id:
return
net = bc.get_plugin().get_networks(
bc.context.get_admin_context(),
{... | [
"def",
"mgmt_nw_id",
"(",
"cls",
")",
":",
"if",
"cls",
".",
"_mgmt_nw_uuid",
"is",
"None",
":",
"tenant_id",
"=",
"cls",
".",
"l3_tenant_id",
"(",
")",
"if",
"not",
"tenant_id",
":",
"return",
"net",
"=",
"bc",
".",
"get_plugin",
"(",
")",
".",
"get... | Returns id of the management network. | [
"Returns",
"id",
"of",
"the",
"management",
"network",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py#L204-L234 |
openstack/networking-cisco | networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py | HostingDeviceManagerMixin.mgmt_sec_grp_id | def mgmt_sec_grp_id(cls):
"""Returns id of security group used by the management network."""
if not extensions.is_extension_supported(bc.get_plugin(),
"security-group"):
return
if cls._mgmt_sec_grp_id is None:
# Get the id ... | python | def mgmt_sec_grp_id(cls):
"""Returns id of security group used by the management network."""
if not extensions.is_extension_supported(bc.get_plugin(),
"security-group"):
return
if cls._mgmt_sec_grp_id is None:
# Get the id ... | [
"def",
"mgmt_sec_grp_id",
"(",
"cls",
")",
":",
"if",
"not",
"extensions",
".",
"is_extension_supported",
"(",
"bc",
".",
"get_plugin",
"(",
")",
",",
"\"security-group\"",
")",
":",
"return",
"if",
"cls",
".",
"_mgmt_sec_grp_id",
"is",
"None",
":",
"# Get t... | Returns id of security group used by the management network. | [
"Returns",
"id",
"of",
"security",
"group",
"used",
"by",
"the",
"management",
"network",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py#L243-L268 |
openstack/networking-cisco | networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py | HostingDeviceManagerMixin.get_hosting_device_driver | def get_hosting_device_driver(self, context, id):
"""Returns device driver for hosting device template with <id>."""
if id is None:
return
try:
return self._hosting_device_drivers[id]
except KeyError:
try:
template = self._get_hosting_d... | python | def get_hosting_device_driver(self, context, id):
"""Returns device driver for hosting device template with <id>."""
if id is None:
return
try:
return self._hosting_device_drivers[id]
except KeyError:
try:
template = self._get_hosting_d... | [
"def",
"get_hosting_device_driver",
"(",
"self",
",",
"context",
",",
"id",
")",
":",
"if",
"id",
"is",
"None",
":",
"return",
"try",
":",
"return",
"self",
".",
"_hosting_device_drivers",
"[",
"id",
"]",
"except",
"KeyError",
":",
"try",
":",
"template",
... | Returns device driver for hosting device template with <id>. | [
"Returns",
"device",
"driver",
"for",
"hosting",
"device",
"template",
"with",
"<id",
">",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py#L276-L290 |
openstack/networking-cisco | networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py | HostingDeviceManagerMixin.get_hosting_device_plugging_driver | def get_hosting_device_plugging_driver(self, context, id):
"""Returns plugging driver for hosting device template with <id>."""
if id is None:
return
try:
return self._plugging_drivers[id]
except KeyError:
try:
template = self._get_hos... | python | def get_hosting_device_plugging_driver(self, context, id):
"""Returns plugging driver for hosting device template with <id>."""
if id is None:
return
try:
return self._plugging_drivers[id]
except KeyError:
try:
template = self._get_hos... | [
"def",
"get_hosting_device_plugging_driver",
"(",
"self",
",",
"context",
",",
"id",
")",
":",
"if",
"id",
"is",
"None",
":",
"return",
"try",
":",
"return",
"self",
".",
"_plugging_drivers",
"[",
"id",
"]",
"except",
"KeyError",
":",
"try",
":",
"template... | Returns plugging driver for hosting device template with <id>. | [
"Returns",
"plugging",
"driver",
"for",
"hosting",
"device",
"template",
"with",
"<id",
">",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py#L292-L306 |
openstack/networking-cisco | networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py | HostingDeviceManagerMixin.acquire_hosting_device_slots | def acquire_hosting_device_slots(self, context, hosting_device, resource,
resource_type, resource_service, num,
exclusive=False):
"""Assign <num> slots in <hosting_device> to logical <resource>.
If exclusive is True the hosting d... | python | def acquire_hosting_device_slots(self, context, hosting_device, resource,
resource_type, resource_service, num,
exclusive=False):
"""Assign <num> slots in <hosting_device> to logical <resource>.
If exclusive is True the hosting d... | [
"def",
"acquire_hosting_device_slots",
"(",
"self",
",",
"context",
",",
"hosting_device",
",",
"resource",
",",
"resource_type",
",",
"resource_service",
",",
"num",
",",
"exclusive",
"=",
"False",
")",
":",
"bound",
"=",
"hosting_device",
"[",
"'tenant_bound'",
... | Assign <num> slots in <hosting_device> to logical <resource>.
If exclusive is True the hosting device is bound to the resource's
tenant. Otherwise it is not bound to any tenant.
Returns True if allocation was granted, False otherwise. | [
"Assign",
"<num",
">",
"slots",
"in",
"<hosting_device",
">",
"to",
"logical",
"<resource",
">",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py#L312-L374 |
openstack/networking-cisco | networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py | HostingDeviceManagerMixin.release_hosting_device_slots | def release_hosting_device_slots(self, context, hosting_device, resource,
num):
"""Free <num> slots in <hosting_device> from logical resource <id>.
Returns True if deallocation was successful. False otherwise.
"""
with context.session.begin(subtransa... | python | def release_hosting_device_slots(self, context, hosting_device, resource,
num):
"""Free <num> slots in <hosting_device> from logical resource <id>.
Returns True if deallocation was successful. False otherwise.
"""
with context.session.begin(subtransa... | [
"def",
"release_hosting_device_slots",
"(",
"self",
",",
"context",
",",
"hosting_device",
",",
"resource",
",",
"num",
")",
":",
"with",
"context",
".",
"session",
".",
"begin",
"(",
"subtransactions",
"=",
"True",
")",
":",
"num_str",
"=",
"str",
"(",
"n... | Free <num> slots in <hosting_device> from logical resource <id>.
Returns True if deallocation was successful. False otherwise. | [
"Free",
"<num",
">",
"slots",
"in",
"<hosting_device",
">",
"from",
"logical",
"resource",
"<id",
">",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py#L376-L438 |
openstack/networking-cisco | networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py | HostingDeviceManagerMixin.get_hosting_devices_qry | def get_hosting_devices_qry(self, context, hosting_device_ids,
load_agent=True):
"""Returns hosting devices with <hosting_device_ids>."""
query = context.session.query(hd_models.HostingDevice)
if load_agent:
query = query.options(joinedload('cfg_agent'... | python | def get_hosting_devices_qry(self, context, hosting_device_ids,
load_agent=True):
"""Returns hosting devices with <hosting_device_ids>."""
query = context.session.query(hd_models.HostingDevice)
if load_agent:
query = query.options(joinedload('cfg_agent'... | [
"def",
"get_hosting_devices_qry",
"(",
"self",
",",
"context",
",",
"hosting_device_ids",
",",
"load_agent",
"=",
"True",
")",
":",
"query",
"=",
"context",
".",
"session",
".",
"query",
"(",
"hd_models",
".",
"HostingDevice",
")",
"if",
"load_agent",
":",
"... | Returns hosting devices with <hosting_device_ids>. | [
"Returns",
"hosting",
"devices",
"with",
"<hosting_device_ids",
">",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py#L488-L500 |
openstack/networking-cisco | networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py | HostingDeviceManagerMixin.delete_all_hosting_devices | def delete_all_hosting_devices(self, context, force_delete=False):
"""Deletes all hosting devices."""
for item in self._get_collection_query(
context, hd_models.HostingDeviceTemplate):
self.delete_all_hosting_devices_by_template(
context, template=item, force_... | python | def delete_all_hosting_devices(self, context, force_delete=False):
"""Deletes all hosting devices."""
for item in self._get_collection_query(
context, hd_models.HostingDeviceTemplate):
self.delete_all_hosting_devices_by_template(
context, template=item, force_... | [
"def",
"delete_all_hosting_devices",
"(",
"self",
",",
"context",
",",
"force_delete",
"=",
"False",
")",
":",
"for",
"item",
"in",
"self",
".",
"_get_collection_query",
"(",
"context",
",",
"hd_models",
".",
"HostingDeviceTemplate",
")",
":",
"self",
".",
"de... | Deletes all hosting devices. | [
"Deletes",
"all",
"hosting",
"devices",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py#L502-L507 |
openstack/networking-cisco | networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py | HostingDeviceManagerMixin.delete_all_hosting_devices_by_template | def delete_all_hosting_devices_by_template(self, context, template,
force_delete=False):
"""Deletes all hosting devices based on <template>."""
plugging_drv = self.get_hosting_device_plugging_driver(
context, template['id'])
hosting_devi... | python | def delete_all_hosting_devices_by_template(self, context, template,
force_delete=False):
"""Deletes all hosting devices based on <template>."""
plugging_drv = self.get_hosting_device_plugging_driver(
context, template['id'])
hosting_devi... | [
"def",
"delete_all_hosting_devices_by_template",
"(",
"self",
",",
"context",
",",
"template",
",",
"force_delete",
"=",
"False",
")",
":",
"plugging_drv",
"=",
"self",
".",
"get_hosting_device_plugging_driver",
"(",
"context",
",",
"template",
"[",
"'id'",
"]",
"... | Deletes all hosting devices based on <template>. | [
"Deletes",
"all",
"hosting",
"devices",
"based",
"on",
"<template",
">",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py#L509-L538 |
openstack/networking-cisco | networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py | HostingDeviceManagerMixin.get_device_info_for_agent | def get_device_info_for_agent(self, context, hosting_device_db):
"""Returns information about <hosting_device> needed by config agent.
Convenience function that service plugins can use to populate
their resources with information about the device hosting their
logical resource.... | python | def get_device_info_for_agent(self, context, hosting_device_db):
"""Returns information about <hosting_device> needed by config agent.
Convenience function that service plugins can use to populate
their resources with information about the device hosting their
logical resource.... | [
"def",
"get_device_info_for_agent",
"(",
"self",
",",
"context",
",",
"hosting_device_db",
")",
":",
"template",
"=",
"hosting_device_db",
".",
"template",
"mgmt_port",
"=",
"hosting_device_db",
".",
"management_port",
"mgmt_ip",
"=",
"(",
"mgmt_port",
"[",
"'fixed_... | Returns information about <hosting_device> needed by config agent.
Convenience function that service plugins can use to populate
their resources with information about the device hosting their
logical resource. | [
"Returns",
"information",
"about",
"<hosting_device",
">",
"needed",
"by",
"config",
"agent",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py#L570-L593 |
openstack/networking-cisco | networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py | HostingDeviceManagerMixin._process_non_responsive_hosting_device | def _process_non_responsive_hosting_device(self, context, hosting_device):
"""Host type specific processing of non responsive hosting devices.
:param hosting_device: db object for hosting device
:return: True if hosting_device has been deleted, otherwise False
"""
if (hosting_de... | python | def _process_non_responsive_hosting_device(self, context, hosting_device):
"""Host type specific processing of non responsive hosting devices.
:param hosting_device: db object for hosting device
:return: True if hosting_device has been deleted, otherwise False
"""
if (hosting_de... | [
"def",
"_process_non_responsive_hosting_device",
"(",
"self",
",",
"context",
",",
"hosting_device",
")",
":",
"if",
"(",
"hosting_device",
"[",
"'template'",
"]",
"[",
"'host_category'",
"]",
"==",
"VM_CATEGORY",
"and",
"hosting_device",
"[",
"'auto_delete'",
"]",
... | Host type specific processing of non responsive hosting devices.
:param hosting_device: db object for hosting device
:return: True if hosting_device has been deleted, otherwise False | [
"Host",
"type",
"specific",
"processing",
"of",
"non",
"responsive",
"hosting",
"devices",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py#L595-L606 |
openstack/networking-cisco | networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py | HostingDeviceManagerMixin._maintain_hosting_device_pool | def _maintain_hosting_device_pool(self, context, template):
"""Maintains the pool of hosting devices that are based on <template>.
Ensures that the number of standby hosting devices (essentially
service VMs) is kept at a suitable level so that resource creation is
not slowed down by boo... | python | def _maintain_hosting_device_pool(self, context, template):
"""Maintains the pool of hosting devices that are based on <template>.
Ensures that the number of standby hosting devices (essentially
service VMs) is kept at a suitable level so that resource creation is
not slowed down by boo... | [
"def",
"_maintain_hosting_device_pool",
"(",
"self",
",",
"context",
",",
"template",
")",
":",
"#TODO(bobmel): Support HA/load-balanced Neutron servers:",
"#TODO(bobmel): Locking across multiple running Neutron server instances",
"lock",
"=",
"self",
".",
"_get_template_pool_lock",
... | Maintains the pool of hosting devices that are based on <template>.
Ensures that the number of standby hosting devices (essentially
service VMs) is kept at a suitable level so that resource creation is
not slowed down by booting of the hosting device.
:param context: context for this o... | [
"Maintains",
"the",
"pool",
"of",
"hosting",
"devices",
"that",
"are",
"based",
"on",
"<template",
">",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py#L642-L696 |
openstack/networking-cisco | networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py | HostingDeviceManagerMixin._create_svc_vm_hosting_devices | def _create_svc_vm_hosting_devices(self, context, num, template):
"""Creates <num> or less service VM instances based on <template>.
These hosting devices can be bound to a certain tenant or for shared
use. A list with the created hosting device VMs is returned.
"""
hosting_devi... | python | def _create_svc_vm_hosting_devices(self, context, num, template):
"""Creates <num> or less service VM instances based on <template>.
These hosting devices can be bound to a certain tenant or for shared
use. A list with the created hosting device VMs is returned.
"""
hosting_devi... | [
"def",
"_create_svc_vm_hosting_devices",
"(",
"self",
",",
"context",
",",
"num",
",",
"template",
")",
":",
"hosting_devices",
"=",
"[",
"]",
"template_id",
"=",
"template",
"[",
"'id'",
"]",
"credentials_id",
"=",
"template",
"[",
"'default_credentials_id'",
"... | Creates <num> or less service VM instances based on <template>.
These hosting devices can be bound to a certain tenant or for shared
use. A list with the created hosting device VMs is returned. | [
"Creates",
"<num",
">",
"or",
"less",
"service",
"VM",
"instances",
"based",
"on",
"<template",
">",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py#L698-L757 |
openstack/networking-cisco | networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py | HostingDeviceManagerMixin._delete_idle_service_vm_hosting_devices | def _delete_idle_service_vm_hosting_devices(self, context, num, template):
"""Deletes <num> or less unused <template>-based service VM instances.
The number of deleted service vm instances is returned.
"""
# Delete the "youngest" hosting devices since they are more likely
# not ... | python | def _delete_idle_service_vm_hosting_devices(self, context, num, template):
"""Deletes <num> or less unused <template>-based service VM instances.
The number of deleted service vm instances is returned.
"""
# Delete the "youngest" hosting devices since they are more likely
# not ... | [
"def",
"_delete_idle_service_vm_hosting_devices",
"(",
"self",
",",
"context",
",",
"num",
",",
"template",
")",
":",
"# Delete the \"youngest\" hosting devices since they are more likely",
"# not to have finished booting",
"num_deleted",
"=",
"0",
"plugging_drv",
"=",
"self",
... | Deletes <num> or less unused <template>-based service VM instances.
The number of deleted service vm instances is returned. | [
"Deletes",
"<num",
">",
"or",
"less",
"unused",
"<template",
">",
"-",
"based",
"service",
"VM",
"instances",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py#L793-L841 |
openstack/networking-cisco | networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py | HostingDeviceManagerMixin._delete_dead_service_vm_hosting_device | def _delete_dead_service_vm_hosting_device(self, context, hosting_device):
"""Deletes a presumably dead <hosting_device> service VM.
This will indirectly make all of its hosted resources unscheduled.
"""
if hosting_device is None:
return
plugging_drv = self.get_hosti... | python | def _delete_dead_service_vm_hosting_device(self, context, hosting_device):
"""Deletes a presumably dead <hosting_device> service VM.
This will indirectly make all of its hosted resources unscheduled.
"""
if hosting_device is None:
return
plugging_drv = self.get_hosti... | [
"def",
"_delete_dead_service_vm_hosting_device",
"(",
"self",
",",
"context",
",",
"hosting_device",
")",
":",
"if",
"hosting_device",
"is",
"None",
":",
"return",
"plugging_drv",
"=",
"self",
".",
"get_hosting_device_plugging_driver",
"(",
"context",
",",
"hosting_de... | Deletes a presumably dead <hosting_device> service VM.
This will indirectly make all of its hosted resources unscheduled. | [
"Deletes",
"a",
"presumably",
"dead",
"<hosting_device",
">",
"service",
"VM",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py#L843-L870 |
openstack/networking-cisco | networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py | HostingDeviceManagerMixin._get_total_available_slots | def _get_total_available_slots(self, context, template_id, capacity):
"""Returns available slots in idle devices based on <template_id>.
Only slots in tenant unbound hosting devices are counted to ensure
there is always hosting device slots available regardless of tenant.
"""
qu... | python | def _get_total_available_slots(self, context, template_id, capacity):
"""Returns available slots in idle devices based on <template_id>.
Only slots in tenant unbound hosting devices are counted to ensure
there is always hosting device slots available regardless of tenant.
"""
qu... | [
"def",
"_get_total_available_slots",
"(",
"self",
",",
"context",
",",
"template_id",
",",
"capacity",
")",
":",
"query",
"=",
"context",
".",
"session",
".",
"query",
"(",
"hd_models",
".",
"HostingDevice",
".",
"id",
")",
"query",
"=",
"query",
".",
"out... | Returns available slots in idle devices based on <template_id>.
Only slots in tenant unbound hosting devices are counted to ensure
there is always hosting device slots available regardless of tenant. | [
"Returns",
"available",
"slots",
"in",
"idle",
"devices",
"based",
"on",
"<template_id",
">",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py#L872-L891 |
openstack/networking-cisco | networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py | HostingDeviceManagerMixin._exclusively_used | def _exclusively_used(self, context, hosting_device, tenant_id):
"""Checks if only <tenant_id>'s resources use <hosting_device>."""
return (context.session.query(hd_models.SlotAllocation).filter(
hd_models.SlotAllocation.hosting_device_id == hosting_device['id'],
hd_models.SlotAl... | python | def _exclusively_used(self, context, hosting_device, tenant_id):
"""Checks if only <tenant_id>'s resources use <hosting_device>."""
return (context.session.query(hd_models.SlotAllocation).filter(
hd_models.SlotAllocation.hosting_device_id == hosting_device['id'],
hd_models.SlotAl... | [
"def",
"_exclusively_used",
"(",
"self",
",",
"context",
",",
"hosting_device",
",",
"tenant_id",
")",
":",
"return",
"(",
"context",
".",
"session",
".",
"query",
"(",
"hd_models",
".",
"SlotAllocation",
")",
".",
"filter",
"(",
"hd_models",
".",
"SlotAlloc... | Checks if only <tenant_id>'s resources use <hosting_device>. | [
"Checks",
"if",
"only",
"<tenant_id",
">",
"s",
"resources",
"use",
"<hosting_device",
">",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py#L893-L898 |
openstack/networking-cisco | networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py | HostingDeviceManagerMixin._update_hosting_device_exclusivity | def _update_hosting_device_exclusivity(self, context, hosting_device,
tenant_id):
"""Make <hosting device> bound or unbound to <tenant_id>.
If <tenant_id> is None the device is unbound, otherwise it gets bound
to that <tenant_id>
"""
wi... | python | def _update_hosting_device_exclusivity(self, context, hosting_device,
tenant_id):
"""Make <hosting device> bound or unbound to <tenant_id>.
If <tenant_id> is None the device is unbound, otherwise it gets bound
to that <tenant_id>
"""
wi... | [
"def",
"_update_hosting_device_exclusivity",
"(",
"self",
",",
"context",
",",
"hosting_device",
",",
"tenant_id",
")",
":",
"with",
"context",
".",
"session",
".",
"begin",
"(",
"subtransactions",
"=",
"True",
")",
":",
"hosting_device",
"[",
"'tenant_bound'",
... | Make <hosting device> bound or unbound to <tenant_id>.
If <tenant_id> is None the device is unbound, otherwise it gets bound
to that <tenant_id> | [
"Make",
"<hosting",
"device",
">",
"bound",
"or",
"unbound",
"to",
"<tenant_id",
">",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py#L900-L913 |
openstack/networking-cisco | networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py | HostingDeviceManagerMixin._get_template_pool_lock | def _get_template_pool_lock(self, id):
"""Returns lock object for hosting device template with <id>."""
try:
return self._hosting_device_locks[id]
except KeyError:
self._hosting_device_locks[id] = threading.Lock()
return self._hosting_device_locks.get(id) | python | def _get_template_pool_lock(self, id):
"""Returns lock object for hosting device template with <id>."""
try:
return self._hosting_device_locks[id]
except KeyError:
self._hosting_device_locks[id] = threading.Lock()
return self._hosting_device_locks.get(id) | [
"def",
"_get_template_pool_lock",
"(",
"self",
",",
"id",
")",
":",
"try",
":",
"return",
"self",
".",
"_hosting_device_locks",
"[",
"id",
"]",
"except",
"KeyError",
":",
"self",
".",
"_hosting_device_locks",
"[",
"id",
"]",
"=",
"threading",
".",
"Lock",
... | Returns lock object for hosting device template with <id>. | [
"Returns",
"lock",
"object",
"for",
"hosting",
"device",
"template",
"with",
"<id",
">",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py#L915-L921 |
openstack/networking-cisco | networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py | HostingDeviceManagerMixin._create_hosting_device_templates_from_config | def _create_hosting_device_templates_from_config(self):
"""To be called late during plugin initialization so that any hosting
device templates defined in the config file is properly inserted in
the DB.
"""
hdt_dict = config.get_specific_config('cisco_hosting_device_template')
... | python | def _create_hosting_device_templates_from_config(self):
"""To be called late during plugin initialization so that any hosting
device templates defined in the config file is properly inserted in
the DB.
"""
hdt_dict = config.get_specific_config('cisco_hosting_device_template')
... | [
"def",
"_create_hosting_device_templates_from_config",
"(",
"self",
")",
":",
"hdt_dict",
"=",
"config",
".",
"get_specific_config",
"(",
"'cisco_hosting_device_template'",
")",
"attr_info",
"=",
"ciscohostingdevicemanager",
".",
"RESOURCE_ATTRIBUTE_MAP",
"[",
"ciscohostingde... | To be called late during plugin initialization so that any hosting
device templates defined in the config file is properly inserted in
the DB. | [
"To",
"be",
"called",
"late",
"during",
"plugin",
"initialization",
"so",
"that",
"any",
"hosting",
"device",
"templates",
"defined",
"in",
"the",
"config",
"file",
"is",
"properly",
"inserted",
"in",
"the",
"DB",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py#L934-L966 |
openstack/networking-cisco | networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py | HostingDeviceManagerMixin._create_hosting_devices_from_config | def _create_hosting_devices_from_config(self):
"""To be called late during plugin initialization so that any hosting
device specified in the config file is properly inserted in the DB.
"""
hd_dict = config.get_specific_config('cisco_hosting_device')
attr_info = ciscohostingdevice... | python | def _create_hosting_devices_from_config(self):
"""To be called late during plugin initialization so that any hosting
device specified in the config file is properly inserted in the DB.
"""
hd_dict = config.get_specific_config('cisco_hosting_device')
attr_info = ciscohostingdevice... | [
"def",
"_create_hosting_devices_from_config",
"(",
"self",
")",
":",
"hd_dict",
"=",
"config",
".",
"get_specific_config",
"(",
"'cisco_hosting_device'",
")",
"attr_info",
"=",
"ciscohostingdevicemanager",
".",
"RESOURCE_ATTRIBUTE_MAP",
"[",
"ciscohostingdevicemanager",
"."... | To be called late during plugin initialization so that any hosting
device specified in the config file is properly inserted in the DB. | [
"To",
"be",
"called",
"late",
"during",
"plugin",
"initialization",
"so",
"that",
"any",
"hosting",
"device",
"specified",
"in",
"the",
"config",
"file",
"is",
"properly",
"inserted",
"in",
"the",
"DB",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/db/device_manager/hosting_device_manager_db.py#L968-L1003 |
openstack/networking-cisco | networking_cisco/neutronclient/routerscheduler.py | AddRouterToHostingDevice.add_router_to_hosting_device | def add_router_to_hosting_device(self, client, hosting_device_id, body):
"""Adds a router to hosting device."""
res_path = hostingdevice.HostingDevice.resource_path
return client.post((res_path + DEVICE_L3_ROUTERS) %
hosting_device_id, body=body) | python | def add_router_to_hosting_device(self, client, hosting_device_id, body):
"""Adds a router to hosting device."""
res_path = hostingdevice.HostingDevice.resource_path
return client.post((res_path + DEVICE_L3_ROUTERS) %
hosting_device_id, body=body) | [
"def",
"add_router_to_hosting_device",
"(",
"self",
",",
"client",
",",
"hosting_device_id",
",",
"body",
")",
":",
"res_path",
"=",
"hostingdevice",
".",
"HostingDevice",
".",
"resource_path",
"return",
"client",
".",
"post",
"(",
"(",
"res_path",
"+",
"DEVICE_... | Adds a router to hosting device. | [
"Adds",
"a",
"router",
"to",
"hosting",
"device",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/neutronclient/routerscheduler.py#L72-L76 |
openstack/networking-cisco | networking_cisco/neutronclient/routerscheduler.py | RemoveRouterFromHostingDevice.remove_router_from_hosting_device | def remove_router_from_hosting_device(self, client, hosting_device_id,
router_id):
"""Remove a router from hosting_device."""
res_path = hostingdevice.HostingDevice.resource_path
return client.delete((res_path + DEVICE_L3_ROUTERS + "/%s") % (
... | python | def remove_router_from_hosting_device(self, client, hosting_device_id,
router_id):
"""Remove a router from hosting_device."""
res_path = hostingdevice.HostingDevice.resource_path
return client.delete((res_path + DEVICE_L3_ROUTERS + "/%s") % (
... | [
"def",
"remove_router_from_hosting_device",
"(",
"self",
",",
"client",
",",
"hosting_device_id",
",",
"router_id",
")",
":",
"res_path",
"=",
"hostingdevice",
".",
"HostingDevice",
".",
"resource_path",
"return",
"client",
".",
"delete",
"(",
"(",
"res_path",
"+"... | Remove a router from hosting_device. | [
"Remove",
"a",
"router",
"from",
"hosting_device",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/neutronclient/routerscheduler.py#L111-L116 |
openstack/networking-cisco | networking_cisco/neutronclient/routerscheduler.py | RoutersOnHostingDeviceList.list_routers_on_hosting_device | def list_routers_on_hosting_device(self, client, hosting_device_id,
**_params):
"""Fetches a list of routers hosted on a hosting device."""
res_path = hostingdevice.HostingDevice.resource_path
return client.get((res_path + DEVICE_L3_ROUTERS) %
... | python | def list_routers_on_hosting_device(self, client, hosting_device_id,
**_params):
"""Fetches a list of routers hosted on a hosting device."""
res_path = hostingdevice.HostingDevice.resource_path
return client.get((res_path + DEVICE_L3_ROUTERS) %
... | [
"def",
"list_routers_on_hosting_device",
"(",
"self",
",",
"client",
",",
"hosting_device_id",
",",
"*",
"*",
"_params",
")",
":",
"res_path",
"=",
"hostingdevice",
".",
"HostingDevice",
".",
"resource_path",
"return",
"client",
".",
"get",
"(",
"(",
"res_path",... | Fetches a list of routers hosted on a hosting device. | [
"Fetches",
"a",
"list",
"of",
"routers",
"hosted",
"on",
"a",
"hosting",
"device",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/neutronclient/routerscheduler.py#L141-L146 |
openstack/networking-cisco | networking_cisco/neutronclient/routerscheduler.py | HostingDeviceHostingRouterList.list_hosting_devices_hosting_routers | def list_hosting_devices_hosting_routers(self, client, router_id,
**_params):
"""Fetches a list of hosting devices hosting a router."""
return client.get((client.router_path + L3_ROUTER_DEVICES) %
router_id, params=_params) | python | def list_hosting_devices_hosting_routers(self, client, router_id,
**_params):
"""Fetches a list of hosting devices hosting a router."""
return client.get((client.router_path + L3_ROUTER_DEVICES) %
router_id, params=_params) | [
"def",
"list_hosting_devices_hosting_routers",
"(",
"self",
",",
"client",
",",
"router_id",
",",
"*",
"*",
"_params",
")",
":",
"return",
"client",
".",
"get",
"(",
"(",
"client",
".",
"router_path",
"+",
"L3_ROUTER_DEVICES",
")",
"%",
"router_id",
",",
"pa... | Fetches a list of hosting devices hosting a router. | [
"Fetches",
"a",
"list",
"of",
"hosting",
"devices",
"hosting",
"a",
"router",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/neutronclient/routerscheduler.py#L182-L186 |
openstack/networking-cisco | networking_cisco/apps/saf/agent/dfa_agent.py | DfaAgent.setup_client_rpc | def setup_client_rpc(self):
"""Setup RPC client for dfa agent."""
# Setup RPC client.
self.clnt = rpc.DfaRpcClient(self._url, constants.DFA_SERVER_QUEUE,
exchange=constants.DFA_EXCHANGE) | python | def setup_client_rpc(self):
"""Setup RPC client for dfa agent."""
# Setup RPC client.
self.clnt = rpc.DfaRpcClient(self._url, constants.DFA_SERVER_QUEUE,
exchange=constants.DFA_EXCHANGE) | [
"def",
"setup_client_rpc",
"(",
"self",
")",
":",
"# Setup RPC client.",
"self",
".",
"clnt",
"=",
"rpc",
".",
"DfaRpcClient",
"(",
"self",
".",
"_url",
",",
"constants",
".",
"DFA_SERVER_QUEUE",
",",
"exchange",
"=",
"constants",
".",
"DFA_EXCHANGE",
")"
] | Setup RPC client for dfa agent. | [
"Setup",
"RPC",
"client",
"for",
"dfa",
"agent",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/dfa_agent.py#L134-L138 |
openstack/networking-cisco | networking_cisco/apps/saf/agent/dfa_agent.py | DfaAgent.setup_rpc | def setup_rpc(self):
"""Setup RPC server for dfa agent."""
endpoints = RpcCallBacks(self._vdpm, self._iptd)
self.server = rpc.DfaRpcServer(self._qn, self._my_host, self._url,
endpoints,
exchange=constants.DFA_EXCHANGE... | python | def setup_rpc(self):
"""Setup RPC server for dfa agent."""
endpoints = RpcCallBacks(self._vdpm, self._iptd)
self.server = rpc.DfaRpcServer(self._qn, self._my_host, self._url,
endpoints,
exchange=constants.DFA_EXCHANGE... | [
"def",
"setup_rpc",
"(",
"self",
")",
":",
"endpoints",
"=",
"RpcCallBacks",
"(",
"self",
".",
"_vdpm",
",",
"self",
".",
"_iptd",
")",
"self",
".",
"server",
"=",
"rpc",
".",
"DfaRpcServer",
"(",
"self",
".",
"_qn",
",",
"self",
".",
"_my_host",
","... | Setup RPC server for dfa agent. | [
"Setup",
"RPC",
"server",
"for",
"dfa",
"agent",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/dfa_agent.py#L163-L169 |
openstack/networking-cisco | networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper_aci.py | RoutingServiceHelperAci._add_rid_to_vrf_list | def _add_rid_to_vrf_list(self, ri):
"""Add router ID to a VRF list.
In order to properly manage VRFs in the ASR, their
usage has to be tracked. VRFs are provided with neutron
router objects in their hosting_info fields of the gateway ports.
This means that the VRF is only availa... | python | def _add_rid_to_vrf_list(self, ri):
"""Add router ID to a VRF list.
In order to properly manage VRFs in the ASR, their
usage has to be tracked. VRFs are provided with neutron
router objects in their hosting_info fields of the gateway ports.
This means that the VRF is only availa... | [
"def",
"_add_rid_to_vrf_list",
"(",
"self",
",",
"ri",
")",
":",
"if",
"ri",
".",
"ex_gw_port",
"or",
"ri",
".",
"router",
".",
"get",
"(",
"'gw_port'",
")",
":",
"driver",
"=",
"self",
".",
"driver_manager",
".",
"get_driver",
"(",
"ri",
".",
"id",
... | Add router ID to a VRF list.
In order to properly manage VRFs in the ASR, their
usage has to be tracked. VRFs are provided with neutron
router objects in their hosting_info fields of the gateway ports.
This means that the VRF is only available when the gateway port
of the router... | [
"Add",
"router",
"ID",
"to",
"a",
"VRF",
"list",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper_aci.py#L127-L147 |
openstack/networking-cisco | networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper_aci.py | RoutingServiceHelperAci._remove_rid_from_vrf_list | def _remove_rid_from_vrf_list(self, ri):
"""Remove router ID from a VRF list.
This removes a router from the list of routers that's kept
in a map, using a VRF ID as the key. If the VRF exists, the
router is removed from the list if it's present. If the last
router in the list is... | python | def _remove_rid_from_vrf_list(self, ri):
"""Remove router ID from a VRF list.
This removes a router from the list of routers that's kept
in a map, using a VRF ID as the key. If the VRF exists, the
router is removed from the list if it's present. If the last
router in the list is... | [
"def",
"_remove_rid_from_vrf_list",
"(",
"self",
",",
"ri",
")",
":",
"if",
"ri",
".",
"ex_gw_port",
"or",
"ri",
".",
"router",
".",
"get",
"(",
"'gw_port'",
")",
":",
"driver",
"=",
"self",
".",
"driver_manager",
".",
"get_driver",
"(",
"ri",
".",
"id... | Remove router ID from a VRF list.
This removes a router from the list of routers that's kept
in a map, using a VRF ID as the key. If the VRF exists, the
router is removed from the list if it's present. If the last
router in the list is removed, then the driver's method to
remove... | [
"Remove",
"router",
"ID",
"from",
"a",
"VRF",
"list",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper_aci.py#L149-L170 |
openstack/networking-cisco | networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper_aci.py | RoutingServiceHelperAci._internal_network_removed | def _internal_network_removed(self, ri, port, ex_gw_port):
"""Remove an internal router port
Check to see if this is the last port to be removed for
a given network scoped by a VRF (note: there can be
different mappings between VRFs and networks -- 1-to-1,
1-to-n, n-to-1, n-to-n... | python | def _internal_network_removed(self, ri, port, ex_gw_port):
"""Remove an internal router port
Check to see if this is the last port to be removed for
a given network scoped by a VRF (note: there can be
different mappings between VRFs and networks -- 1-to-1,
1-to-n, n-to-1, n-to-n... | [
"def",
"_internal_network_removed",
"(",
"self",
",",
"ri",
",",
"port",
",",
"ex_gw_port",
")",
":",
"itfc_deleted",
"=",
"False",
"driver",
"=",
"self",
".",
"driver_manager",
".",
"get_driver",
"(",
"ri",
".",
"id",
")",
"vrf_name",
"=",
"driver",
".",
... | Remove an internal router port
Check to see if this is the last port to be removed for
a given network scoped by a VRF (note: there can be
different mappings between VRFs and networks -- 1-to-1,
1-to-n, n-to-1, n-to-n -- depending on the configuration
and workflow used). If it i... | [
"Remove",
"an",
"internal",
"router",
"port"
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper_aci.py#L181-L221 |
openstack/networking-cisco | networking_cisco/apps/saf/dfa_cli.py | DfaCli.do_list_organizations | def do_list_organizations(self, line):
'''Get list of organization on DCNM.'''
org_list = self.dcnm_client.list_organizations()
if not org_list:
print('No organization found.')
return
org_table = PrettyTable(['Organization Name'])
for org in org_list:
... | python | def do_list_organizations(self, line):
'''Get list of organization on DCNM.'''
org_list = self.dcnm_client.list_organizations()
if not org_list:
print('No organization found.')
return
org_table = PrettyTable(['Organization Name'])
for org in org_list:
... | [
"def",
"do_list_organizations",
"(",
"self",
",",
"line",
")",
":",
"org_list",
"=",
"self",
".",
"dcnm_client",
".",
"list_organizations",
"(",
")",
"if",
"not",
"org_list",
":",
"print",
"(",
"'No organization found.'",
")",
"return",
"org_table",
"=",
"Pret... | Get list of organization on DCNM. | [
"Get",
"list",
"of",
"organization",
"on",
"DCNM",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/dfa_cli.py#L161-L173 |
openstack/networking-cisco | networking_cisco/plugins/cisco/db/l3/routertype_db.py | RoutertypeDbMixin.create_routertype | def create_routertype(self, context, routertype):
"""Creates a router type.
Also binds it to the specified hosting device template.
"""
LOG.debug("create_routertype() called. Contents %s", routertype)
rt = routertype['routertype']
with context.session.begin(subtransactio... | python | def create_routertype(self, context, routertype):
"""Creates a router type.
Also binds it to the specified hosting device template.
"""
LOG.debug("create_routertype() called. Contents %s", routertype)
rt = routertype['routertype']
with context.session.begin(subtransactio... | [
"def",
"create_routertype",
"(",
"self",
",",
"context",
",",
"routertype",
")",
":",
"LOG",
".",
"debug",
"(",
"\"create_routertype() called. Contents %s\"",
",",
"routertype",
")",
"rt",
"=",
"routertype",
"[",
"'routertype'",
"]",
"with",
"context",
".",
"ses... | Creates a router type.
Also binds it to the specified hosting device template. | [
"Creates",
"a",
"router",
"type",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/db/l3/routertype_db.py#L32-L54 |
openstack/networking-cisco | networking_cisco/neutronclient/hostingdevicescheduler.py | HostingDeviceAssociateWithConfigAgent.associate_hosting_device_with_config_agent | def associate_hosting_device_with_config_agent(
self, client, config_agent_id, body):
"""Associates a hosting_device with a config agent."""
return client.post((ConfigAgentHandlingHostingDevice.resource_path +
CFG_AGENT_HOSTING_DEVICES) % config_agent_id,
... | python | def associate_hosting_device_with_config_agent(
self, client, config_agent_id, body):
"""Associates a hosting_device with a config agent."""
return client.post((ConfigAgentHandlingHostingDevice.resource_path +
CFG_AGENT_HOSTING_DEVICES) % config_agent_id,
... | [
"def",
"associate_hosting_device_with_config_agent",
"(",
"self",
",",
"client",
",",
"config_agent_id",
",",
"body",
")",
":",
"return",
"client",
".",
"post",
"(",
"(",
"ConfigAgentHandlingHostingDevice",
".",
"resource_path",
"+",
"CFG_AGENT_HOSTING_DEVICES",
")",
... | Associates a hosting_device with a config agent. | [
"Associates",
"a",
"hosting_device",
"with",
"a",
"config",
"agent",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/neutronclient/hostingdevicescheduler.py#L70-L75 |
openstack/networking-cisco | networking_cisco/neutronclient/hostingdevicescheduler.py | HostingDeviceDisassociateFromConfigAgent.disassociate_hosting_device_with_config_agent | def disassociate_hosting_device_with_config_agent(
self, client, config_agent_id, hosting_device_id):
"""Disassociates a hosting_device with a config agent."""
return client.delete((ConfigAgentHandlingHostingDevice.resource_path +
CFG_AGENT_HOSTING_DEVICES + "/%... | python | def disassociate_hosting_device_with_config_agent(
self, client, config_agent_id, hosting_device_id):
"""Disassociates a hosting_device with a config agent."""
return client.delete((ConfigAgentHandlingHostingDevice.resource_path +
CFG_AGENT_HOSTING_DEVICES + "/%... | [
"def",
"disassociate_hosting_device_with_config_agent",
"(",
"self",
",",
"client",
",",
"config_agent_id",
",",
"hosting_device_id",
")",
":",
"return",
"client",
".",
"delete",
"(",
"(",
"ConfigAgentHandlingHostingDevice",
".",
"resource_path",
"+",
"CFG_AGENT_HOSTING_D... | Disassociates a hosting_device with a config agent. | [
"Disassociates",
"a",
"hosting_device",
"with",
"a",
"config",
"agent",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/neutronclient/hostingdevicescheduler.py#L109-L114 |
openstack/networking-cisco | networking_cisco/neutronclient/hostingdevicescheduler.py | HostingDeviceHandledByConfigAgentList.list_hosting_device_handled_by_config_agent | def list_hosting_device_handled_by_config_agent(
self, client, cfg_agent_id, **_params):
"""Fetches a list of hosting devices handled by a config agent."""
return client.get((ConfigAgentHandlingHostingDevice.resource_path +
CFG_AGENT_HOSTING_DEVICES) % cfg_agent_id... | python | def list_hosting_device_handled_by_config_agent(
self, client, cfg_agent_id, **_params):
"""Fetches a list of hosting devices handled by a config agent."""
return client.get((ConfigAgentHandlingHostingDevice.resource_path +
CFG_AGENT_HOSTING_DEVICES) % cfg_agent_id... | [
"def",
"list_hosting_device_handled_by_config_agent",
"(",
"self",
",",
"client",
",",
"cfg_agent_id",
",",
"*",
"*",
"_params",
")",
":",
"return",
"client",
".",
"get",
"(",
"(",
"ConfigAgentHandlingHostingDevice",
".",
"resource_path",
"+",
"CFG_AGENT_HOSTING_DEVIC... | Fetches a list of hosting devices handled by a config agent. | [
"Fetches",
"a",
"list",
"of",
"hosting",
"devices",
"handled",
"by",
"a",
"config",
"agent",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/neutronclient/hostingdevicescheduler.py#L135-L140 |
openstack/networking-cisco | networking_cisco/neutronclient/hostingdevicescheduler.py | ConfigAgentHandlingHostingDeviceList.list_config_agents_handling_hosting_device | def list_config_agents_handling_hosting_device(
self, client, hosting_device_id, **_params):
"""Fetches a list of config agents handling a hosting device."""
resource_path = '/dev_mgr/hosting_devices/%s'
return client.get((resource_path + HOSTING_DEVICE_CFG_AGENTS) %
... | python | def list_config_agents_handling_hosting_device(
self, client, hosting_device_id, **_params):
"""Fetches a list of config agents handling a hosting device."""
resource_path = '/dev_mgr/hosting_devices/%s'
return client.get((resource_path + HOSTING_DEVICE_CFG_AGENTS) %
... | [
"def",
"list_config_agents_handling_hosting_device",
"(",
"self",
",",
"client",
",",
"hosting_device_id",
",",
"*",
"*",
"_params",
")",
":",
"resource_path",
"=",
"'/dev_mgr/hosting_devices/%s'",
"return",
"client",
".",
"get",
"(",
"(",
"resource_path",
"+",
"HOS... | Fetches a list of config agents handling a hosting device. | [
"Fetches",
"a",
"list",
"of",
"config",
"agents",
"handling",
"a",
"hosting",
"device",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/neutronclient/hostingdevicescheduler.py#L180-L185 |
openstack/networking-cisco | networking_cisco/ml2_drivers/nexus/type_nexus_vxlan.py | NexusVxlanTypeDriver._parse_nexus_vni_range | def _parse_nexus_vni_range(self, tunnel_range):
"""Raise an exception for invalid tunnel range or malformed range."""
for ident in tunnel_range:
if not self._is_valid_nexus_vni(ident):
raise exc.NetworkTunnelRangeError(
tunnel_range=tunnel_range,
... | python | def _parse_nexus_vni_range(self, tunnel_range):
"""Raise an exception for invalid tunnel range or malformed range."""
for ident in tunnel_range:
if not self._is_valid_nexus_vni(ident):
raise exc.NetworkTunnelRangeError(
tunnel_range=tunnel_range,
... | [
"def",
"_parse_nexus_vni_range",
"(",
"self",
",",
"tunnel_range",
")",
":",
"for",
"ident",
"in",
"tunnel_range",
":",
"if",
"not",
"self",
".",
"_is_valid_nexus_vni",
"(",
"ident",
")",
":",
"raise",
"exc",
".",
"NetworkTunnelRangeError",
"(",
"tunnel_range",
... | Raise an exception for invalid tunnel range or malformed range. | [
"Raise",
"an",
"exception",
"for",
"invalid",
"tunnel",
"range",
"or",
"malformed",
"range",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/type_nexus_vxlan.py#L113-L126 |
openstack/networking-cisco | networking_cisco/ml2_drivers/nexus/type_nexus_vxlan.py | NexusVxlanTypeDriver.sync_allocations | def sync_allocations(self):
"""
Synchronize vxlan_allocations table with configured tunnel ranges.
"""
# determine current configured allocatable vnis
vxlan_vnis = set()
for tun_min, tun_max in self.tunnel_ranges:
vxlan_vnis |= set(six.moves.range(tun_min, tu... | python | def sync_allocations(self):
"""
Synchronize vxlan_allocations table with configured tunnel ranges.
"""
# determine current configured allocatable vnis
vxlan_vnis = set()
for tun_min, tun_max in self.tunnel_ranges:
vxlan_vnis |= set(six.moves.range(tun_min, tu... | [
"def",
"sync_allocations",
"(",
"self",
")",
":",
"# determine current configured allocatable vnis",
"vxlan_vnis",
"=",
"set",
"(",
")",
"for",
"tun_min",
",",
"tun_max",
"in",
"self",
".",
"tunnel_ranges",
":",
"vxlan_vnis",
"|=",
"set",
"(",
"six",
".",
"moves... | Synchronize vxlan_allocations table with configured tunnel ranges. | [
"Synchronize",
"vxlan_allocations",
"table",
"with",
"configured",
"tunnel",
"ranges",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/type_nexus_vxlan.py#L177-L218 |
openstack/networking-cisco | networking_cisco/apps/saf/server/dfa_events_handler.py | EventsHandler._setup_notification_listener | def _setup_notification_listener(self, topic_name, url):
"""Setup notification listener for a service."""
self.notify_listener = rpc.DfaNotifcationListener(
topic_name, url, rpc.DfaNotificationEndpoints(self)) | python | def _setup_notification_listener(self, topic_name, url):
"""Setup notification listener for a service."""
self.notify_listener = rpc.DfaNotifcationListener(
topic_name, url, rpc.DfaNotificationEndpoints(self)) | [
"def",
"_setup_notification_listener",
"(",
"self",
",",
"topic_name",
",",
"url",
")",
":",
"self",
".",
"notify_listener",
"=",
"rpc",
".",
"DfaNotifcationListener",
"(",
"topic_name",
",",
"url",
",",
"rpc",
".",
"DfaNotificationEndpoints",
"(",
"self",
")",
... | Setup notification listener for a service. | [
"Setup",
"notification",
"listener",
"for",
"a",
"service",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/dfa_events_handler.py#L96-L100 |
openstack/networking-cisco | networking_cisco/apps/saf/server/dfa_events_handler.py | EventsHandler.callback | def callback(self, timestamp, event_type, payload):
"""Callback method for processing events in notification queue.
:param timestamp: time the message is received.
:param event_type: event type in the notification queue such as
identity.project.created, identity.proje... | python | def callback(self, timestamp, event_type, payload):
"""Callback method for processing events in notification queue.
:param timestamp: time the message is received.
:param event_type: event type in the notification queue such as
identity.project.created, identity.proje... | [
"def",
"callback",
"(",
"self",
",",
"timestamp",
",",
"event_type",
",",
"payload",
")",
":",
"try",
":",
"data",
"=",
"(",
"event_type",
",",
"payload",
")",
"LOG",
".",
"debug",
"(",
"'RX NOTIFICATION ==>\\nevent_type: %(event)s, '",
"'payload: %(payload)s\\n'"... | Callback method for processing events in notification queue.
:param timestamp: time the message is received.
:param event_type: event type in the notification queue such as
identity.project.created, identity.project.deleted.
:param payload: Contains information of an ... | [
"Callback",
"method",
"for",
"processing",
"events",
"in",
"notification",
"queue",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/dfa_events_handler.py#L125-L150 |
openstack/networking-cisco | networking_cisco/apps/saf/server/dfa_events_handler.py | EventsHandler.event_handler | def event_handler(self):
"""Wait on queue for listening to the events."""
if not self._notify_queue:
LOG.error('event_handler: no notification queue for %s',
self._service_name)
return
LOG.debug('calling event handler for %s', self)
self.st... | python | def event_handler(self):
"""Wait on queue for listening to the events."""
if not self._notify_queue:
LOG.error('event_handler: no notification queue for %s',
self._service_name)
return
LOG.debug('calling event handler for %s', self)
self.st... | [
"def",
"event_handler",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_notify_queue",
":",
"LOG",
".",
"error",
"(",
"'event_handler: no notification queue for %s'",
",",
"self",
".",
"_service_name",
")",
"return",
"LOG",
".",
"debug",
"(",
"'calling event ... | Wait on queue for listening to the events. | [
"Wait",
"on",
"queue",
"for",
"listening",
"to",
"the",
"events",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/dfa_events_handler.py#L152-L162 |
openstack/networking-cisco | networking_cisco/plugins/cisco/cfg_agent/device_drivers/driver_mgr.py | DeviceDriverManager.set_driver | def set_driver(self, resource):
"""Set the driver for a neutron resource.
:param resource: Neutron resource in dict format.
Expected keys::
{
'id': <value>,
'hosting_device': { 'id': <value>, },
'router_type': {'cf... | python | def set_driver(self, resource):
"""Set the driver for a neutron resource.
:param resource: Neutron resource in dict format.
Expected keys::
{
'id': <value>,
'hosting_device': { 'id': <value>, },
'router_type': {'cf... | [
"def",
"set_driver",
"(",
"self",
",",
"resource",
")",
":",
"try",
":",
"resource_id",
"=",
"resource",
"[",
"'id'",
"]",
"hosting_device",
"=",
"resource",
"[",
"'hosting_device'",
"]",
"hd_id",
"=",
"hosting_device",
"[",
"'id'",
"]",
"if",
"hd_id",
"in... | Set the driver for a neutron resource.
:param resource: Neutron resource in dict format.
Expected keys::
{
'id': <value>,
'hosting_device': { 'id': <value>, },
'router_type': {'cfg_agent_driver': <value>, }
... | [
"Set",
"the",
"driver",
"for",
"a",
"neutron",
"resource",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_drivers/driver_mgr.py#L64-L111 |
openstack/networking-cisco | networking_cisco/ml2_drivers/ucsm/ucsm_network_driver.py | CiscoUcsmDriver._import_ucsmsdk | def _import_ucsmsdk(self):
"""Imports the ucsmsdk module.
This module is not installed as part of the normal Neutron
distributions. It is imported dynamically in this module so that
the import can be mocked, allowing unit testing without requiring
the installation of ucsmsdk.
... | python | def _import_ucsmsdk(self):
"""Imports the ucsmsdk module.
This module is not installed as part of the normal Neutron
distributions. It is imported dynamically in this module so that
the import can be mocked, allowing unit testing without requiring
the installation of ucsmsdk.
... | [
"def",
"_import_ucsmsdk",
"(",
"self",
")",
":",
"# Check if SSL certificate checking has been disabled.",
"# If so, warn the user before proceeding.",
"if",
"not",
"CONF",
".",
"ml2_cisco_ucsm",
".",
"ucsm_https_verify",
":",
"LOG",
".",
"warning",
"(",
"const",
".",
"SS... | Imports the ucsmsdk module.
This module is not installed as part of the normal Neutron
distributions. It is imported dynamically in this module so that
the import can be mocked, allowing unit testing without requiring
the installation of ucsmsdk. | [
"Imports",
"the",
"ucsmsdk",
"module",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/ucsm_network_driver.py#L103-L135 |
openstack/networking-cisco | networking_cisco/ml2_drivers/ucsm/ucsm_network_driver.py | CiscoUcsmDriver.ucs_manager_connect | def ucs_manager_connect(self, ucsm_ip):
"""Connects to a UCS Manager."""
if not self.ucsmsdk:
self.ucsmsdk = self._import_ucsmsdk()
ucsm = CONF.ml2_cisco_ucsm.ucsms.get(ucsm_ip)
if not ucsm or not ucsm.ucsm_username or not ucsm.ucsm_password:
LOG.error('UCS Mana... | python | def ucs_manager_connect(self, ucsm_ip):
"""Connects to a UCS Manager."""
if not self.ucsmsdk:
self.ucsmsdk = self._import_ucsmsdk()
ucsm = CONF.ml2_cisco_ucsm.ucsms.get(ucsm_ip)
if not ucsm or not ucsm.ucsm_username or not ucsm.ucsm_password:
LOG.error('UCS Mana... | [
"def",
"ucs_manager_connect",
"(",
"self",
",",
"ucsm_ip",
")",
":",
"if",
"not",
"self",
".",
"ucsmsdk",
":",
"self",
".",
"ucsmsdk",
"=",
"self",
".",
"_import_ucsmsdk",
"(",
")",
"ucsm",
"=",
"CONF",
".",
"ml2_cisco_ucsm",
".",
"ucsms",
".",
"get",
... | Connects to a UCS Manager. | [
"Connects",
"to",
"a",
"UCS",
"Manager",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/ucsm_network_driver.py#L165-L186 |
openstack/networking-cisco | networking_cisco/ml2_drivers/ucsm/ucsm_network_driver.py | CiscoUcsmDriver._create_ucsm_host_to_service_profile_mapping | def _create_ucsm_host_to_service_profile_mapping(self):
"""Reads list of Service profiles and finds associated Server."""
# Get list of UCSMs without host list given in the config
ucsm_ips = [ip for ip, ucsm in CONF.ml2_cisco_ucsm.ucsms.items()
if not ucsm.ucsm_host_list]
... | python | def _create_ucsm_host_to_service_profile_mapping(self):
"""Reads list of Service profiles and finds associated Server."""
# Get list of UCSMs without host list given in the config
ucsm_ips = [ip for ip, ucsm in CONF.ml2_cisco_ucsm.ucsms.items()
if not ucsm.ucsm_host_list]
... | [
"def",
"_create_ucsm_host_to_service_profile_mapping",
"(",
"self",
")",
":",
"# Get list of UCSMs without host list given in the config",
"ucsm_ips",
"=",
"[",
"ip",
"for",
"ip",
",",
"ucsm",
"in",
"CONF",
".",
"ml2_cisco_ucsm",
".",
"ucsms",
".",
"items",
"(",
")",
... | Reads list of Service profiles and finds associated Server. | [
"Reads",
"list",
"of",
"Service",
"profiles",
"and",
"finds",
"associated",
"Server",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/ucsm_network_driver.py#L188-L211 |
openstack/networking-cisco | networking_cisco/ml2_drivers/ucsm/ucsm_network_driver.py | CiscoUcsmDriver._create_vlanprofile | def _create_vlanprofile(self, handle, vlan_id, ucsm_ip):
"""Creates VLAN profile to able associated with the Port Profile."""
vlan_name = self.make_vlan_name(vlan_id)
vlan_profile_dest = (const.VLAN_PATH + const.VLAN_PROFILE_PATH_PREFIX +
vlan_name)
try:
... | python | def _create_vlanprofile(self, handle, vlan_id, ucsm_ip):
"""Creates VLAN profile to able associated with the Port Profile."""
vlan_name = self.make_vlan_name(vlan_id)
vlan_profile_dest = (const.VLAN_PATH + const.VLAN_PROFILE_PATH_PREFIX +
vlan_name)
try:
... | [
"def",
"_create_vlanprofile",
"(",
"self",
",",
"handle",
",",
"vlan_id",
",",
"ucsm_ip",
")",
":",
"vlan_name",
"=",
"self",
".",
"make_vlan_name",
"(",
"vlan_id",
")",
"vlan_profile_dest",
"=",
"(",
"const",
".",
"VLAN_PATH",
"+",
"const",
".",
"VLAN_PROFI... | Creates VLAN profile to able associated with the Port Profile. | [
"Creates",
"VLAN",
"profile",
"to",
"able",
"associated",
"with",
"the",
"Port",
"Profile",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/ucsm_network_driver.py#L255-L289 |
openstack/networking-cisco | networking_cisco/ml2_drivers/ucsm/ucsm_network_driver.py | CiscoUcsmDriver._create_port_profile | def _create_port_profile(self, handle, profile_name, vlan_id,
vnic_type, ucsm_ip, trunk_vlans, qos_policy):
"""Creates a Port Profile on the UCS Manager.
Significant parameters set in the port profile are:
1. Port profile name - Should match what was set in vif_deta... | python | def _create_port_profile(self, handle, profile_name, vlan_id,
vnic_type, ucsm_ip, trunk_vlans, qos_policy):
"""Creates a Port Profile on the UCS Manager.
Significant parameters set in the port profile are:
1. Port profile name - Should match what was set in vif_deta... | [
"def",
"_create_port_profile",
"(",
"self",
",",
"handle",
",",
"profile_name",
",",
"vlan_id",
",",
"vnic_type",
",",
"ucsm_ip",
",",
"trunk_vlans",
",",
"qos_policy",
")",
":",
"port_profile_dest",
"=",
"(",
"const",
".",
"PORT_PROFILESETDN",
"+",
"const",
"... | Creates a Port Profile on the UCS Manager.
Significant parameters set in the port profile are:
1. Port profile name - Should match what was set in vif_details
2. High performance mode - For VM-FEX to be enabled/configured on
the port using this port profile, this mode should be enabled.... | [
"Creates",
"a",
"Port",
"Profile",
"on",
"the",
"UCS",
"Manager",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/ucsm_network_driver.py#L291-L414 |
openstack/networking-cisco | networking_cisco/ml2_drivers/ucsm/ucsm_network_driver.py | CiscoUcsmDriver._update_service_profile | def _update_service_profile(self, handle, service_profile,
vlan_id, ucsm_ip):
"""Updates Service Profile on the UCS Manager.
Each of the ethernet ports on the Service Profile representing
the UCS Server, is updated with the VLAN profile corresponding
to t... | python | def _update_service_profile(self, handle, service_profile,
vlan_id, ucsm_ip):
"""Updates Service Profile on the UCS Manager.
Each of the ethernet ports on the Service Profile representing
the UCS Server, is updated with the VLAN profile corresponding
to t... | [
"def",
"_update_service_profile",
"(",
"self",
",",
"handle",
",",
"service_profile",
",",
"vlan_id",
",",
"ucsm_ip",
")",
":",
"virtio_port_list",
"=",
"(",
"CONF",
".",
"ml2_cisco_ucsm",
".",
"ucsms",
"[",
"ucsm_ip",
"]",
".",
"ucsm_virtio_eth_ports",
")",
"... | Updates Service Profile on the UCS Manager.
Each of the ethernet ports on the Service Profile representing
the UCS Server, is updated with the VLAN profile corresponding
to the vlan_id passed in. | [
"Updates",
"Service",
"Profile",
"on",
"the",
"UCS",
"Manager",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/ucsm_network_driver.py#L460-L510 |
openstack/networking-cisco | networking_cisco/ml2_drivers/ucsm/ucsm_network_driver.py | CiscoUcsmDriver.update_vnic_template | def update_vnic_template(self, host_id, vlan_id, physnet,
vnic_template_path, vnic_template):
"""Updates VNIC Template with the vlan_id."""
ucsm_ip = self.get_ucsm_ip_for_host(host_id)
if not ucsm_ip:
LOG.info('UCS Manager network driver does not have UCSM IP '
... | python | def update_vnic_template(self, host_id, vlan_id, physnet,
vnic_template_path, vnic_template):
"""Updates VNIC Template with the vlan_id."""
ucsm_ip = self.get_ucsm_ip_for_host(host_id)
if not ucsm_ip:
LOG.info('UCS Manager network driver does not have UCSM IP '
... | [
"def",
"update_vnic_template",
"(",
"self",
",",
"host_id",
",",
"vlan_id",
",",
"physnet",
",",
"vnic_template_path",
",",
"vnic_template",
")",
":",
"ucsm_ip",
"=",
"self",
".",
"get_ucsm_ip_for_host",
"(",
"host_id",
")",
"if",
"not",
"ucsm_ip",
":",
"LOG",... | Updates VNIC Template with the vlan_id. | [
"Updates",
"VNIC",
"Template",
"with",
"the",
"vlan_id",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/ucsm_network_driver.py#L612-L666 |
openstack/networking-cisco | networking_cisco/ml2_drivers/ucsm/ucsm_network_driver.py | CiscoUcsmDriver._delete_vlan_profile | def _delete_vlan_profile(self, handle, vlan_id, ucsm_ip):
"""Deletes VLAN Profile from UCS Manager."""
vlan_name = self.make_vlan_name(vlan_id)
vlan_profile_dest = (const.VLAN_PATH + const.VLAN_PROFILE_PATH_PREFIX +
vlan_name)
try:
obj = handle.qu... | python | def _delete_vlan_profile(self, handle, vlan_id, ucsm_ip):
"""Deletes VLAN Profile from UCS Manager."""
vlan_name = self.make_vlan_name(vlan_id)
vlan_profile_dest = (const.VLAN_PATH + const.VLAN_PROFILE_PATH_PREFIX +
vlan_name)
try:
obj = handle.qu... | [
"def",
"_delete_vlan_profile",
"(",
"self",
",",
"handle",
",",
"vlan_id",
",",
"ucsm_ip",
")",
":",
"vlan_name",
"=",
"self",
".",
"make_vlan_name",
"(",
"vlan_id",
")",
"vlan_profile_dest",
"=",
"(",
"const",
".",
"VLAN_PATH",
"+",
"const",
".",
"VLAN_PROF... | Deletes VLAN Profile from UCS Manager. | [
"Deletes",
"VLAN",
"Profile",
"from",
"UCS",
"Manager",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/ucsm_network_driver.py#L668-L685 |
openstack/networking-cisco | networking_cisco/ml2_drivers/ucsm/ucsm_network_driver.py | CiscoUcsmDriver._delete_port_profile_from_ucsm | def _delete_port_profile_from_ucsm(self, handle, port_profile, ucsm_ip):
"""Deletes Port Profile from UCS Manager."""
port_profile_dest = (const.PORT_PROFILESETDN + const.VNIC_PATH_PREFIX +
port_profile)
# Find port profile on the UCS Manager
p_profile = han... | python | def _delete_port_profile_from_ucsm(self, handle, port_profile, ucsm_ip):
"""Deletes Port Profile from UCS Manager."""
port_profile_dest = (const.PORT_PROFILESETDN + const.VNIC_PATH_PREFIX +
port_profile)
# Find port profile on the UCS Manager
p_profile = han... | [
"def",
"_delete_port_profile_from_ucsm",
"(",
"self",
",",
"handle",
",",
"port_profile",
",",
"ucsm_ip",
")",
":",
"port_profile_dest",
"=",
"(",
"const",
".",
"PORT_PROFILESETDN",
"+",
"const",
".",
"VNIC_PATH_PREFIX",
"+",
"port_profile",
")",
"# Find port profil... | Deletes Port Profile from UCS Manager. | [
"Deletes",
"Port",
"Profile",
"from",
"UCS",
"Manager",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/ucsm_network_driver.py#L714-L729 |
openstack/networking-cisco | networking_cisco/ml2_drivers/ucsm/ucsm_network_driver.py | CiscoUcsmDriver._remove_vlan_from_all_service_profiles | def _remove_vlan_from_all_service_profiles(self, handle, vlan_id, ucsm_ip):
"""Deletes VLAN Profile config from server's ethernet ports."""
service_profile_list = []
for key, value in six.iteritems(self.ucsm_sp_dict):
if (ucsm_ip in key) and value:
service_profile_lis... | python | def _remove_vlan_from_all_service_profiles(self, handle, vlan_id, ucsm_ip):
"""Deletes VLAN Profile config from server's ethernet ports."""
service_profile_list = []
for key, value in six.iteritems(self.ucsm_sp_dict):
if (ucsm_ip in key) and value:
service_profile_lis... | [
"def",
"_remove_vlan_from_all_service_profiles",
"(",
"self",
",",
"handle",
",",
"vlan_id",
",",
"ucsm_ip",
")",
":",
"service_profile_list",
"=",
"[",
"]",
"for",
"key",
",",
"value",
"in",
"six",
".",
"iteritems",
"(",
"self",
".",
"ucsm_sp_dict",
")",
":... | Deletes VLAN Profile config from server's ethernet ports. | [
"Deletes",
"VLAN",
"Profile",
"config",
"from",
"server",
"s",
"ethernet",
"ports",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/ucsm_network_driver.py#L747-L790 |
openstack/networking-cisco | networking_cisco/ml2_drivers/ucsm/ucsm_network_driver.py | CiscoUcsmDriver._remove_vlan_from_all_sp_templates | def _remove_vlan_from_all_sp_templates(self, handle, vlan_id, ucsm_ip):
"""Deletes VLAN config from all SP Templates that have it."""
sp_template_info_list = (
CONF.ml2_cisco_ucsm.ucsms[ucsm_ip].sp_template_list.values())
vlan_name = self.make_vlan_name(vlan_id)
virtio_port_... | python | def _remove_vlan_from_all_sp_templates(self, handle, vlan_id, ucsm_ip):
"""Deletes VLAN config from all SP Templates that have it."""
sp_template_info_list = (
CONF.ml2_cisco_ucsm.ucsms[ucsm_ip].sp_template_list.values())
vlan_name = self.make_vlan_name(vlan_id)
virtio_port_... | [
"def",
"_remove_vlan_from_all_sp_templates",
"(",
"self",
",",
"handle",
",",
"vlan_id",
",",
"ucsm_ip",
")",
":",
"sp_template_info_list",
"=",
"(",
"CONF",
".",
"ml2_cisco_ucsm",
".",
"ucsms",
"[",
"ucsm_ip",
"]",
".",
"sp_template_list",
".",
"values",
"(",
... | Deletes VLAN config from all SP Templates that have it. | [
"Deletes",
"VLAN",
"config",
"from",
"all",
"SP",
"Templates",
"that",
"have",
"it",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/ucsm_network_driver.py#L792-L844 |
openstack/networking-cisco | networking_cisco/ml2_drivers/ucsm/ucsm_network_driver.py | CiscoUcsmDriver._remove_vlan_from_vnic_templates | def _remove_vlan_from_vnic_templates(self, handle, vlan_id, ucsm_ip):
"""Removes VLAN from all VNIC templates that have it enabled."""
ucsm = CONF.ml2_cisco_ucsm.ucsms[ucsm_ip]
vnic_template_info = ucsm.vnic_template_list.values()
vlan_name = self.make_vlan_name(vlan_id)
if not... | python | def _remove_vlan_from_vnic_templates(self, handle, vlan_id, ucsm_ip):
"""Removes VLAN from all VNIC templates that have it enabled."""
ucsm = CONF.ml2_cisco_ucsm.ucsms[ucsm_ip]
vnic_template_info = ucsm.vnic_template_list.values()
vlan_name = self.make_vlan_name(vlan_id)
if not... | [
"def",
"_remove_vlan_from_vnic_templates",
"(",
"self",
",",
"handle",
",",
"vlan_id",
",",
"ucsm_ip",
")",
":",
"ucsm",
"=",
"CONF",
".",
"ml2_cisco_ucsm",
".",
"ucsms",
"[",
"ucsm_ip",
"]",
"vnic_template_info",
"=",
"ucsm",
".",
"vnic_template_list",
".",
"... | Removes VLAN from all VNIC templates that have it enabled. | [
"Removes",
"VLAN",
"from",
"all",
"VNIC",
"templates",
"that",
"have",
"it",
"enabled",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/ucsm_network_driver.py#L846-L890 |
openstack/networking-cisco | networking_cisco/plugins/cisco/device_manager/service_vm_lib.py | ServiceVMManager.nova_services_up | def nova_services_up(self):
"""Checks if required Nova services are up and running.
returns: True if all needed Nova services are up, False otherwise
"""
required = set(['nova-conductor', 'nova-cert', 'nova-scheduler',
'nova-compute'])
try:
ser... | python | def nova_services_up(self):
"""Checks if required Nova services are up and running.
returns: True if all needed Nova services are up, False otherwise
"""
required = set(['nova-conductor', 'nova-cert', 'nova-scheduler',
'nova-compute'])
try:
ser... | [
"def",
"nova_services_up",
"(",
"self",
")",
":",
"required",
"=",
"set",
"(",
"[",
"'nova-conductor'",
",",
"'nova-cert'",
",",
"'nova-scheduler'",
",",
"'nova-compute'",
"]",
")",
"try",
":",
"services",
"=",
"self",
".",
"_nclient",
".",
"services",
".",
... | Checks if required Nova services are up and running.
returns: True if all needed Nova services are up, False otherwise | [
"Checks",
"if",
"required",
"Nova",
"services",
"are",
"up",
"and",
"running",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/device_manager/service_vm_lib.py#L62-L78 |
openstack/networking-cisco | networking_cisco/plugins/cisco/l3/schedulers/l3_routertype_aware_agent_scheduler.py | L3RouterTypeAwareScheduler._get_unscheduled_routers | def _get_unscheduled_routers(self, plugin, context):
"""Get routers with no agent binding."""
if NEUTRON_VERSION.version[0] <= NEUTRON_NEWTON_VERSION.version[0]:
context, plugin = plugin, context
# TODO(gongysh) consider the disabled agent's router
no_agent_binding = ~sql.exi... | python | def _get_unscheduled_routers(self, plugin, context):
"""Get routers with no agent binding."""
if NEUTRON_VERSION.version[0] <= NEUTRON_NEWTON_VERSION.version[0]:
context, plugin = plugin, context
# TODO(gongysh) consider the disabled agent's router
no_agent_binding = ~sql.exi... | [
"def",
"_get_unscheduled_routers",
"(",
"self",
",",
"plugin",
",",
"context",
")",
":",
"if",
"NEUTRON_VERSION",
".",
"version",
"[",
"0",
"]",
"<=",
"NEUTRON_NEWTON_VERSION",
".",
"version",
"[",
"0",
"]",
":",
"context",
",",
"plugin",
"=",
"plugin",
",... | Get routers with no agent binding. | [
"Get",
"routers",
"with",
"no",
"agent",
"binding",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/l3/schedulers/l3_routertype_aware_agent_scheduler.py#L38-L56 |
openstack/networking-cisco | networking_cisco/plugins/cisco/l3/schedulers/l3_routertype_aware_agent_scheduler.py | L3RouterTypeAwareScheduler._filter_unscheduled_routers | def _filter_unscheduled_routers(self, plugin, context, routers):
"""Filter from list of routers the ones that are not scheduled.
Only for release < pike.
"""
if NEUTRON_VERSION.version[0] <= NEUTRON_NEWTON_VERSION.version[0]:
context, plugin = plugin, context
unsc... | python | def _filter_unscheduled_routers(self, plugin, context, routers):
"""Filter from list of routers the ones that are not scheduled.
Only for release < pike.
"""
if NEUTRON_VERSION.version[0] <= NEUTRON_NEWTON_VERSION.version[0]:
context, plugin = plugin, context
unsc... | [
"def",
"_filter_unscheduled_routers",
"(",
"self",
",",
"plugin",
",",
"context",
",",
"routers",
")",
":",
"if",
"NEUTRON_VERSION",
".",
"version",
"[",
"0",
"]",
"<=",
"NEUTRON_NEWTON_VERSION",
".",
"version",
"[",
"0",
"]",
":",
"context",
",",
"plugin",
... | Filter from list of routers the ones that are not scheduled.
Only for release < pike. | [
"Filter",
"from",
"list",
"of",
"routers",
"the",
"ones",
"that",
"are",
"not",
"scheduled",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/l3/schedulers/l3_routertype_aware_agent_scheduler.py#L58-L80 |
openstack/networking-cisco | networking_cisco/plugins/cisco/l3/schedulers/l3_routertype_aware_agent_scheduler.py | L3RouterTypeAwareScheduler._get_underscheduled_routers | def _get_underscheduled_routers(self, plugin, context):
"""For release >= pike."""
underscheduled_routers = []
max_agents_for_ha = plugin.get_number_of_agents_for_scheduling(context)
for router, count in plugin.get_routers_l3_agents_count(context):
if (router[routertype.TYPE... | python | def _get_underscheduled_routers(self, plugin, context):
"""For release >= pike."""
underscheduled_routers = []
max_agents_for_ha = plugin.get_number_of_agents_for_scheduling(context)
for router, count in plugin.get_routers_l3_agents_count(context):
if (router[routertype.TYPE... | [
"def",
"_get_underscheduled_routers",
"(",
"self",
",",
"plugin",
",",
"context",
")",
":",
"underscheduled_routers",
"=",
"[",
"]",
"max_agents_for_ha",
"=",
"plugin",
".",
"get_number_of_agents_for_scheduling",
"(",
"context",
")",
"for",
"router",
",",
"count",
... | For release >= pike. | [
"For",
"release",
">",
"=",
"pike",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/l3/schedulers/l3_routertype_aware_agent_scheduler.py#L82-L99 |
openstack/networking-cisco | networking_cisco/plugins/cisco/device_manager/scheduler/hosting_device_cfg_agent_scheduler.py | HostingDeviceCfgAgentScheduler.auto_schedule_hosting_devices | def auto_schedule_hosting_devices(self, plugin, context, agent_host):
"""Schedules unassociated hosting devices to Cisco cfg agent.
Schedules hosting devices to agent running on <agent_host>.
"""
query = context.session.query(bc.Agent)
query = query.filter_by(agent_type=c_consta... | python | def auto_schedule_hosting_devices(self, plugin, context, agent_host):
"""Schedules unassociated hosting devices to Cisco cfg agent.
Schedules hosting devices to agent running on <agent_host>.
"""
query = context.session.query(bc.Agent)
query = query.filter_by(agent_type=c_consta... | [
"def",
"auto_schedule_hosting_devices",
"(",
"self",
",",
"plugin",
",",
"context",
",",
"agent_host",
")",
":",
"query",
"=",
"context",
".",
"session",
".",
"query",
"(",
"bc",
".",
"Agent",
")",
"query",
"=",
"query",
".",
"filter_by",
"(",
"agent_type"... | Schedules unassociated hosting devices to Cisco cfg agent.
Schedules hosting devices to agent running on <agent_host>. | [
"Schedules",
"unassociated",
"hosting",
"devices",
"to",
"Cisco",
"cfg",
"agent",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/device_manager/scheduler/hosting_device_cfg_agent_scheduler.py#L37-L54 |
openstack/networking-cisco | networking_cisco/plugins/cisco/device_manager/scheduler/hosting_device_cfg_agent_scheduler.py | HostingDeviceCfgAgentScheduler.schedule_hosting_device | def schedule_hosting_device(self, plugin, context, hosting_device):
"""Selects Cisco cfg agent that will configure <hosting_device>."""
active_cfg_agents = plugin.get_cfg_agents(context, active=True)
if not active_cfg_agents:
LOG.warning('There are no active Cisco cfg agents')
... | python | def schedule_hosting_device(self, plugin, context, hosting_device):
"""Selects Cisco cfg agent that will configure <hosting_device>."""
active_cfg_agents = plugin.get_cfg_agents(context, active=True)
if not active_cfg_agents:
LOG.warning('There are no active Cisco cfg agents')
... | [
"def",
"schedule_hosting_device",
"(",
"self",
",",
"plugin",
",",
"context",
",",
"hosting_device",
")",
":",
"active_cfg_agents",
"=",
"plugin",
".",
"get_cfg_agents",
"(",
"context",
",",
"active",
"=",
"True",
")",
"if",
"not",
"active_cfg_agents",
":",
"L... | Selects Cisco cfg agent that will configure <hosting_device>. | [
"Selects",
"Cisco",
"cfg",
"agent",
"that",
"will",
"configure",
"<hosting_device",
">",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/device_manager/scheduler/hosting_device_cfg_agent_scheduler.py#L56-L67 |
openstack/networking-cisco | networking_cisco/plugins/cisco/device_manager/plugging_drivers/aci_vlan_trunking_driver.py | AciVLANTrunkingPlugDriver._get_external_network_dict | def _get_external_network_dict(self, context, port_db):
"""Get external network information
Get the information about the external network,
so that it can be used to create the hidden port,
subnet, and network.
"""
if port_db.device_owner == DEVICE_OWNER_ROUTER_GW:
... | python | def _get_external_network_dict(self, context, port_db):
"""Get external network information
Get the information about the external network,
so that it can be used to create the hidden port,
subnet, and network.
"""
if port_db.device_owner == DEVICE_OWNER_ROUTER_GW:
... | [
"def",
"_get_external_network_dict",
"(",
"self",
",",
"context",
",",
"port_db",
")",
":",
"if",
"port_db",
".",
"device_owner",
"==",
"DEVICE_OWNER_ROUTER_GW",
":",
"network",
"=",
"self",
".",
"_core_plugin",
".",
"get_network",
"(",
"context",
",",
"port_db"... | Get external network information
Get the information about the external network,
so that it can be used to create the hidden port,
subnet, and network. | [
"Get",
"external",
"network",
"information"
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/device_manager/plugging_drivers/aci_vlan_trunking_driver.py#L148-L174 |
openstack/networking-cisco | networking_cisco/plugins/cisco/device_manager/plugging_drivers/aci_vlan_trunking_driver.py | AciVLANTrunkingPlugDriver.apic_driver | def apic_driver(self):
"""Get APIC driver
There are different drivers for the GBP workflow
and Neutron workflow for APIC. First see if the GBP
workflow is active, and if so get the APIC driver for it.
If the GBP service isn't installed, try to get the driver
from the Neu... | python | def apic_driver(self):
"""Get APIC driver
There are different drivers for the GBP workflow
and Neutron workflow for APIC. First see if the GBP
workflow is active, and if so get the APIC driver for it.
If the GBP service isn't installed, try to get the driver
from the Neu... | [
"def",
"apic_driver",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_apic_driver",
":",
"try",
":",
"self",
".",
"_apic_driver",
"=",
"(",
"bc",
".",
"get_plugin",
"(",
"'GROUP_POLICY'",
")",
".",
"policy_driver_manager",
".",
"policy_drivers",
"[",
"'... | Get APIC driver
There are different drivers for the GBP workflow
and Neutron workflow for APIC. First see if the GBP
workflow is active, and if so get the APIC driver for it.
If the GBP service isn't installed, try to get the driver
from the Neutron (APIC ML2) workflow. | [
"Get",
"APIC",
"driver"
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/device_manager/plugging_drivers/aci_vlan_trunking_driver.py#L183-L213 |
openstack/networking-cisco | networking_cisco/plugins/cisco/device_manager/plugging_drivers/aci_vlan_trunking_driver.py | AciVLANTrunkingPlugDriver._snat_subnet_for_ext_net | def _snat_subnet_for_ext_net(self, context, subnet, net):
"""Determine if an SNAT subnet is for this external network.
This method determines if a given SNAT subnet is intended for
the passed external network.
For APIC ML2/Neutron workflow, SNAT subnets are created on
a separat... | python | def _snat_subnet_for_ext_net(self, context, subnet, net):
"""Determine if an SNAT subnet is for this external network.
This method determines if a given SNAT subnet is intended for
the passed external network.
For APIC ML2/Neutron workflow, SNAT subnets are created on
a separat... | [
"def",
"_snat_subnet_for_ext_net",
"(",
"self",
",",
"context",
",",
"subnet",
",",
"net",
")",
":",
"if",
"subnet",
"[",
"'network_id'",
"]",
"==",
"net",
"[",
"'id'",
"]",
":",
"return",
"True",
"network",
"=",
"self",
".",
"_core_plugin",
".",
"get_ne... | Determine if an SNAT subnet is for this external network.
This method determines if a given SNAT subnet is intended for
the passed external network.
For APIC ML2/Neutron workflow, SNAT subnets are created on
a separate network from the external network. The association
with an ... | [
"Determine",
"if",
"an",
"SNAT",
"subnet",
"is",
"for",
"this",
"external",
"network",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/device_manager/plugging_drivers/aci_vlan_trunking_driver.py#L215-L238 |
openstack/networking-cisco | networking_cisco/plugins/cisco/device_manager/plugging_drivers/aci_vlan_trunking_driver.py | AciVLANTrunkingPlugDriver.extend_hosting_port_info | def extend_hosting_port_info(self, context, port_db, hosting_device,
hosting_info):
"""Get the segmenetation ID and interface
This extends the hosting info attribute with the segmentation ID
and physical interface used on the external router to connect to
... | python | def extend_hosting_port_info(self, context, port_db, hosting_device,
hosting_info):
"""Get the segmenetation ID and interface
This extends the hosting info attribute with the segmentation ID
and physical interface used on the external router to connect to
... | [
"def",
"extend_hosting_port_info",
"(",
"self",
",",
"context",
",",
"port_db",
",",
"hosting_device",
",",
"hosting_info",
")",
":",
"if",
"hosting_info",
".",
"get",
"(",
"'segmentation_id'",
")",
"is",
"None",
":",
"LOG",
".",
"debug",
"(",
"'No segmentatio... | Get the segmenetation ID and interface
This extends the hosting info attribute with the segmentation ID
and physical interface used on the external router to connect to
the ACI fabric. The segmentation ID should have been set already
by the call to allocate_hosting_port, but if it's not... | [
"Get",
"the",
"segmenetation",
"ID",
"and",
"interface"
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/device_manager/plugging_drivers/aci_vlan_trunking_driver.py#L258-L295 |
openstack/networking-cisco | networking_cisco/plugins/cisco/device_manager/plugging_drivers/aci_vlan_trunking_driver.py | AciVLANTrunkingPlugDriver.allocate_hosting_port | def allocate_hosting_port(self, context, router_id, port_db, network_type,
hosting_device_id):
"""Get the VLAN and port for this hosting device
The VLAN used between the APIC and the external router is stored
by the APIC driver. This calls into the APIC driver to ... | python | def allocate_hosting_port(self, context, router_id, port_db, network_type,
hosting_device_id):
"""Get the VLAN and port for this hosting device
The VLAN used between the APIC and the external router is stored
by the APIC driver. This calls into the APIC driver to ... | [
"def",
"allocate_hosting_port",
"(",
"self",
",",
"context",
",",
"router_id",
",",
"port_db",
",",
"network_type",
",",
"hosting_device_id",
")",
":",
"# If this is a router interface, the VLAN comes from APIC.",
"# If it's the gateway, the VLAN comes from the segment ID",
"if",... | Get the VLAN and port for this hosting device
The VLAN used between the APIC and the external router is stored
by the APIC driver. This calls into the APIC driver to first get
the ACI VRF information associated with this port, then uses that
to look up the VLAN to use for this port to ... | [
"Get",
"the",
"VLAN",
"and",
"port",
"for",
"this",
"hosting",
"device"
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/device_manager/plugging_drivers/aci_vlan_trunking_driver.py#L297-L362 |
openstack/networking-cisco | networking_cisco/plugins/cisco/device_manager/plugging_drivers/aci_vlan_trunking_driver.py | AciVLANTrunkingPlugDriver._get_ext_net_name_gbp | def _get_ext_net_name_gbp(self, network_name):
"""Get the external network name
The name of the external network used in the APIC
configuration file can be different from the name
of the external network in Neutron, especially using
the GBP workflow
"""
prefix = ... | python | def _get_ext_net_name_gbp(self, network_name):
"""Get the external network name
The name of the external network used in the APIC
configuration file can be different from the name
of the external network in Neutron, especially using
the GBP workflow
"""
prefix = ... | [
"def",
"_get_ext_net_name_gbp",
"(",
"self",
",",
"network_name",
")",
":",
"prefix",
"=",
"network_name",
"[",
":",
"re",
".",
"search",
"(",
"UUID_REGEX",
",",
"network_name",
")",
".",
"start",
"(",
")",
"-",
"1",
"]",
"return",
"prefix",
".",
"strip"... | Get the external network name
The name of the external network used in the APIC
configuration file can be different from the name
of the external network in Neutron, especially using
the GBP workflow | [
"Get",
"the",
"external",
"network",
"name"
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/device_manager/plugging_drivers/aci_vlan_trunking_driver.py#L365-L374 |
openstack/networking-cisco | networking_cisco/apps/saf/common/utils.py | is_valid_mac | def is_valid_mac(addr):
"""Check the syntax of a given mac address.
The acceptable format is xx:xx:xx:xx:xx:xx
"""
addrs = addr.split(':')
if len(addrs) != 6:
return False
for m in addrs:
try:
if int(m, 16) > 255:
return False
except ValueErro... | python | def is_valid_mac(addr):
"""Check the syntax of a given mac address.
The acceptable format is xx:xx:xx:xx:xx:xx
"""
addrs = addr.split(':')
if len(addrs) != 6:
return False
for m in addrs:
try:
if int(m, 16) > 255:
return False
except ValueErro... | [
"def",
"is_valid_mac",
"(",
"addr",
")",
":",
"addrs",
"=",
"addr",
".",
"split",
"(",
"':'",
")",
"if",
"len",
"(",
"addrs",
")",
"!=",
"6",
":",
"return",
"False",
"for",
"m",
"in",
"addrs",
":",
"try",
":",
"if",
"int",
"(",
"m",
",",
"16",
... | Check the syntax of a given mac address.
The acceptable format is xx:xx:xx:xx:xx:xx | [
"Check",
"the",
"syntax",
"of",
"a",
"given",
"mac",
"address",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/common/utils.py#L144-L158 |
openstack/networking-cisco | networking_cisco/apps/saf/common/utils.py | make_cidr | def make_cidr(gw, mask):
"""Create network address in CIDR format.
Return network address for a given gateway address and netmask.
"""
try:
int_mask = (0xFFFFFFFF << (32 - int(mask))) & 0xFFFFFFFF
gw_addr_int = struct.unpack('>L', socket.inet_aton(gw))[0] & int_mask
return (sock... | python | def make_cidr(gw, mask):
"""Create network address in CIDR format.
Return network address for a given gateway address and netmask.
"""
try:
int_mask = (0xFFFFFFFF << (32 - int(mask))) & 0xFFFFFFFF
gw_addr_int = struct.unpack('>L', socket.inet_aton(gw))[0] & int_mask
return (sock... | [
"def",
"make_cidr",
"(",
"gw",
",",
"mask",
")",
":",
"try",
":",
"int_mask",
"=",
"(",
"0xFFFFFFFF",
"<<",
"(",
"32",
"-",
"int",
"(",
"mask",
")",
")",
")",
"&",
"0xFFFFFFFF",
"gw_addr_int",
"=",
"struct",
".",
"unpack",
"(",
"'>L'",
",",
"socket... | Create network address in CIDR format.
Return network address for a given gateway address and netmask. | [
"Create",
"network",
"address",
"in",
"CIDR",
"format",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/common/utils.py#L161-L172 |
openstack/networking-cisco | networking_cisco/apps/saf/common/utils.py | find_agent_host_id | def find_agent_host_id(this_host):
"""Returns the neutron agent host id for RHEL-OSP6 HA setup."""
host_id = this_host
try:
for root, dirs, files in os.walk('/run/resource-agents'):
for fi in files:
if 'neutron-scale-' in fi:
host_id = 'neutron-n-' + ... | python | def find_agent_host_id(this_host):
"""Returns the neutron agent host id for RHEL-OSP6 HA setup."""
host_id = this_host
try:
for root, dirs, files in os.walk('/run/resource-agents'):
for fi in files:
if 'neutron-scale-' in fi:
host_id = 'neutron-n-' + ... | [
"def",
"find_agent_host_id",
"(",
"this_host",
")",
":",
"host_id",
"=",
"this_host",
"try",
":",
"for",
"root",
",",
"dirs",
",",
"files",
"in",
"os",
".",
"walk",
"(",
"'/run/resource-agents'",
")",
":",
"for",
"fi",
"in",
"files",
":",
"if",
"'neutron... | Returns the neutron agent host id for RHEL-OSP6 HA setup. | [
"Returns",
"the",
"neutron",
"agent",
"host",
"id",
"for",
"RHEL",
"-",
"OSP6",
"HA",
"setup",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/common/utils.py#L175-L187 |
openstack/networking-cisco | networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py | CiscoNexusRestapiDriver._build_credentials | def _build_credentials(self, nexus_switches):
"""Build credential table for Rest API Client.
:param nexus_switches: switch config
:returns credentials: switch credentials list
"""
credentials = {}
for switch_ip, attrs in nexus_switches.items():
credentials[sw... | python | def _build_credentials(self, nexus_switches):
"""Build credential table for Rest API Client.
:param nexus_switches: switch config
:returns credentials: switch credentials list
"""
credentials = {}
for switch_ip, attrs in nexus_switches.items():
credentials[sw... | [
"def",
"_build_credentials",
"(",
"self",
",",
"nexus_switches",
")",
":",
"credentials",
"=",
"{",
"}",
"for",
"switch_ip",
",",
"attrs",
"in",
"nexus_switches",
".",
"items",
"(",
")",
":",
"credentials",
"[",
"switch_ip",
"]",
"=",
"(",
"attrs",
"[",
... | Build credential table for Rest API Client.
:param nexus_switches: switch config
:returns credentials: switch credentials list | [
"Build",
"credential",
"table",
"for",
"Rest",
"API",
"Client",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py#L76-L93 |
openstack/networking-cisco | networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py | CiscoNexusRestapiDriver.capture_and_print_timeshot | def capture_and_print_timeshot(self, start_time, which,
other=99, switch="x.x.x.x"):
"""Determine delta, keep track, and print results."""
curr_timeout = time.time() - start_time
if which in self.time_stats:
self.time_stats[which]["total_time"] += ... | python | def capture_and_print_timeshot(self, start_time, which,
other=99, switch="x.x.x.x"):
"""Determine delta, keep track, and print results."""
curr_timeout = time.time() - start_time
if which in self.time_stats:
self.time_stats[which]["total_time"] += ... | [
"def",
"capture_and_print_timeshot",
"(",
"self",
",",
"start_time",
",",
"which",
",",
"other",
"=",
"99",
",",
"switch",
"=",
"\"x.x.x.x\"",
")",
":",
"curr_timeout",
"=",
"time",
".",
"time",
"(",
")",
"-",
"start_time",
"if",
"which",
"in",
"self",
"... | Determine delta, keep track, and print results. | [
"Determine",
"delta",
"keep",
"track",
"and",
"print",
"results",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py#L117-L148 |
openstack/networking-cisco | networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py | CiscoNexusRestapiDriver.get_interface_switch | def get_interface_switch(self, nexus_host,
intf_type, interface):
"""Get the interface data from host.
:param nexus_host: IP address of Nexus switch
:param intf_type: String which specifies interface type.
example: ethernet
:param... | python | def get_interface_switch(self, nexus_host,
intf_type, interface):
"""Get the interface data from host.
:param nexus_host: IP address of Nexus switch
:param intf_type: String which specifies interface type.
example: ethernet
:param... | [
"def",
"get_interface_switch",
"(",
"self",
",",
"nexus_host",
",",
"intf_type",
",",
"interface",
")",
":",
"if",
"intf_type",
"==",
"\"ethernet\"",
":",
"path_interface",
"=",
"\"phys-[eth\"",
"+",
"interface",
"+",
"\"]\"",
"else",
":",
"path_interface",
"=",... | Get the interface data from host.
:param nexus_host: IP address of Nexus switch
:param intf_type: String which specifies interface type.
example: ethernet
:param interface: String indicating which interface.
example: 1/19
:returns ... | [
"Get",
"the",
"interface",
"data",
"from",
"host",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py#L150-L175 |
openstack/networking-cisco | networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py | CiscoNexusRestapiDriver._get_interface_switch_trunk_present | def _get_interface_switch_trunk_present(
self, nexus_host, intf_type, interface):
"""Check if 'switchport trunk' configs present.
:param nexus_host: IP address of Nexus switch
:param intf_type: String which specifies interface type.
example: ethernet
... | python | def _get_interface_switch_trunk_present(
self, nexus_host, intf_type, interface):
"""Check if 'switchport trunk' configs present.
:param nexus_host: IP address of Nexus switch
:param intf_type: String which specifies interface type.
example: ethernet
... | [
"def",
"_get_interface_switch_trunk_present",
"(",
"self",
",",
"nexus_host",
",",
"intf_type",
",",
"interface",
")",
":",
"result",
"=",
"self",
".",
"get_interface_switch",
"(",
"nexus_host",
",",
"intf_type",
",",
"interface",
")",
"if_type",
"=",
"'l1PhysIf'"... | Check if 'switchport trunk' configs present.
:param nexus_host: IP address of Nexus switch
:param intf_type: String which specifies interface type.
example: ethernet
:param interface: String indicating which interface.
example: 1... | [
"Check",
"if",
"switchport",
"trunk",
"configs",
"present",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py#L177-L208 |
openstack/networking-cisco | networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py | CiscoNexusRestapiDriver.add_ch_grp_to_interface | def add_ch_grp_to_interface(
self, nexus_host, if_type, port, ch_grp):
"""Applies channel-group n to ethernet interface."""
if if_type != "ethernet":
LOG.error("Unexpected interface type %(iftype)s when "
"adding change group", {'iftype': if_type})
... | python | def add_ch_grp_to_interface(
self, nexus_host, if_type, port, ch_grp):
"""Applies channel-group n to ethernet interface."""
if if_type != "ethernet":
LOG.error("Unexpected interface type %(iftype)s when "
"adding change group", {'iftype': if_type})
... | [
"def",
"add_ch_grp_to_interface",
"(",
"self",
",",
"nexus_host",
",",
"if_type",
",",
"port",
",",
"ch_grp",
")",
":",
"if",
"if_type",
"!=",
"\"ethernet\"",
":",
"LOG",
".",
"error",
"(",
"\"Unexpected interface type %(iftype)s when \"",
"\"adding change group\"",
... | Applies channel-group n to ethernet interface. | [
"Applies",
"channel",
"-",
"group",
"n",
"to",
"ethernet",
"interface",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py#L210-L230 |
openstack/networking-cisco | networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py | CiscoNexusRestapiDriver._apply_user_port_channel_config | def _apply_user_port_channel_config(self, nexus_host, vpc_nbr):
"""Adds STP and no lacp suspend config to port channel. """
cli_cmds = self._get_user_port_channel_config(nexus_host, vpc_nbr)
if cli_cmds:
self._send_cli_conf_string(nexus_host, cli_cmds)
else:
vpc_... | python | def _apply_user_port_channel_config(self, nexus_host, vpc_nbr):
"""Adds STP and no lacp suspend config to port channel. """
cli_cmds = self._get_user_port_channel_config(nexus_host, vpc_nbr)
if cli_cmds:
self._send_cli_conf_string(nexus_host, cli_cmds)
else:
vpc_... | [
"def",
"_apply_user_port_channel_config",
"(",
"self",
",",
"nexus_host",
",",
"vpc_nbr",
")",
":",
"cli_cmds",
"=",
"self",
".",
"_get_user_port_channel_config",
"(",
"nexus_host",
",",
"vpc_nbr",
")",
"if",
"cli_cmds",
":",
"self",
".",
"_send_cli_conf_string",
... | Adds STP and no lacp suspend config to port channel. | [
"Adds",
"STP",
"and",
"no",
"lacp",
"suspend",
"config",
"to",
"port",
"channel",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py#L254-L264 |
openstack/networking-cisco | networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py | CiscoNexusRestapiDriver.create_port_channel | def create_port_channel(self, nexus_host, vpc_nbr):
"""Creates port channel n on Nexus switch."""
starttime = time.time()
vpc_str = str(vpc_nbr)
path_snip = snipp.PATH_ALL
body_snip = snipp.BODY_ADD_PORT_CH % (vpc_str, vpc_str, vpc_str)
self.send_edit_string(nexus_host... | python | def create_port_channel(self, nexus_host, vpc_nbr):
"""Creates port channel n on Nexus switch."""
starttime = time.time()
vpc_str = str(vpc_nbr)
path_snip = snipp.PATH_ALL
body_snip = snipp.BODY_ADD_PORT_CH % (vpc_str, vpc_str, vpc_str)
self.send_edit_string(nexus_host... | [
"def",
"create_port_channel",
"(",
"self",
",",
"nexus_host",
",",
"vpc_nbr",
")",
":",
"starttime",
"=",
"time",
".",
"time",
"(",
")",
"vpc_str",
"=",
"str",
"(",
"vpc_nbr",
")",
"path_snip",
"=",
"snipp",
".",
"PATH_ALL",
"body_snip",
"=",
"snipp",
".... | Creates port channel n on Nexus switch. | [
"Creates",
"port",
"channel",
"n",
"on",
"Nexus",
"switch",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py#L266-L281 |
openstack/networking-cisco | networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py | CiscoNexusRestapiDriver.delete_port_channel | def delete_port_channel(self, nexus_host, vpc_nbr):
"""Deletes delete port channel on Nexus switch."""
starttime = time.time()
path_snip = snipp.PATH_ALL
body_snip = snipp.BODY_DEL_PORT_CH % (vpc_nbr)
self.send_edit_string(nexus_host, path_snip, body_snip)
self.captur... | python | def delete_port_channel(self, nexus_host, vpc_nbr):
"""Deletes delete port channel on Nexus switch."""
starttime = time.time()
path_snip = snipp.PATH_ALL
body_snip = snipp.BODY_DEL_PORT_CH % (vpc_nbr)
self.send_edit_string(nexus_host, path_snip, body_snip)
self.captur... | [
"def",
"delete_port_channel",
"(",
"self",
",",
"nexus_host",
",",
"vpc_nbr",
")",
":",
"starttime",
"=",
"time",
".",
"time",
"(",
")",
"path_snip",
"=",
"snipp",
".",
"PATH_ALL",
"body_snip",
"=",
"snipp",
".",
"BODY_DEL_PORT_CH",
"%",
"(",
"vpc_nbr",
")... | Deletes delete port channel on Nexus switch. | [
"Deletes",
"delete",
"port",
"channel",
"on",
"Nexus",
"switch",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py#L283-L295 |
openstack/networking-cisco | networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py | CiscoNexusRestapiDriver._get_port_channel_group | def _get_port_channel_group(self, nexus_host, intf_type, interface):
"""Look for 'channel-group x' config and return x.
:param nexus_host: IP address of Nexus switch
:param intf_type: String which specifies interface type.
example: ethernet
:param interface: ... | python | def _get_port_channel_group(self, nexus_host, intf_type, interface):
"""Look for 'channel-group x' config and return x.
:param nexus_host: IP address of Nexus switch
:param intf_type: String which specifies interface type.
example: ethernet
:param interface: ... | [
"def",
"_get_port_channel_group",
"(",
"self",
",",
"nexus_host",
",",
"intf_type",
",",
"interface",
")",
":",
"ch_grp",
"=",
"0",
"# channel-group only applied to ethernet,",
"# otherwise, return 0",
"if",
"intf_type",
"!=",
"'ethernet'",
":",
"return",
"ch_grp",
"m... | Look for 'channel-group x' config and return x.
:param nexus_host: IP address of Nexus switch
:param intf_type: String which specifies interface type.
example: ethernet
:param interface: String indicating which interface.
example: 1/19
... | [
"Look",
"for",
"channel",
"-",
"group",
"x",
"config",
"and",
"return",
"x",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py#L297-L338 |
openstack/networking-cisco | networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py | CiscoNexusRestapiDriver.initialize_baremetal_switch_interfaces | def initialize_baremetal_switch_interfaces(self, interfaces):
"""Initialize Nexus interfaces and for initial baremetal event.
This get/create port channel number, applies channel-group to
ethernet interface, and initializes trunking on interface.
:param interfaces: Receive a list of in... | python | def initialize_baremetal_switch_interfaces(self, interfaces):
"""Initialize Nexus interfaces and for initial baremetal event.
This get/create port channel number, applies channel-group to
ethernet interface, and initializes trunking on interface.
:param interfaces: Receive a list of in... | [
"def",
"initialize_baremetal_switch_interfaces",
"(",
"self",
",",
"interfaces",
")",
":",
"if",
"not",
"interfaces",
":",
"return",
"max_ifs",
"=",
"len",
"(",
"interfaces",
")",
"starttime",
"=",
"time",
".",
"time",
"(",
")",
"learned",
",",
"nexus_ip_list"... | Initialize Nexus interfaces and for initial baremetal event.
This get/create port channel number, applies channel-group to
ethernet interface, and initializes trunking on interface.
:param interfaces: Receive a list of interfaces containing:
nexus_host: IP address of Nexus switch
... | [
"Initialize",
"Nexus",
"interfaces",
"and",
"for",
"initial",
"baremetal",
"event",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py#L468-L535 |
openstack/networking-cisco | networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py | CiscoNexusRestapiDriver.initialize_all_switch_interfaces | def initialize_all_switch_interfaces(self, interfaces,
switch_ip=None, replay=True):
"""Configure Nexus interface and get port channel number.
Called during switch replay or just init if no replay
is configured. For latter case, only configured interfac... | python | def initialize_all_switch_interfaces(self, interfaces,
switch_ip=None, replay=True):
"""Configure Nexus interface and get port channel number.
Called during switch replay or just init if no replay
is configured. For latter case, only configured interfac... | [
"def",
"initialize_all_switch_interfaces",
"(",
"self",
",",
"interfaces",
",",
"switch_ip",
"=",
"None",
",",
"replay",
"=",
"True",
")",
":",
"if",
"not",
"interfaces",
":",
"return",
"starttime",
"=",
"time",
".",
"time",
"(",
")",
"if",
"replay",
":",
... | Configure Nexus interface and get port channel number.
Called during switch replay or just init if no replay
is configured. For latter case, only configured interfaces
are affected by this method.
During switch replay, the change group from the
host mapping data base is used. ... | [
"Configure",
"Nexus",
"interface",
"and",
"get",
"port",
"channel",
"number",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py#L537-L604 |
openstack/networking-cisco | networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py | CiscoNexusRestapiDriver.get_nexus_type | def get_nexus_type(self, nexus_host):
"""Given the nexus host, get the type of Nexus switch.
:param nexus_host: IP address of Nexus switch
:returns: Nexus type
"""
starttime = time.time()
response = self.client.rest_get(
snipp.PATH_GET_NEXUS_TYPE, nexus_host... | python | def get_nexus_type(self, nexus_host):
"""Given the nexus host, get the type of Nexus switch.
:param nexus_host: IP address of Nexus switch
:returns: Nexus type
"""
starttime = time.time()
response = self.client.rest_get(
snipp.PATH_GET_NEXUS_TYPE, nexus_host... | [
"def",
"get_nexus_type",
"(",
"self",
",",
"nexus_host",
")",
":",
"starttime",
"=",
"time",
".",
"time",
"(",
")",
"response",
"=",
"self",
".",
"client",
".",
"rest_get",
"(",
"snipp",
".",
"PATH_GET_NEXUS_TYPE",
",",
"nexus_host",
")",
"self",
".",
"c... | Given the nexus host, get the type of Nexus switch.
:param nexus_host: IP address of Nexus switch
:returns: Nexus type | [
"Given",
"the",
"nexus",
"host",
"get",
"the",
"type",
"of",
"Nexus",
"switch",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py#L606-L641 |
openstack/networking-cisco | networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py | CiscoNexusRestapiDriver.get_create_vlan | def get_create_vlan(self, nexus_host, vlanid, vni, conf_str):
"""Returns an XML snippet for create VLAN on a Nexus Switch."""
starttime = time.time()
if vni:
body_snip = snipp.BODY_VXLAN_ALL_INCR % (vlanid, vni)
else:
body_snip = snipp.BODY_VLAN_ALL_INCR % vlani... | python | def get_create_vlan(self, nexus_host, vlanid, vni, conf_str):
"""Returns an XML snippet for create VLAN on a Nexus Switch."""
starttime = time.time()
if vni:
body_snip = snipp.BODY_VXLAN_ALL_INCR % (vlanid, vni)
else:
body_snip = snipp.BODY_VLAN_ALL_INCR % vlani... | [
"def",
"get_create_vlan",
"(",
"self",
",",
"nexus_host",
",",
"vlanid",
",",
"vni",
",",
"conf_str",
")",
":",
"starttime",
"=",
"time",
".",
"time",
"(",
")",
"if",
"vni",
":",
"body_snip",
"=",
"snipp",
".",
"BODY_VXLAN_ALL_INCR",
"%",
"(",
"vlanid",
... | Returns an XML snippet for create VLAN on a Nexus Switch. | [
"Returns",
"an",
"XML",
"snippet",
"for",
"create",
"VLAN",
"on",
"a",
"Nexus",
"Switch",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py#L654-L669 |
openstack/networking-cisco | networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py | CiscoNexusRestapiDriver.set_all_vlan_states | def set_all_vlan_states(self, nexus_host, vlanid_range):
"""Set the VLAN states to active."""
starttime = time.time()
if not vlanid_range:
LOG.warning("Exiting set_all_vlan_states: "
"No vlans to configure")
return
# Eliminate possible w... | python | def set_all_vlan_states(self, nexus_host, vlanid_range):
"""Set the VLAN states to active."""
starttime = time.time()
if not vlanid_range:
LOG.warning("Exiting set_all_vlan_states: "
"No vlans to configure")
return
# Eliminate possible w... | [
"def",
"set_all_vlan_states",
"(",
"self",
",",
"nexus_host",
",",
"vlanid_range",
")",
":",
"starttime",
"=",
"time",
".",
"time",
"(",
")",
"if",
"not",
"vlanid_range",
":",
"LOG",
".",
"warning",
"(",
"\"Exiting set_all_vlan_states: \"",
"\"No vlans to configur... | Set the VLAN states to active. | [
"Set",
"the",
"VLAN",
"states",
"to",
"active",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py#L671-L707 |
openstack/networking-cisco | networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py | CiscoNexusRestapiDriver.create_vlan | def create_vlan(self, nexus_host, vlanid, vni):
"""Given switch, vlanid, vni, Create a VLAN on Switch."""
starttime = time.time()
path_snip, body_snip = self.start_create_vlan()
body_snip = self.get_create_vlan(nexus_host, vlanid, vni, body_snip)
body_snip = self.end_create_vlan... | python | def create_vlan(self, nexus_host, vlanid, vni):
"""Given switch, vlanid, vni, Create a VLAN on Switch."""
starttime = time.time()
path_snip, body_snip = self.start_create_vlan()
body_snip = self.get_create_vlan(nexus_host, vlanid, vni, body_snip)
body_snip = self.end_create_vlan... | [
"def",
"create_vlan",
"(",
"self",
",",
"nexus_host",
",",
"vlanid",
",",
"vni",
")",
":",
"starttime",
"=",
"time",
".",
"time",
"(",
")",
"path_snip",
",",
"body_snip",
"=",
"self",
".",
"start_create_vlan",
"(",
")",
"body_snip",
"=",
"self",
".",
"... | Given switch, vlanid, vni, Create a VLAN on Switch. | [
"Given",
"switch",
"vlanid",
"vni",
"Create",
"a",
"VLAN",
"on",
"Switch",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py#L709-L721 |
openstack/networking-cisco | networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py | CiscoNexusRestapiDriver.delete_vlan | def delete_vlan(self, nexus_host, vlanid):
"""Delete a VLAN on Nexus Switch given the VLAN ID."""
starttime = time.time()
path_snip = snipp.PATH_VLAN % vlanid
self.client.rest_delete(path_snip, nexus_host)
self.capture_and_print_timeshot(
starttime, "del_vlan",
... | python | def delete_vlan(self, nexus_host, vlanid):
"""Delete a VLAN on Nexus Switch given the VLAN ID."""
starttime = time.time()
path_snip = snipp.PATH_VLAN % vlanid
self.client.rest_delete(path_snip, nexus_host)
self.capture_and_print_timeshot(
starttime, "del_vlan",
... | [
"def",
"delete_vlan",
"(",
"self",
",",
"nexus_host",
",",
"vlanid",
")",
":",
"starttime",
"=",
"time",
".",
"time",
"(",
")",
"path_snip",
"=",
"snipp",
".",
"PATH_VLAN",
"%",
"vlanid",
"self",
".",
"client",
".",
"rest_delete",
"(",
"path_snip",
",",
... | Delete a VLAN on Nexus Switch given the VLAN ID. | [
"Delete",
"a",
"VLAN",
"on",
"Nexus",
"Switch",
"given",
"the",
"VLAN",
"ID",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py#L723-L732 |
openstack/networking-cisco | networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py | CiscoNexusRestapiDriver._get_vlan_body_on_trunk_int | def _get_vlan_body_on_trunk_int(self, nexus_host, vlanid, intf_type,
interface, is_native, is_delete,
add_mode):
"""Prepares an XML snippet for VLAN on a trunk interface.
:param nexus_host: IP address of Nexus switch
:param... | python | def _get_vlan_body_on_trunk_int(self, nexus_host, vlanid, intf_type,
interface, is_native, is_delete,
add_mode):
"""Prepares an XML snippet for VLAN on a trunk interface.
:param nexus_host: IP address of Nexus switch
:param... | [
"def",
"_get_vlan_body_on_trunk_int",
"(",
"self",
",",
"nexus_host",
",",
"vlanid",
",",
"intf_type",
",",
"interface",
",",
"is_native",
",",
"is_delete",
",",
"add_mode",
")",
":",
"starttime",
"=",
"time",
".",
"time",
"(",
")",
"LOG",
".",
"debug",
"(... | Prepares an XML snippet for VLAN on a trunk interface.
:param nexus_host: IP address of Nexus switch
:param vlanid: Vlanid(s) to add to interface
:param intf_type: String which specifies interface type.
example: ethernet
:param interface: String indicati... | [
"Prepares",
"an",
"XML",
"snippet",
"for",
"VLAN",
"on",
"a",
"trunk",
"interface",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py#L734-L790 |
openstack/networking-cisco | networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py | CiscoNexusRestapiDriver.disable_vlan_on_trunk_int | def disable_vlan_on_trunk_int(self, nexus_host, vlanid, intf_type,
interface, is_native):
"""Disable a VLAN on a trunk interface."""
starttime = time.time()
path_snip, body_snip = self._get_vlan_body_on_trunk_int(
nexus_host, vlanid, intf_type, int... | python | def disable_vlan_on_trunk_int(self, nexus_host, vlanid, intf_type,
interface, is_native):
"""Disable a VLAN on a trunk interface."""
starttime = time.time()
path_snip, body_snip = self._get_vlan_body_on_trunk_int(
nexus_host, vlanid, intf_type, int... | [
"def",
"disable_vlan_on_trunk_int",
"(",
"self",
",",
"nexus_host",
",",
"vlanid",
",",
"intf_type",
",",
"interface",
",",
"is_native",
")",
":",
"starttime",
"=",
"time",
".",
"time",
"(",
")",
"path_snip",
",",
"body_snip",
"=",
"self",
".",
"_get_vlan_bo... | Disable a VLAN on a trunk interface. | [
"Disable",
"a",
"VLAN",
"on",
"a",
"trunk",
"interface",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py#L792-L804 |
openstack/networking-cisco | networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py | CiscoNexusRestapiDriver.send_edit_string | def send_edit_string(self, nexus_host, path_snip, body_snip,
check_to_close_session=True):
"""Sends rest Post request to Nexus switch."""
starttime = time.time()
LOG.debug("NexusDriver edit config for host %s: path: %s body: %s",
nexus_host, path_snip,... | python | def send_edit_string(self, nexus_host, path_snip, body_snip,
check_to_close_session=True):
"""Sends rest Post request to Nexus switch."""
starttime = time.time()
LOG.debug("NexusDriver edit config for host %s: path: %s body: %s",
nexus_host, path_snip,... | [
"def",
"send_edit_string",
"(",
"self",
",",
"nexus_host",
",",
"path_snip",
",",
"body_snip",
",",
"check_to_close_session",
"=",
"True",
")",
":",
"starttime",
"=",
"time",
".",
"time",
"(",
")",
"LOG",
".",
"debug",
"(",
"\"NexusDriver edit config for host %s... | Sends rest Post request to Nexus switch. | [
"Sends",
"rest",
"Post",
"request",
"to",
"Nexus",
"switch",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py#L806-L816 |
openstack/networking-cisco | networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py | CiscoNexusRestapiDriver._send_cli_conf_string | def _send_cli_conf_string(self, nexus_host, cli_str):
"""Sends CLI Config commands to Nexus switch using NXAPI."""
starttime = time.time()
path_snip = snipp.PATH_USER_CMDS
body_snip = snipp.BODY_USER_CONF_CMDS % ('1', cli_str)
LOG.debug("NexusDriver CLI config for host %s: path:... | python | def _send_cli_conf_string(self, nexus_host, cli_str):
"""Sends CLI Config commands to Nexus switch using NXAPI."""
starttime = time.time()
path_snip = snipp.PATH_USER_CMDS
body_snip = snipp.BODY_USER_CONF_CMDS % ('1', cli_str)
LOG.debug("NexusDriver CLI config for host %s: path:... | [
"def",
"_send_cli_conf_string",
"(",
"self",
",",
"nexus_host",
",",
"cli_str",
")",
":",
"starttime",
"=",
"time",
".",
"time",
"(",
")",
"path_snip",
"=",
"snipp",
".",
"PATH_USER_CMDS",
"body_snip",
"=",
"snipp",
".",
"BODY_USER_CONF_CMDS",
"%",
"(",
"'1'... | Sends CLI Config commands to Nexus switch using NXAPI. | [
"Sends",
"CLI",
"Config",
"commands",
"to",
"Nexus",
"switch",
"using",
"NXAPI",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py#L818-L829 |
openstack/networking-cisco | networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py | CiscoNexusRestapiDriver.send_enable_vlan_on_trunk_int | def send_enable_vlan_on_trunk_int(self, nexus_host, vlanid, intf_type,
interface, is_native, add_mode=False):
"""Gathers and sends an interface trunk XML snippet."""
path_snip, body_snip = self._get_vlan_body_on_trunk_int(
nexus_host, vlanid, intf_type,... | python | def send_enable_vlan_on_trunk_int(self, nexus_host, vlanid, intf_type,
interface, is_native, add_mode=False):
"""Gathers and sends an interface trunk XML snippet."""
path_snip, body_snip = self._get_vlan_body_on_trunk_int(
nexus_host, vlanid, intf_type,... | [
"def",
"send_enable_vlan_on_trunk_int",
"(",
"self",
",",
"nexus_host",
",",
"vlanid",
",",
"intf_type",
",",
"interface",
",",
"is_native",
",",
"add_mode",
"=",
"False",
")",
":",
"path_snip",
",",
"body_snip",
"=",
"self",
".",
"_get_vlan_body_on_trunk_int",
... | Gathers and sends an interface trunk XML snippet. | [
"Gathers",
"and",
"sends",
"an",
"interface",
"trunk",
"XML",
"snippet",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py#L831-L838 |
openstack/networking-cisco | networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py | CiscoNexusRestapiDriver.create_and_trunk_vlan | def create_and_trunk_vlan(self, nexus_host, vlan_id, intf_type,
nexus_port, vni, is_native):
"""Create VLAN and trunk it on the specified ports."""
starttime = time.time()
self.create_vlan(nexus_host, vlan_id, vni)
LOG.debug("NexusDriver created VLAN: %s",... | python | def create_and_trunk_vlan(self, nexus_host, vlan_id, intf_type,
nexus_port, vni, is_native):
"""Create VLAN and trunk it on the specified ports."""
starttime = time.time()
self.create_vlan(nexus_host, vlan_id, vni)
LOG.debug("NexusDriver created VLAN: %s",... | [
"def",
"create_and_trunk_vlan",
"(",
"self",
",",
"nexus_host",
",",
"vlan_id",
",",
"intf_type",
",",
"nexus_port",
",",
"vni",
",",
"is_native",
")",
":",
"starttime",
"=",
"time",
".",
"time",
"(",
")",
"self",
".",
"create_vlan",
"(",
"nexus_host",
","... | Create VLAN and trunk it on the specified ports. | [
"Create",
"VLAN",
"and",
"trunk",
"it",
"on",
"the",
"specified",
"ports",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py#L840-L857 |
openstack/networking-cisco | networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py | CiscoNexusRestapiDriver.enable_vxlan_feature | def enable_vxlan_feature(self, nexus_host, nve_int_num, src_intf):
"""Enable VXLAN on the switch."""
# Configure the "feature" commands and NVE interface
# (without "member" subcommand configuration).
# The Nexus 9K will not allow the "interface nve" configuration
# until the "f... | python | def enable_vxlan_feature(self, nexus_host, nve_int_num, src_intf):
"""Enable VXLAN on the switch."""
# Configure the "feature" commands and NVE interface
# (without "member" subcommand configuration).
# The Nexus 9K will not allow the "interface nve" configuration
# until the "f... | [
"def",
"enable_vxlan_feature",
"(",
"self",
",",
"nexus_host",
",",
"nve_int_num",
",",
"src_intf",
")",
":",
"# Configure the \"feature\" commands and NVE interface",
"# (without \"member\" subcommand configuration).",
"# The Nexus 9K will not allow the \"interface nve\" configuration",... | Enable VXLAN on the switch. | [
"Enable",
"VXLAN",
"on",
"the",
"switch",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py#L859-L894 |
openstack/networking-cisco | networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py | CiscoNexusRestapiDriver.disable_vxlan_feature | def disable_vxlan_feature(self, nexus_host):
"""Disable VXLAN on the switch."""
# Removing the "feature nv overlay" configuration also
# removes the "interface nve" configuration.
starttime = time.time()
# Do CLI 'no feature nv overlay'
self.send_edit_string(nexus_host... | python | def disable_vxlan_feature(self, nexus_host):
"""Disable VXLAN on the switch."""
# Removing the "feature nv overlay" configuration also
# removes the "interface nve" configuration.
starttime = time.time()
# Do CLI 'no feature nv overlay'
self.send_edit_string(nexus_host... | [
"def",
"disable_vxlan_feature",
"(",
"self",
",",
"nexus_host",
")",
":",
"# Removing the \"feature nv overlay\" configuration also",
"# removes the \"interface nve\" configuration.",
"starttime",
"=",
"time",
".",
"time",
"(",
")",
"# Do CLI 'no feature nv overlay'",
"self",
"... | Disable VXLAN on the switch. | [
"Disable",
"VXLAN",
"on",
"the",
"switch",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py#L896-L914 |
openstack/networking-cisco | networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py | CiscoNexusRestapiDriver.create_nve_member | def create_nve_member(self, nexus_host, nve_int_num, vni, mcast_group):
"""Add a member configuration to the NVE interface."""
# Do CLI [no] member vni %s mcast-group %s
# beneath int nve1
starttime = time.time()
path = snipp.PATH_VNI_UPDATE % (nve_int_num, vni)
body =... | python | def create_nve_member(self, nexus_host, nve_int_num, vni, mcast_group):
"""Add a member configuration to the NVE interface."""
# Do CLI [no] member vni %s mcast-group %s
# beneath int nve1
starttime = time.time()
path = snipp.PATH_VNI_UPDATE % (nve_int_num, vni)
body =... | [
"def",
"create_nve_member",
"(",
"self",
",",
"nexus_host",
",",
"nve_int_num",
",",
"vni",
",",
"mcast_group",
")",
":",
"# Do CLI [no] member vni %s mcast-group %s",
"# beneath int nve1",
"starttime",
"=",
"time",
".",
"time",
"(",
")",
"path",
"=",
"snipp",
"."... | Add a member configuration to the NVE interface. | [
"Add",
"a",
"member",
"configuration",
"to",
"the",
"NVE",
"interface",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py#L916-L930 |
openstack/networking-cisco | networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py | CiscoNexusRestapiDriver.delete_nve_member | def delete_nve_member(self, nexus_host, nve_int_num, vni):
"""Delete a member configuration on the NVE interface."""
starttime = time.time()
path_snip = snipp.PATH_VNI_UPDATE % (nve_int_num, vni)
self.client.rest_delete(path_snip, nexus_host)
self.capture_and_print_timeshot(
... | python | def delete_nve_member(self, nexus_host, nve_int_num, vni):
"""Delete a member configuration on the NVE interface."""
starttime = time.time()
path_snip = snipp.PATH_VNI_UPDATE % (nve_int_num, vni)
self.client.rest_delete(path_snip, nexus_host)
self.capture_and_print_timeshot(
... | [
"def",
"delete_nve_member",
"(",
"self",
",",
"nexus_host",
",",
"nve_int_num",
",",
"vni",
")",
":",
"starttime",
"=",
"time",
".",
"time",
"(",
")",
"path_snip",
"=",
"snipp",
".",
"PATH_VNI_UPDATE",
"%",
"(",
"nve_int_num",
",",
"vni",
")",
"self",
".... | Delete a member configuration on the NVE interface. | [
"Delete",
"a",
"member",
"configuration",
"on",
"the",
"NVE",
"interface",
"."
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_restapi_network_driver.py#L932-L942 |
openstack/networking-cisco | networking_cisco/plugins/cisco/cfg_agent/device_drivers/asr1k/asr1k_routing_driver.py | ASR1kRoutingDriver._get_vrf_name | def _get_vrf_name(self, ri):
"""
overloaded method for generating a vrf_name that supports
region_id
"""
router_id = ri.router_name()[:self.DEV_NAME_LEN]
is_multi_region_enabled = cfg.CONF.multi_region.enable_multi_region
if is_multi_region_enabled:
r... | python | def _get_vrf_name(self, ri):
"""
overloaded method for generating a vrf_name that supports
region_id
"""
router_id = ri.router_name()[:self.DEV_NAME_LEN]
is_multi_region_enabled = cfg.CONF.multi_region.enable_multi_region
if is_multi_region_enabled:
r... | [
"def",
"_get_vrf_name",
"(",
"self",
",",
"ri",
")",
":",
"router_id",
"=",
"ri",
".",
"router_name",
"(",
")",
"[",
":",
"self",
".",
"DEV_NAME_LEN",
"]",
"is_multi_region_enabled",
"=",
"cfg",
".",
"CONF",
".",
"multi_region",
".",
"enable_multi_region",
... | overloaded method for generating a vrf_name that supports
region_id | [
"overloaded",
"method",
"for",
"generating",
"a",
"vrf_name",
"that",
"supports",
"region_id"
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_drivers/asr1k/asr1k_routing_driver.py#L360-L373 |
openstack/networking-cisco | networking_cisco/plugins/cisco/cfg_agent/device_drivers/asr1k/asr1k_routing_driver.py | ASR1kRoutingDriver._get_interface_name_from_hosting_port | def _get_interface_name_from_hosting_port(self, port):
"""
Extract the underlying subinterface name for a port
e.g. Port-channel10.200 or GigabitEthernet0/0/0.500
"""
try:
vlan = port['hosting_info']['segmentation_id']
int_prefix = port['hosting_info']['ph... | python | def _get_interface_name_from_hosting_port(self, port):
"""
Extract the underlying subinterface name for a port
e.g. Port-channel10.200 or GigabitEthernet0/0/0.500
"""
try:
vlan = port['hosting_info']['segmentation_id']
int_prefix = port['hosting_info']['ph... | [
"def",
"_get_interface_name_from_hosting_port",
"(",
"self",
",",
"port",
")",
":",
"try",
":",
"vlan",
"=",
"port",
"[",
"'hosting_info'",
"]",
"[",
"'segmentation_id'",
"]",
"int_prefix",
"=",
"port",
"[",
"'hosting_info'",
"]",
"[",
"'physical_interface'",
"]... | Extract the underlying subinterface name for a port
e.g. Port-channel10.200 or GigabitEthernet0/0/0.500 | [
"Extract",
"the",
"underlying",
"subinterface",
"name",
"for",
"a",
"port",
"e",
".",
"g",
".",
"Port",
"-",
"channel10",
".",
"200",
"or",
"GigabitEthernet0",
"/",
"0",
"/",
"0",
".",
"500"
] | train | https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/device_drivers/asr1k/asr1k_routing_driver.py#L397-L408 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.