cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2659
Views
0
Helpful
1
Replies

Python updateDeviceSwitchPort get data from and exported JSON

damienleick1
Level 2
Level 2

Hi,

here is my question

Actually a i made a python script to export a full ports configuration of switch, stored those json data and i would like to uses those data tu push ports configuration to another switch of the same model

serial = input('Enter the serial number of the switch to backup: ')
Switch_export = dashboard.switch_ports.getDeviceSwitchPorts(serial)
print (Switch_export)
print(fThe switch port information has been stored')

serial2 = input("Please enter de serial of the destination switch : ")

i=1

for port in Switch_export:
Switch_import = dashboard.switch_ports.updateDeviceSwitchPort(serial2, i, )
i = i+1

print('The switch port information has been restored')


Because API doenst purpose to pussh all the configuration with one command i need to do a for with JSON data
Is there any possibilty to use json data port value of "Switch_export" in the "Switch_imports" arguments without need to use a Csv reader ?
thanks
1 Accepted Solution

Accepted Solutions

damienleick1
Level 2
Level 2

Nevermind I found how to do that

View solution in original post

1 Reply 1

damienleick1
Level 2
Level 2

Nevermind I found how to do that