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.
I created a pool with name "wat" as below -
stack@qaas- 02:~/zaqar$ curl -i -X PUT http:// localhost: 8888/v1. 1/pools/ wat -d '{"weight": 100, "uri": "mongodb: //127.0. 0.1:27017" , "options": {"max_retry_sleep": 1}}' -H "Content-type: application/json" -H "Client-ID: 318e462e- 598e-4840- a6a5-9ea96f0829 33" -H "X-Auth-Token: $TOKENID" 02:~/zaqar$
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.