>> rpm -qa pulp-server
pulp-server-2.7.0-0.3.beta.el7.noarch
User creation with valid parameters:
curl -i -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X POST -k -u admin:admin -d '{"login":"test123", "password":"123456"}' "https://localhost/pulp/api/v2/users/"
HTTP/1.1 201 CREATED
Date: Fri, 26 Jun 2015 16:52:13 GMT
Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
Content-Length: 187
Location: https://localhost/pulp/api/v2/users/test123/
Content-Type: application/json
{"_id": {"$oid": "558d833ee512ed777daefd31"}, "name": "test123", "roles": [], "_ns": "users", "login": "test123", "id": "558d833ee512ed777daefd31", "_href": "/pulp/api/v2/users/test123/"}
User creation with a nonexisting parameter:
>> curl -i -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X POST -k -u admin:admin -d '{"invalid_parameter":"1234", "login":"user123", "password":"654321"}' "https://localhost/pulp/api/v2/users/"
HTTP/1.1 400 BAD REQUEST
Date: Fri, 26 Jun 2015 17:04:43 GMT
Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
Content-Encoding: utf-8
Content-Length: 422
Connection: close
Content-Type: application/json
{"http_request_method": "POST", "exception": null, "error_message": "Invalid properties: ['invalid_parameter']", "property_names": ["invalid_parameter"], "_href": "/pulp/api/v2/users/", "http_status": 400, "error": {"code": "PLP0015", "data": {"property_names": ["invalid_parameter"], "properties": "['invalid_parameter']"}, "description": "Invalid properties: ['invalid_parameter']", "sub_errors": []}, "traceback": null}
User update with not valid parameter:
curl -i -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X PUT -k -u admin:admin -d '{"delta":{"invalid": "1234"}}' "https://localhost/pulp/api/v2/users/barabashka/"
HTTP/1.1 400 BAD REQUEST
Date: Fri, 26 Jun 2015 18:51:55 GMT
Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
Content-Encoding: utf-8
Content-Length: 382
Connection: close
Content-Type: application/json
{"http_request_method": "PUT", "exception": null, "error_message": "Invalid properties: ['invalid']", "property_names": ["invalid"], "_href": "/pulp/api/v2/users/barabashka/", "http_status": 400, "error": {"code": "PLP0015", "data": {"property_names": ["invalid"], "properties": "['invalid']"}, "description": "Invalid properties: ['invalid']", "sub_errors": []}, "traceback": null}
Update of nonexisting user:
curl -i -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X PUT -k -u admin:admin -d '{"delta":{"invalid": "1234"}}' "https://localhost/pulp/api/v2/users/no_user/"
HTTP/1.1 404 NOT FOUND
Date: Fri, 26 Jun 2015 18:51:06 GMT
Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
Content-Encoding: utf-8
Content-Length: 388
Content-Type: application/json
{"http_request_method": "PUT", "exception": null, "error_message": "Missing resource(s): resource_id=no_user", "_href": "/pulp/api/v2/users/no_user/", "http_status": 404, "error": {"code": "PLP0009", "data": {"resources": {"resource_id": "no_user"}}, "description": "Missing resource(s): resource_id=no_user", "sub_errors": []}, "traceback": null, "resources": {"resource_id": "no_user"}}