zaqar should return appropriate http response code for existing pool name scenario
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
zaqar |
New
|
Undecided
|
Unassigned |
Bug Description
I created a pool with name "wat" as below -
stack@qaas-
HTTP/1.0 201 Created
Date: Mon, 19 Oct 2015 13:41:27 GMT
Server: WSGIServer/0.1 Python/2.7.6
content-length: 0
location: /v1.1/pools/wat
stack@qaas-
When I rerun the above curl command again with same pool name, it gives HTTP Response Code "201 Created", which is wrong! It shouldn't do this! and It is updating the pool again!
Whenever zaqar finds a pool name with existing pool, 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 pool name.
2xx series are for Success
It would be nice to use appropriate http status code for this type of scenarios.
summary: |
- zaqar should return 204 http response code for existing pool name while + zaqar should return 409 http response code for existing pool name while creating again |
summary: |
- zaqar should return 409 http response code for existing pool name while - creating again + zaqar should return 409 http response code for existing pool name |
description: | updated |
summary: |
- zaqar should return 409 http response code for existing pool name + zaqar should return appropriate http response code for existing pool + name scenario |