Represents individual user on VirtShell.
Method | HTTP request | Description |
---|---|---|
get | GET | /users/:name |
create | POST | /users/ |
list | GET | /users |
delete | DELETE | /users/:name |
update | PUT | /users/:name |
Note: URIs relative to https://www.yourhostname.com/api/virtshell/v1, unless otherwise noted.
{
"uuid": "ab8076c0-db91-11e2-82ce-0002a5d5c51b",
"username": "virtshell",
"type": "system/regular",
"login": "user@mail.com",
"groups": [ {"name": "web_development_team"},
{"name": "production"}
],
"created": {"at":"1429207233", "by":"92d30f0c-8c9c-11e5-8994-feff819cdc9f"},
"modified": {"at":"1529207233", "by":"92d31132-8c9c-11e5-8994-feff819cdc9f"}
}
###Examples###
Create a new user.
curl -sv -X POST \
-H 'accept: application/json' \
-H 'X-VirtShell-Authorization: UserId:Signature' \
-d '{
"username": "virtshell",
"type": "system/regular",
"login": "user@mail.com",
"groups": [
{"name": "web_development_team"},
{"name": "production"}
]
}' \
'http://localhost:8080/api/virtshell/v1/users'
Response:
HTTP/1.1 200 OK
Content-Type: application/json
{ "create": "success" }
Get all users.
curl -sv -H 'accept: application/json'
-H 'X-VirtShell-Authorization: UserId:Signature' \
'http://localhost:8080/api/virtshell/v1/users'
Response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"users": [
{
"uuid": "ab8076c0-db91-11e2-82ce-0002a5d5c51b",
"username": "virtshell",
"type": "system",
"login": "virtshell@mail.com",
"groups": [ {"name": "web_development_team"},
{"name": "production"}
],
"created": {"at":"1429207233", "by":"92d30f0c-8c9c-11e5-8994-feff819cdc9f"},
"modified": {"at":"1529207233", "by":"92d31132-8c9c-11e5-8994-feff819cdc9f"}
},
{
"uuid": "1fcc7ee8-8c9d-11e5-8994-feff819cdc9f",
"username": "demouser",
"type": "regular",
"login": "demo@gmail.com",
"groups": [ {"name": "production"}],
"created": {"at":"1431799233", "by":"1fcc8294-8c9d-11e5-8994-feff819cdc9f"},
"modified": {"at":"1432836033", "by":"F2d31132-8c9c-11e5-D994-eeff819cdc9f"}
}
]
}
Get an user by nam.
curl -sv -H 'accept: application/json'
-H 'X-VirtShell-Authorization: UserId:Signature' \
'http://<host>:<port>/api/virtshell/v1/users/virtshell'
Response:
HTTP/1.1 200 OK
Content-Type: application/json
```json
{
"uuid": "ab8076c0-db91-11e2-82ce-0002a5d5c51b",
"username": "virtshell",
"type": "system",
"login": "virtshell@mail.com",
"groups": [ {"name": "web_development_team"},
{"name": "production"}
],
"created": {"at":"1429207233", "by":"92d30f0c-8c9c-11e5-8994-feff819cdc9f"},
"modified": {"at":"1529207233", "by":"92d31132-8c9c-11e5-8994-feff819cdc9f"}
}
Delete an existing user.
curl -sv -X DELETE \
-H 'accept: application/json' \
-H 'X-VirtShell-Authorization: UserId:Signature' \
'http://<host>:<port>/api/virtshell/v1/users/virtshell'
Response:
HTTP/1.1 200 OK
Content-Type: application/json
{ "delete": "success" }
`PUT /api/virtshell/v1/users/:name`
----------------------------------------------
Update an existing user.
```sh
curl -sv -X PUT \
-H 'accept: application/json' \
-H 'X-VirtShell-Authorization: UserId:Signature' \
-d '{"type": "user"}' \
'http://localhost:8080/api/virtshell/v1/users/virtshell'
Response:
HTTP/1.1 200 OK
Content-Type: application/json
{ "update": "success" }