From 3f83f52f905dcaccc907dedf339be42c7ceb938b Mon Sep 17 00:00:00 2001 From: Scott Schneider Date: Tue, 18 Aug 2015 19:37:50 -0700 Subject: [PATCH] Docs for GET /token --- API.md | 47 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/API.md b/API.md index 521514c..0daf18e 100644 --- a/API.md +++ b/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. +##### 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.