[openstack-dev] [api][neutron] question on putting an existing tag
sean at dague.net
Fri Feb 26 16:02:22 UTC 2016
On 02/26/2016 10:52 AM, Chris Dent wrote:
> On Fri, 26 Feb 2016, Jay Pipes wrote:
>> On 02/26/2016 09:02 AM, Akihiro Motoki wrote:
>>> We can create a tag by PUT'ing an individual tag:
>>> What status code should be returned if a requested tag already exists?
>>> PUT /servers/1234567890/tags/qux
>>> The guideline defines 201 (+ Location header) on success.
>>> In the current neutron implementation proposed, 409 is returned
>>> when a requested tag already exists.
>> 409 Conflict.
> /me gets some paint
> Stricly speaking, PUT should be idempotent so every time you put a
> qux tag on 123456789 it should return (the same) 2xx.
> In the real world things get messy and some implementations return
> 201 on create and some other 2xx when it is already there. It
> shouldn't be an error though.
> The time a 409 might be reasonable is if via a header, like an ETag,
> we have declared that qux must have a certain state before we accept
> a PUT of it.
> In some implementations things like 'Etag: 0' are used to say "Only
> let this PUT happen if it is a create." That's a bit of a hack but
> is useful.
Agree. PUT is an update. The should be no issue updating an existing
tag. That should be success
Adding a tag should really be semantically:
to create tags and
PUT /servers/1234567890/tags/qux to update them
You should not PUT to any url that you can't GET. And it looks like GET
/servers/1234567890/tags/qux would be a 404 here.
More information about the OpenStack-dev