Users

Navigation:  Billing Integration (Supported Systems) > Billing API >

Users

Previous pageReturn to chapter overviewNext page

Requests for working with users:

 

create a user:

 

request:

 

POST https://kuberdock.master/api/users/all

 

json data:

 

{

“first_name”: “user_first_name”,

“last_name”: “user_last_name”,

“middle_initials”: “user_middle_initials”,

“username”: “username”,

“active”: “true”, // or “false” equal “Locked” in web-interface

“suspended”: false, // can be true or false

“email”: “[email protected]”,

“password”: “user_password”,

“role”: “role_name”, // see predefined user roles

“package” : “package_name”

}

 

response:

 

if user data succeed:

 

{

“result”: “OK”,

}

 

otherwise:

 

{

“result”: “error”,

“message”: “...”

}

 

update a user:

 

Note. You can change several user's fields in one request.

 

request:

 

PUT https://kuberdock.master/api/users/all/<username>

 

json data:

 

{

“first_name”: “new_user_firstname”

“last_name”: “new_user_lastname”

}

 

response:

 

if user data succeed

 

{

“result”: “success”

}

 

otherwise

 

{

“result”: “error”,

“message”: “...”

}

 

User update includes suspending this user for the time of changing his/her “active” state from True to False and vice versa, and accordingly stopping all his/her containers.

 

get user token to login to KuberDock:

 

request:

 

curl -k -s -u <username>:<password> “https://kuberdock.master/api/auth/token"

 

result:

 

{

"status": "OK",

"token": "token"

}

 

token usage:

 

curl -k -s "https://kuberdock.master/api/users/all?token=<token>"

 

get user info:

 

request:

 

GET https://kuberdock.master/api/users/all/<username>

 

response:

 

if success user data

 

{

“result”: “success”,

“data”:

{

“first_name”: “John”,

“last_name”: “Smith”,

...}}

 

otherwise:

 

{

“result”: “error”,

“message”: “...”

}

 

get all users info:

 

request:

 

GET https://kuberdock.master/api/users/all

 

response:

 

if success user data

 

{

“result”: “success”,

“data”:

[{

“first_name”: “John”,

“last_name”: “Smith”,...},

{“first_name”: “Jack”,

“last_name”: “Doe”,...},

… }]

 

otherwise

 

{

“result”: “error”,

“message”: “...”

}