The networking_cisco.plugins.ml2.drivers.cisco.nexus.nexus_restapi_network_driver
Module¶
Implements a Nexus-OS NETCONF over SSHv2 API Client
-
class
networking_cisco.plugins.ml2.drivers.cisco.nexus.nexus_restapi_network_driver.
CiscoNexusRestapiDriver
(nexus_switches)¶ Bases:
networking_cisco.plugins.ml2.drivers.cisco.nexus.nexus_base_network_driver.CiscoNexusBaseDriver
Nexus Driver Restapi Class.
-
add_ch_grp_to_interface
(nexus_host, if_type, port, ch_grp)¶ Applies channel-group n to ethernet interface.
-
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_port_channel
(nexus_host, vpc_nbr)¶ Creates port channel n on Nexus switch.
-
create_vlan
(nexus_host, vlanid, vlanname, vni)¶ Given switch, vlanid, vni, Create a VLAN on Switch.
-
delete_ch_grp_to_interface
(nexus_host, if_type, port, ch_grp)¶ Removes channel-group n from ethernet interface.
-
delete_nve_member
(nexus_host, nve_int_num, vni)¶ Delete a member configuration on the NVE interface.
-
delete_port_channel
(nexus_host, vpc_nbr)¶ Deletes delete port channel on Nexus switch.
-
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 current config + end of config.
-
get_create_vlan
(nexus_host, vlanid, vni, conf_str)¶ Returns an XML snippet for create VLAN on a Nexus Switch.
-
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: Returns interface data
-
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
-
initialize_all_switch_interfaces
(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 interfaces are affected by this method.
During switch replay, the change group from the host mapping data base is used. There is no attempt to relearn port-channel from the Nexus switch. What we last knew it to be will persist.
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
-
initialize_baremetal_switch_interfaces
(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.
Parameters: interfaces – Receive a list of interfaces containing: nexus_host: IP address of Nexus switch intf_type: String which specifies interface type. example: ethernet interface: String indicating which interface. example: 1/19 is_native: Whether native vlan must be configured. ch_grp: May replace port channel to each entry. channel number is 0 if none
-
send_edit_string
(nexus_host, path_snip, body_snip, check_to_close_session=True)¶ Sends rest Post request to Nexus switch.
-
send_enable_vlan_on_trunk_int
(nexus_host, vlanid, intf_type, interface, is_native, add_mode=False)¶ 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 REST API path and config start.
-