mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 10:08:40 -05:00
Docs for GET /token
This commit is contained in:
parent
5ce08b907f
commit
3f83f52f90
1 changed files with 32 additions and 15 deletions
47
API.md
47
API.md
|
|
@ -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.
|
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 /token/<token>
|
||||||
|
|
||||||
Get information about an existing 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 /token/<token>
|
||||||
|
|
||||||
Delete an authentication token.
|
Delete an authentication token.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue