08-12-2024 02:50 PM
Current Behavior: The current Meraki API uses a POST request to /networks/{networkId}/devices/remove to remove a device, with the device serial included in the request body.
Expected Behavior: To align with RESTful API design principles, it would be beneficial to have a DELETE endpoint for removing devices. A proposed endpoint might be: DELETE /networks/{networkId}/devices/{serial}
In this design, the serial would be included in the URL path, making it more intuitive and in line with common RESTful practices.
This also would allow for terraform-provider-meraki to implement Delete easily on the resource.
Solved! Go to Solution.
08-13-2024 04:15 AM
That makes complete sense - but changing it now would be a breaking change.
08-13-2024 04:15 AM
That makes complete sense - but changing it now would be a breaking change.
08-13-2024 08:41 AM
I was afraid that would be the answer, but understand. Thanks for the quick reply! 😊
08-22-2024 01:43 PM
Thanks for this rec! I'd like to explain why this is not the case, and why similarly, there's no CREATE action for a device.
Devices in this sense refer to the physical hardware, so the concept of CREATING or DELETING a device is awkward. This is unlike a Docker cluster, an EC2 instance, a virtual device of some kind, etc. which could be CREATED or DELETED on a whim, which is where I imagine the expectation arises.
getDevice & updateDevice (or even better, getOrganizationDevices & updateDevice) manage the attributes of the device, but the resource itself is never created or deleted. Although, that would be a pretty powerful operation if it could CREATE an MS355 out of thin air. Sign me up!
Dashboard claim and release operations are represented in API as functional resources, rather than CRUD operations, which is an accurate depiction of what's happening. Forcing functional operations into the format of a CRUD suite can be awkward at best and confusing at worst.
In short, not every REST operation is part of a CRUD suite! I hope this helps.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide