CiscoDevNet/ansible-meraki

meraki_device module: Creating 404 errors

MrShed opened this issue ยท 11 comments

MrShed commented

The Meraki Device module is causing 404 errors when in "present" state (unsure about other states at the moment).

This appears to be a breaking API change from v1.33 where the paths changed from:

/networks/{networkId}/devices/{serial}

to:

/devices/{serial}

Code still references the former (I think - not a dev!!)

Apologies if this isn't well submitted (as I say, not a dev unfortunately)

MrShed commented

Can confirm that changing the following lines in meraki_device.py fixes the issue:

query_device_urls = {'device': '/devices/{serial}'}

update_device_urls = {'device': '/devices/'}

There is still an issue with delete_device_urls but this has changed to a payload approach for the serial rather than path, so this will require both a path change and a code change.

Seconding @MrShed's observation; Whilst i can see the 1.3.3 Change log shows the new paths, I haven't yet found a statement about the plan to remove the API endpoint, although that's rather a moot point. This will require an urgent fix.

Adding an additional observation;
The Remove URL has changed as well and is now /networks/{networkId}/devices/remove with the serial in the body of the request.

MrShed commented

Thanks @mystery-rabbit.

I spoke with meraki about this today and while they were unable to confirm deprecation of the original path at this stage they did confirm they class it as an "incorrect" path. I assume that it was in fact deprecated, as this was worked 24 hours ago no problem.

I have fixed the issues bar the delete device issue in a fork for now. Happy to share if helpful to anyone. Had to fix it as this completely broke our network build pipeline (which creates dozens of networks per day - today was not a good day!).

MrShed commented

PS thanks for the clarification re: version number and linking to the changelog ๐Ÿ‘

kbreit commented

@MrShed and @mystery-rabbit - If you have the ability to test #461 please do. My integration tests passed so it's progress.

MrShed commented

@kbreit thank you for this.

I should be in a position to test this in our existing build pipeline tomorrow, will let you know the outcome.

MrShed commented

@kbreit - I can confirm that #461 resolves the issue. I have validated all three affected url catalog items.

kbreit commented

Thanks for letting me know. I'll merge and do a release hopefully today.

MrShed commented

Very welcome, thanks for resolving into release so quickly!

@kbreit - tested this morning against 2.15.3 and confirm all appears to be functioning correctly. Many Thanks!

kbreit commented

Good to hear. If you see this elsewhere, please let me know.