Hi there,
Here you have a small piece of python code i use to configure a switch .
Script set first port as an uplink and the last port as a Access Point
The rest of the ports will be Data/Voip
my_switch = dashboard.devices.getNetworkDevice(def_network,new_ms_serial)
my_nr_ports = 48
my_switch_type = my_switch['model']
if my_switch_type == "MS120-24LP":
my_nr_ports = 24
if my_switch_type == "MS120-24P":
my_nr_ports = 24
if my_switch_type == "MS220-24":
my_nr_ports = 24
if my_switch_type == "MS220-8":
my_nr_ports = 8
if my_switch_type == "MS220-8FP":
my_nr_ports = 8
if my_switch_type == "MS22":
my_nr_ports = 24
for port_nr in range(1,my_nr_ports+1😞
my_switch_port = dashboard.switch_ports.getDeviceSwitchPort(new_ms_serial,str(port_nr))
my_switch_port = {}
if port_nr == 1:
my_switch_port['name'] = "Uplink to MX"
elif port_nr == my_nr_ports - 1:
my_switch_port['name'] = "Meraki Access Point"
else:
my_switch_port['name'] = "Data/VoIP"
my_switch_port['type'] = "access"
my_switch_port['vlan'] = 520
my_switch_port['voiceVlan'] = 600
my_switch_port['stpGuard'] = "bpdu guard"
response = dashboard.switch_ports.updateDeviceSwitchPort(new_ms_serial,str(port_nr),**my_switch_port)