Hi All,
I'm getting the error in the subject when I try to cycle switch port. i can apply or remove the access policy using the same for loop with no issues. But when I try to cycle I'm getting the error. below is my code.
any idea please?
def ports(Net_ID,vlan=None,accesspol=None😞
Devices = dashboard.networks.getNetworkDevices(Net_ID)
for device in Devices:
#print(device['serial'])
port1 = dashboard.switch.getDeviceSwitchPorts(device['serial'])
for port in port1:
# print(port)
if port['accessPolicyType'] != 'Open' and port['vlan']== vlan and port['type'] != 'trunk':
port_upd= dashboard.switch.updateDeviceSwitchPort(device['serial'], port['portId'], accessPolicyType = 'Open' ) # 'Custom access policy') #accessPolicyNumber = accesspol ,accessPolicyNumber = accesspol )
print("Name: {} \t Switch_Serial: {} \t PortNumber: {} \t VLAN: {} \t accessPolicy: {} ".format(device["name"], device["serial"], port['portId'], port["vlan"], port["accessPolicyType"]))
port_Cycle = dashboard.switch.cycleDeviceSwitchPorts(device['serial'], port['portId'])