Exemple #1
0
         "fabric": fabricName,
         "networkName": network['network'],
         "serialNumber": node['serial_no'],
         "switchPorts": interface,
         "detachSwitchPorts": "",
         "vlan": network['vlan'],
         "dot1QVlan": 1,
         "untagged": False,
         "freeformConfig": "",
         "deployment": False,
         "extensionValues": "",
         "instanceValues": ""
     }
     lanattachedlist.append(lanattach)
 else:
     peer_serial_no = dcnm_modules.get_serial_num(leaf_nodes,node['vpc_peer'])
     lanattach = {
         "fabric": fabricName,
         "networkName": network['network'],
         "serialNumber": node['serial_no'],
         "switchPorts": interface,
         "detachSwitchPorts": "",
         "vlan": network['vlan'],
         "dot1QVlan": 1,
         "untagged": False,
         "freeformConfig": "",
         "deployment": False,
         "extensionValues": "",
         "instanceValues": ""
     }
     lanattachedlist.append(lanattach)
Exemple #2
0
posturl = url + '/rest/globalInterface/pti?isMultiEdit=false'

fabricName = input('Enter the Fabric Name: ')
NodeName = input('Enter Node Name: ')
NodeType = input('Enter Node Type( spine or leaf ): ')
IP_Address = input('Enter starting ip address: ')
IP_Mask = input('Enter ipv4 address mask: ')
StartingIntf = input('Enter starting interface: ')
IntfNum = input('Enter number of interface: ')

if NodeType.lower() == 'spine':
    spine_nodes = dcnm_modules.get_spine_nodes(fabricName)
    serialNum = dcnm_modules.get_spine_serial_num(spine_nodes, NodeName)
elif NodeType.lower() == 'leaf':
    leaf_nodes = dcnm_modules.get_leaf_nodes(fabricName)
    serialNum = dcnm_modules.get_serial_num(leaf_nodes, NodeName)

ip_addr = ipaddress.ip_address(IP_Address)

mod_port = re.findall('\d+', StartingIntf)
module = int(mod_port[0])
port = int(mod_port[1])
interfaces = []
for intf in range(int(IntfNum)):
    interface = f'Ethernet{module}/{port}'
    #print(interface)
    nvpair = {
        "INTF_VRF": "",
        "IP": str(ip_addr),
        "PREFIX": IP_Mask,
        "ROUTING_TAG": "",