Hello RaphaelL, Thanks for your reply showing towards the correct way. I am able to read all devices from the organization->network-> inventory list. Then iterate over device list and find the device with the location address that need to be changed. In this case I am looking for any device that it's address is = "old Address" For a reason I can't understand it is updating the new location address in the device['name'] attribute instead in the device['address'] attribute. In the printout below you can see the device['name'] before posting is 'P1234' and after posting it changes to "new Address" when actually expected that the device name remains 'AP1234' and the device address is changed from 'old Address' to 'new Address' Not sure why it is updating the wrong attribute. Can you tell? from meraki import meraki
apikey = "3***5"
orgid = "6***4"
newaddr = "new Address"
# Return your inventory
deviceList = meraki.getorginventory(apikey,orgid)
#Iterate over all devices in network
for device in deviceList:
# Check if the device['model'] contains string "MR" # If it does then it is an access point. (it could be MS/MX/MV...) if "MR" in device['model']:
# Get the device info that contains the address
deviceinfo = meraki.getdevicedetail(apikey,device['networkId'],device['serial'])
# Print per each item the name, mac and current addresss
print("Device name: " + str(deviceinfo['name']))
print("\tMAC: " + str(deviceinfo['mac']))
print("\tAddress: " + str(deviceinfo['address']))
# Check if the device matches your old address
if "old Address" in deviceinfo['address']:
# Print address value as stored in deviceinfo['address']
print("Address as stored in 'address' attribute before assigning new value to it:" + str(deviceinfo['address']))
# Assign new address to deviceinfo['address']
deviceinfo['address'] = newaddr
print("Address as stored in 'address' attribute after assigning new value to it:" + str(deviceinfo['address']))
# Save changes
postnewaddr = meraki.updatedevice(apikey,deviceinfo['networkId'],deviceinfo['serial'],deviceinfo['address'])
# Print Post result
print("Post result: " + str(postnewaddr)) Best regards,.
... View more