The networking_cisco.plugins.ml2.drivers.cisco.nexus.nexus_base_network_driver Module

Base class driver for SSH and RESTAPI Client. Some APIs are called by upper layer code but only apply to either RESTAPIs drivers or SSH drivers. Having base class which simply performs ‘pass’ is necessary so these two drivers get required actions without breaking the other driver. Drivers defined in this base are mostly those called externally.

class networking_cisco.plugins.ml2.drivers.cisco.nexus.nexus_base_network_driver.CiscoNexusBaseDriver(nexus_switches)

Bases: object

Nexus Driver Base Class.

capture_and_print_timeshot(start_time, which, other=99, switch=‘0.0.0.0’)

Determine delta, keep track, and print results.

close_session(nexus_host)
create_and_trunk_vlan(nexus_host, vlan_id, vlan_name, intf_type, nexus_port, vni, is_native)

Create VLAN and trunk it on the specified ports.

create_nve_member(nexus_host, nve_int_num, vni, mcast_group)

Add a member configuration to the NVE interface.

create_vlan(nexus_host, vlanid, vlanname, vni)

Create a VLAN on a Nexus Switch.

Creates a VLAN given the VLAN ID, name and possible VxLAN ID.

delete_nve_member(nexus_host, nve_int_num, vni)

Delete a member configuration on the NVE interface.

delete_vlan(nexus_host, vlanid)

Delete a VLAN on Nexus Switch given the VLAN ID.

disable_vlan_on_trunk_int(nexus_host, vlanid, intf_type, interface, is_native)

Disable a VLAN on a trunk interface.

disable_vxlan_feature(nexus_host)

Disable VXLAN on the switch.

enable_vxlan_feature(nexus_host, nve_int_num, src_intf)

Enable VXLAN on the switch.

end_create_vlan(conf_str)

Returns an XML snippet for terminate of create VLAN.

get_create_vlan(nexus_host, vlanid, vni, conf_str)

Returns an XML snippet for create VLAN.

get_interface_switch(nexus_host, intf_type, interface)

Get the interface data from host.

Parameters:
  • nexus_host – IP address of Nexus switch
  • intf_type – String which specifies interface type. example: ethernet
  • interface – String indicating which interface. example: 1/19
Returns:

response

get_nexus_type(nexus_host)

Given the nexus host, get the type of Nexus switch.

Parameters:nexus_host – IP address of Nexus switch
Returns:Nexus type
init_ssh_caching()
initialize_all_switch_interfaces(interfaces, switch_ip=None, replay=True)

Configure Nexus interface and get port channel number.

Parameters:
  • interfaces – List of interfaces for a given switch. ch_grp can be altered as last arg to each interface. If no ch_grp, this arg will be zero.
  • switch_ip – IP address of Nexus switch
  • replay – Whether in replay path
keep_ssh_caching()
send_edit_string(nexus_host, path, confstr, check_to_close_session=True)

Sends any XML snippet to Nexus switch.

send_enable_vlan_on_trunk_int(nexus_host, vlanid, intf_type, interface, is_native)

Gathers and sends an interface trunk XML snippet.

set_all_vlan_states(nexus_host, vlanid_range)

Set the VLAN states to active.

start_create_vlan()

Returns an XML snippet for start of create VLAN.