[openstack-dev] [nova] Should PUT /os-services be idempotent?

Matt Riedemann mriedemos at gmail.com
Wed Jul 12 01:18:29 UTC 2017


I'm looking for some broader input on something being discussed in this 
change:

https://review.openstack.org/#/c/464280/21/nova/api/openstack/compute/services.py

This is collapsing the following APIs into a single API:

Old:

* PUT /os-services/enable
* PUT /os-services/disable
* PUT /os-services/disable-log-reason
* PUT /os-services/force-down

New:

* PUT /os-services

With the old APIs, if you tried to enable and already enabled service, 
it was not an error. The same is you tried to disable an already 
disabled service. It doesn't change anything, but it's not an error.

The question is coming up in the new API if trying to enable an enabled 
service should be a 400, or trying to disable a disabled service. The 
way I wrote the new API, those are no 400 conditions. They don't do 
anything, like before, but they aren't errors.

Looking at [1] it seems this should not be an error condition if you're 
trying to update the state of a resource and it's already at that state.

I don't have a PhD in REST though so would like broader discussion on this.

[1] http://www.restapitutorial.com/lessons/idempotency.html

-- 

Thanks,

Matt



More information about the OpenStack-dev mailing list