Create, Update, and Delete¶
Create a User¶
Create a new user. User logins must be unique across all users.
/pulp/api/v2/users/- login (string) - unique login for the user 
- name (string) - (optional) name of the user 
- password (string) - (optional) password of the user used for authentication 
- 201 - if the user was successfully created 
- 400 - if one or more of the parameters is invalid 
- 409 - if there is already a user with the given login 
Sample Request:
{
 "login": "test-login",
 "password": "test-password",
 "name": "test name"
}
Sample 201 Response Body:
{
 "name": "test name",
 "roles": [],
 "_ns": "users",
 "login": "test-login",
 "_id": {
   "$oid": "502c83f6e5e7100b0a000035"
 },
 "id": "502c83f6e5e7100b0a000035",
 "_href": "/pulp/api/v2/users/test-login/"
}
Update a User¶
The update user call is used to change the details of an existing consumer.
/pulp/api/v2/users/<user_login>/delta. The contents of delta are the values to update. Only changed
parameters need be specified. The following keys are allowed in the delta
object. Descriptions for each parameter can be found under the create
user API:- password 
- name 
- roles (array) - (optional) array of roles to update the user to. In this case, relevant permissions for the user will be updated as well. 
- 200 - if the update was executed and successful 
- 404 - if there is no user with the given login 
- 400 - if one or more of the parameters is invalid 
Sample Request:
{
 "delta": {"name": "new name", "password": "new-password"}
}
Sample 200 Response Body:
{
 "name": "new name",
 "roles": [],
 "_ns": "users",
 "login": "test-login",
 "_id": {
   "$oid": "502c83f6e5e7100b0a000035"
 },
 "id": "502c83f6e5e7100b0a000035"
}
Delete a User¶
Deletes a user from the Pulp server. Permissions granted to the user are revoked as well.
/pulp/api/v2/users/<user_login>/- 200 - if the user was successfully deleted 
- 400 - if the user cannot be deleted because it is the last super user 
- 404 - if there is no user with the given login