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

Ghanshyam Mann ghanshyammann at gmail.com
Wed Jul 12 13:34:59 UTC 2017


On Wed, Jul 12, 2017 at 11:20 AM, Ed Leafe <ed at leafe.com> wrote:
> On Jul 11, 2017, at 8:18 PM, Matt Riedemann <mriedemos at gmail.com> wrote:
>
>> 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.
>
> These should not be errors. You are calling the API to set a particular condition. The result of that call is that the service is in that condition. That should be a 2xx, most likely a 204. So yeah, it should be idempotent.

My vote also to make(keep) it idempotent but with status code. if it
return 200 then on second call on same status should be 200 with same
response body otherwise API become difficult to use.


-gmann

>
> -- Ed Leafe
>
>
>
>
>
>
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>



More information about the OpenStack-dev mailing list