zaqar should return appropriate http response code for existing queue name scenario

Bug #1507990 reported by Venkata Mahesh Jonnalagadda on 2015-10-20
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
zaqar
Undecided
Unassigned

Bug Description

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.

2xx series are for Success

It would be nice to use appropriate http status code for this type of scenarios.

summary: - zzaqar should return 409 http response code for existing queue name
+ zaqar should return 409 http response code for existing queue name
summary: - zaqar should return 409 http response code for existing queue name
+ zaqar should return appropriate http response code for existing queue
+ name scenario
description: updated
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers