Need to address duplicate user creation in a given project, so returns 409 instead of 500. However same user name in different projects is allowed (but not yet tested).
$ craton-post v1/projects name=baz HTTP/1.0 201 CREATED Content-Length: 155 Content-Type: application/json Date: Tue, 21 Mar 2017 15:34:24 GMT Location: http://127.0.0.1:7780/v1/projects/289b9377-8470-43e2-bc45-04f730ddc248 Server: WSGIServer/0.2 CPython/3.5.2 x-openstack-request-id: req-535dcb02-5687-40a2-98f1-bd6549f9151a
{ "created_at": "2017-03-21T15:34:24.824411", "id": "289b9377-8470-43e2-bc45-04f730ddc248", "name": "baz", "updated_at": null, "variables": {} }
$ craton-post v1/users username=bar project_id=289b9377-8470-43e2-bc45-04f730ddc248 HTTP/1.0 201 CREATED Content-Length: 248 Content-Type: application/json Date: Tue, 21 Mar 2017 15:34:45 GMT Location: http://127.0.0.1:7780/v1/users/4 Server: WSGIServer/0.2 CPython/3.5.2 x-openstack-request-id: req-68ebb2db-6c95-4ed9-8970-0655cf195d77
{ "api_key": "fba5c972-2d81-43e7-890c-bea823d74b1b", "created_at": "2017-03-21T15:34:45.392952", "id": 4, "is_admin": false, "project_id": "289b9377-8470-43e2-bc45-04f730ddc248", "roles": [], "updated_at": null, "username": "bar" }
$ craton-post v1/users username=bar project_id=289b9377-8470-43e2-bc45-04f730ddc248 HTTP/1.0 500 INTERNAL SERVER ERROR Content-Length: 50 Content-Type: text/html; charset=utf-8 Date: Tue, 21 Mar 2017 15:34:51 GMT Server: WSGIServer/0.2 CPython/3.5.2 x-openstack-request-id: req-9884d8e6-56f5-4a29-9c3d-258e43e93a79
{ "message": "Unknown Error", "status": 500 }
Need to address duplicate user creation in a given project, so returns 409 instead of 500. However same user name in different projects is allowed (but not yet tested).
$ craton-post v1/projects name=baz 127.0.0. 1:7780/ v1/projects/ 289b9377- 8470-43e2- bc45-04f730ddc2 48 request- id: req-535dcb02- 5687-40a2- 98f1-bd6549f915 1a
HTTP/1.0 201 CREATED
Content-Length: 155
Content-Type: application/json
Date: Tue, 21 Mar 2017 15:34:24 GMT
Location: http://
Server: WSGIServer/0.2 CPython/3.5.2
x-openstack-
{ 21T15:34: 24.824411" , 8470-43e2- bc45-04f730ddc2 48",
"created_at": "2017-03-
"id": "289b9377-
"name": "baz",
"updated_at": null,
"variables": {}
}
$ craton-post v1/users username=bar project_ id=289b9377- 8470-43e2- bc45-04f730ddc2 48 127.0.0. 1:7780/ v1/users/ 4 request- id: req-68ebb2db- 6c95-4ed9- 8970-0655cf195d 77
HTTP/1.0 201 CREATED
Content-Length: 248
Content-Type: application/json
Date: Tue, 21 Mar 2017 15:34:45 GMT
Location: http://
Server: WSGIServer/0.2 CPython/3.5.2
x-openstack-
{ 2d81-43e7- 890c-bea823d74b 1b", 21T15:34: 45.392952" , 8470-43e2- bc45-04f730ddc2 48",
"api_key": "fba5c972-
"created_at": "2017-03-
"id": 4,
"is_admin": false,
"project_id": "289b9377-
"roles": [],
"updated_at": null,
"username": "bar"
}
$ craton-post v1/users username=bar project_ id=289b9377- 8470-43e2- bc45-04f730ddc2 48 request- id: req-9884d8e6- 56f5-4a29- 9c3d-258e43e93a 79
HTTP/1.0 500 INTERNAL SERVER ERROR
Content-Length: 50
Content-Type: text/html; charset=utf-8
Date: Tue, 21 Mar 2017 15:34:51 GMT
Server: WSGIServer/0.2 CPython/3.5.2
x-openstack-
{
"message": "Unknown Error",
"status": 500
}