From d2943d2592b2de98a59c44445c5cd2cc564740da Mon Sep 17 00:00:00 2001 From: Steve Martinelli Date: Thu, 8 Jan 2015 02:22:31 -0500 Subject: [PATCH] Command doc: access token Change-Id: I1b7103e28273f0a63c7d6b6003317b9e69702b05 --- doc/source/command-objects/access-token.rst | 42 +++++++++++++++++++++ doc/source/commands.rst | 2 +- openstackclient/identity/v3/token.py | 16 ++++---- 3 files changed, 50 insertions(+), 10 deletions(-) create mode 100644 doc/source/command-objects/access-token.rst diff --git a/doc/source/command-objects/access-token.rst b/doc/source/command-objects/access-token.rst new file mode 100644 index 0000000000..fd22e761f8 --- /dev/null +++ b/doc/source/command-objects/access-token.rst @@ -0,0 +1,42 @@ +============ +access token +============ + +Identity v3 + +`Requires: OS-OAUTH1 extension` + +access token create +------------------- + +Create an access token + +.. program:: access token create +.. code:: bash + + os access token create + --consumer-key + --consumer-secret + --request-key + --request-secret + --verifier + +.. option:: --consumer-key + + Consumer key (required) + +.. option:: --consumer-secret + + Consumer secret (required) + +.. option:: --request-key + + Request token to exchange for access token (required) + +.. option:: --request-secret + + Secret associated with (required) + +.. option:: --verifier + + Verifier associated with (required) diff --git a/doc/source/commands.rst b/doc/source/commands.rst index a4822c1996..3a7fdd231a 100644 --- a/doc/source/commands.rst +++ b/doc/source/commands.rst @@ -69,7 +69,7 @@ overlapping purposes there will be options to select which object to use, or the API resources will be merged, as in the ``quota`` object that has options referring to both Compute and Volume quotas. -* ``access token``: Identity - long-lived OAuth-based token +* ``access token``: (**Identity**) long-lived OAuth-based token * ``availability zone``: (**Compute**) a logical partition of hosts or volume services * ``aggregate``: (**Compute**) a grouping of servers * ``backup``: (**Volume**) a volume copy diff --git a/openstackclient/identity/v3/token.py b/openstackclient/identity/v3/token.py index bea2ddeb80..7000b62ce0 100644 --- a/openstackclient/identity/v3/token.py +++ b/openstackclient/identity/v3/token.py @@ -69,7 +69,7 @@ class AuthorizeRequestToken(show.ShowOne): class CreateAccessToken(show.ShowOne): - """Create access token""" + """Create an access token""" log = logging.getLogger(__name__ + '.CreateAccessToken') @@ -78,31 +78,31 @@ class CreateAccessToken(show.ShowOne): parser.add_argument( '--consumer-key', metavar='', - help='Consumer key', + help='Consumer key (required)', required=True ) parser.add_argument( '--consumer-secret', metavar='', - help='Consumer secret', + help='Consumer secret (required)', required=True ) parser.add_argument( '--request-key', metavar='', - help='Request token key', + help='Request token to exchange for access token (required)', required=True ) parser.add_argument( '--request-secret', metavar='', - help='Request token secret', + help='Secret associated with (required)', required=True ) parser.add_argument( '--verifier', metavar='', - help='Verifier Pin', + help='Verifier associated with (required)', required=True ) return parser @@ -114,9 +114,7 @@ class CreateAccessToken(show.ShowOne): parsed_args.consumer_key, parsed_args.consumer_secret, parsed_args.request_key, parsed_args.request_secret, parsed_args.verifier) - info = {} - info.update(access_token._info) - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(six.iteritems(access_token._info))) class CreateRequestToken(show.ShowOne):