Comment 0 for bug 1507990

I created a queue with name "samplequeue1one" as below -

stack@qaas-02:~$ curl -i -X PUT http://localhost:8888/v1.1/queues/samplequeue1one -H "Content-type: application/json" -H "Client-ID: 318e462e-598e-4840-a6a5-9ea96f082933" -H "X-Project-Id: 3b57f8a7b5ef45b8bf20e91eefed9f52" -H "X-Auth-Token: $TOKENID"
HTTP/1.0 201 Created
Date: Tue, 20 Oct 2015 10:20:02 GMT
Server: WSGIServer/0.1 Python/2.7.6
content-length: 0
location: /v1.1/queues/samplequeue1one
stack@qaas-02:~$

When I rerun the above curl command again with same queue name, it gives HTTP Response Code "204 No Content", which is wrong! This error code is used only if server successfully processed the request, but is not returning any content!

stack@qaas-02:~$ curl -i -X PUT http://localhost:8888/v1.1/queues/samplequeue1one -H "Content-type: application/json" -H "Client-ID: 318e462e-598e-4840-a6a5-9ea96f082933" -H "X-Project-Id: 3b57f8a7b5ef45b8bf20e91eefed9f52" -H "X-Auth-Token: $TOKENID"
HTTP/1.0 204 No Content
Date: Tue, 20 Oct 2015 10:20:17 GMT
Server: WSGIServer/0.1 Python/2.7.6
location: /v1.1/queues/samplequeue1one
Content-Length: 0
stack@qaas-02:~$

But here, zaqar won't process the request successfully becoz queue name already exist and it won't do any changes for existing one.

Whenever zaqar finds a queue name with existing one, it has to respond user with HTTP Response Code - "409"

# 409 Conflict
Details: Indicates that the request could not be processed because of conflict in the request, such as an edit conflict in the case of multiple updates.

When user gets "409 Conflict" response code then it is meant to try with different queue name.