I am trying to create an API to update a switch port tags based on the assigned vlan. This runs without error but doesn't update the ports, or it updates one port that isnt in the vlans listed. import meraki API_KEY = 'xxxxx' ORG_ID = 'xxxx' NET_ID = 'xxx' Serial = 'xxx' # Create Meraki API Dashboard interface dashboard = meraki.DashboardAPI(API_KEY, suppress_logging=True) # Define VLANs and their corresponding tags vlan_tag_mapping = { 2: ["device_1"], 5: ["device_2"], 10: ["device_3"], } # Get switch ports switch_ports = dashboard.switch.getDeviceSwitchPorts(Serial) # Iterate through each switch port for port in switch_ports: vlan_id = port.get("vlan") port_id = port.get("portId") # Check if the port's VLAN is in the mapping if vlan_id in vlan_tag_mapping: new_tags = vlan_tag_mapping[vlan_id] # Update the port with new tags dashboard.switch.updateDeviceSwitchPort( Serial, portId=port_id, tags=new_tags, )
... View more