Docs for GET /token

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

47
API.md
View file

@ -6,6 +6,38 @@ 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.
##### GET /token
Get a list of issued tokens.
```
$ curl -u jdoe --url vmpooler.company.com/token
Enter host password for user 'jdoe':
```
```json
{
"ok": true,
"utpg2i2xswor6h8ttjhu3d47z53yy47y": {
"created": "2015-04-28 19:17:47 -0700"
}
}
```
##### POST /token
Generate a new authentication token.
```
$ curl -X POST -u jdoe --url vmpooler.company.com/token
Enter host password for user 'jdoe':
```
```json
{
"ok": true,
"token": "utpg2i2xswor6h8ttjhu3d47z53yy47y"
}
```
##### GET /token/<token>
Get information about an existing token.
@ -24,21 +56,6 @@ Enter host password for user 'jdoe':
}
```
##### POST /token
Generate a new authentication token.
```
$ curl -X POST -u jdoe --url vmpooler.company.com/token
Enter host password for user 'jdoe':
```
```json
{
"ok": true,
"token": "utpg2i2xswor6h8ttjhu3d47z53yy47y"
}
```
##### DELETE /token/<token>
Delete an authentication token.