dashboard.devices.updateDevice -> error 404

Solved
meilenstein
Conversationalist

dashboard.devices.updateDevice -> error 404

Hi Meraki-Community,

 

I am working on a script where I want to update settings for some devices. However, I am stuck with the updateDevice function, because it is giving me a 404 error.
One could think, the given serial of the device is just wrong, but for the same serial I get a response with the getOrganizationInventoryDevice function.
Did someone stumble upon this already? Some ideas how I could fix this?

Here are some code snippets for explanation, what is working and what not:

response = dashboard.organizations.getOrganizationInventoryDevice(ORG_ID,dev["serial"])

print(response)

this is returning me a dictionary with MAC-Address, serial, name, model and further information

 

response = dashboard.devices.getDevice(dev["serial"])

this is throwing a 404 error meraki.exceptions.APIError: devices, getDevice - 404 Not Found, please wait a minute if the key or org was just newly created.

 

the same as with

response = dashboard.devices.updateDevice( dev["serial"], name=dev["name"], tags="test")

 

I am running the functions in the same loop, so dev["serial"] is always the same value, but even if I try it with a hard coded serial I get the same result.

 

thank you for any hint,

Mira

 

PS: I claimed that device to inventory on 15 of december, so waiting a couple of minutes does not seem to be the solution

1 Accepted Solution
ShawnHu
Meraki Employee
Meraki Employee

@meilenstein  Can you confirm that the device has been added to a network already?  If yes, you should find the network ID in the result of getOrganizationInventoryDevice. 

It's expected the dashboard.devices.getDevice endpoint to return 404 error if the device just sits in the inventory but not in a network. 

View solution in original post

5 Replies 5
PhilipDAth
Kind of a big deal
Kind of a big deal

That looks correct to me.  I would try opening a support case for this.  Smells like it could be a bug.

meilenstein
Conversationalist

Thank you @PhilipDAth, I will try to open a support case for this.

 

I tried now the same with the requests modul and with postman and with a curl request and with different serials with the same result: error 404. I am wondering, if I am the only one trying to change settings of a device via Dashboard API or if there is another way...

 

 

ShawnHu
Meraki Employee
Meraki Employee

@meilenstein  Can you confirm that the device has been added to a network already?  If yes, you should find the network ID in the result of getOrganizationInventoryDevice. 

It's expected the dashboard.devices.getDevice endpoint to return 404 error if the device just sits in the inventory but not in a network. 

meilenstein
Conversationalist

Good morning@@ShawnHu ,

 

Thank you for your reply, I can confirm, that the devices I used for my tests are only in the inventory, but not yet in a network.

I will immediately try to put them into a network and rerun my script.

meilenstein
Conversationalist

I claimed the device to a network and the updateDevice function worked!

 

Thank you @ShawnHu 

Get notified when there are additional replies to this discussion.