Docs for GET /token

This commit is contained in:
Scott Schneider 2015-08-18 19:37:50 -07:00
parent 5ce08b907f
commit 3f83f52f90

27
API.md
View file

@ -6,20 +6,19 @@ vmpooler provides a REST API for VM management. The following examples use `cur
Token-based authentication can be used when requesting or modifying VMs. The `/token` route can be used to create, query, or delete tokens. See the provided YAML configuration example, [vmpooler.yaml.example](vmpooler.yaml.example), for information on configuring an authentication store to use when performing token operations. Token-based authentication can be used when requesting or modifying VMs. The `/token` route can be used to create, query, or delete tokens. See the provided YAML configuration example, [vmpooler.yaml.example](vmpooler.yaml.example), for information on configuring an authentication store to use when performing token operations.
##### GET /token/<token> ##### GET /token
Get information about an existing token. Get a list of issued tokens.
``` ```
$ curl -u jdoe --url vmpooler.company.com/token/utpg2i2xswor6h8ttjhu3d47z53yy47y $ curl -u jdoe --url vmpooler.company.com/token
Enter host password for user 'jdoe': Enter host password for user 'jdoe':
``` ```
```json ```json
{ {
"ok": true, "ok": true,
"utpg2i2xswor6h8ttjhu3d47z53yy47y": { "utpg2i2xswor6h8ttjhu3d47z53yy47y": {
"user": "jdoe", "created": "2015-04-28 19:17:47 -0700"
"timestamp": "2015-04-28 19:17:47 -0700"
} }
} }
``` ```
@ -39,6 +38,24 @@ Enter host password for user 'jdoe':
} }
``` ```
##### GET /token/<token>
Get information about an existing token.
```
$ curl -u jdoe --url vmpooler.company.com/token/utpg2i2xswor6h8ttjhu3d47z53yy47y
Enter host password for user 'jdoe':
```
```json
{
"ok": true,
"utpg2i2xswor6h8ttjhu3d47z53yy47y": {
"user": "jdoe",
"timestamp": "2015-04-28 19:17:47 -0700"
}
}
```
##### DELETE /token/<token> ##### DELETE /token/<token>
Delete an authentication token. Delete an authentication token.