Skip to content

Commit 4f1ebe8

Browse files
author
Dean Troyer
committed
Update docs for plugins and release notes
* Fill out the existing command and man page * Add a plugins page. * Begin the release notes for 0.3.0 Change-Id: I4527fed28a10a9d79fc8f6c1d925a4bf0d0a7a36
1 parent e06e1a2 commit 4f1ebe8

5 files changed

Lines changed: 146 additions & 19 deletions

File tree

‎doc/source/commands.rst‎

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,37 @@ OpenStackClient has a consistent and predictable format for all of its commands.
1010

1111
Commands take the form::
1212

13-
openstack [<global-options>] <object> <action> [<second-object>] [<command-arguments>]
13+
openstack [<global-options>] <object-1> <action> [<object-2>] [<command-arguments>]
1414

15-
* All long options names begin with two dashes ('--') and use a single dash ('-') internally between words (--like-this)
15+
* All long options names begin with two dashes ('--') and use a single dash
16+
('-') internally between words (--like-this). Underscores ('_') are not used
17+
in option names.
1618

1719

1820
Global Options
1921
--------------
2022

21-
Global options are global in the sense that the apply to every command invocation regardless of action to be performed. This includes authentication credentials and API version selection. Most global options have a corresponding environment variable that may also be used to set the value. If both are present, the command-line option takes priority. The environment variable names are derived from the option name by dropping the leading dashes ('--'), converting each embedded dash ('-') to an underscore ('_'), and converting to upper case.
23+
Global options are global in the sense that they apply to every command
24+
invocation regardless of action to be performed. They include authentication
25+
credentials and API version selection. Most global options have a corresponding
26+
environment variable that may also be used to set the value. If both are
27+
present, the command-line option takes priority. The environment variable
28+
names are derived from the option name by dropping the leading dashes ('--'),
29+
converting each embedded dash ('-') to an underscore ('_'), and converting
30+
to upper case.
2231

2332
For example, ``--os-username`` can be set from the environment via ``OS_USERNAME``.
2433

2534

2635
Command Object(s) and Action
2736
----------------------------
2837

29-
Commands consist of an object described by one or more words followed by an action.
30-
In commands requiring two objects be acted upon, the primary object appears ahead of the action and the secondary object appears after the action.
31-
If both objects have cooresponding positional arguments the arguments appear in the same order as the objects. In badly formed English it is expressed as "(Take) object1 (and perform) action (using) object2 (to it)."
38+
Commands consist of an object described by one or more words followed by
39+
an action. Commands that require two objects have the primary object ahead
40+
of the action and the secondary object after the action. Any positional
41+
arguments identifying the objects shall appear in the same order as the
42+
objects. In badly formed English it is expressed as "(Take) object1
43+
(and perform) action (using) object2 (to it)."
3244

3345
::
3446

@@ -44,22 +56,23 @@ Examples::
4456
Command Arguments and Options
4557
-----------------------------
4658

47-
Commands have their own set of options distinct from the global options. They follow the
48-
same style as the global options and always appear between the command and any positional arguemnts the command may require.
59+
Each command may have its own set of options distinct from the global options.
60+
They follow the same style as the global options and always appear between
61+
the command and any positional arguments the command requires.
4962

5063

5164
Implementation
5265
==============
5366

54-
The command structure is designed to support seamless addition of extension
55-
command modules via entry points. The extensions are assumed to be subclasses
56-
of Cliff's command.Command object.
67+
The command structure is designed to support seamless addition of plugin
68+
command modules via ``setuptools`` entry points. The plugin commands must
69+
be subclasses of Cliff's command.Command object.
5770

5871

5972
Command Entry Points
6073
--------------------
6174

62-
Commands are added to the client using setuptools's entry points in ``setup.cfg``.
75+
Commands are added to the client using ``setuptools`` entry points in ``setup.cfg``.
6376
There is a single common group ``openstack.cli`` for commands that are not versioned,
6477
and a group for each combination of OpenStack API and version that is
6578
supported. For example, to support Identity API v3 there is a group called

‎doc/source/index.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Contents:
1212

1313
releases
1414
commands
15+
plugins
1516
man/openstack
1617

1718
Getting Started

‎doc/source/man/openstack.rst‎

Lines changed: 62 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
=========
1+
====================
22
:program:`openstack`
3-
=========
3+
====================
44

5+
OpenStack Command Line
56

67
SYNOPSIS
78
========
@@ -10,6 +11,7 @@ SYNOPSIS
1011

1112
:program:`openstack help` <command>
1213

14+
:program:`openstack` --help
1315

1416

1517
DESCRIPTION
@@ -21,9 +23,8 @@ a distinct and consistent command structure.
2123

2224
:program:`openstack` uses a similar authentication scheme as the OpenStack project CLIs, with
2325
the credential information supplied either as environment variables or as options on the
24-
command line. The primary difference is a preference for using
25-
``OS_PROJECT_NAME``/``OS_PROJECT_ID`` over the old tenant-based names. The old names work
26-
for now though.
26+
command line. The primary difference is the use of 'project' in the name of the options
27+
``OS_PROJECT_NAME``/``OS_PROJECT_ID`` over the old tenant-based names.
2728

2829
::
2930

@@ -57,7 +58,22 @@ OPTIONS
5758
Authentication region name
5859

5960
:option:`--os-default-domain <auth-domain>`
60-
Default domain ID (defaults to 'default')
61+
Default domain ID (Default: 'default')
62+
63+
:options:`--os-use-keyring`
64+
Use keyring to store password (default: False)
65+
66+
:option:`--os-cacert <ca-bundle-file>`
67+
CA certificate bundle file
68+
69+
:option:`--verify|--insecure`
70+
Verify or ignore server certificate (default: verify)
71+
72+
:option:`--os-identity-api-version <identity-api-version>`
73+
Identity API version (Default: 2.0)
74+
75+
:option:`--os-XXXX-api-version <XXXX-api-version>`
76+
Additional API version options will be presend depending on the installed API libraries.
6177

6278

6379
NOTES
@@ -78,6 +94,35 @@ To get a description of a specific command::
7894
openstack help <command>
7995

8096

97+
:option:`complete`
98+
Print the bash completion functions for the current command set.
99+
100+
:option:`help <command>`
101+
Print help for an individual command
102+
103+
104+
EXAMPLES
105+
========
106+
107+
Show the detailed information for server ``appweb01``::
108+
109+
openstack --os-tenant-name ExampleCo --os-username demo --os-password secrete --os-auth-url http://localhost:5000:/v2.0 server show appweb01
110+
111+
The same command if the auth environment variables (:envvar:`OS_AUTH_URL`, :envvar:`OS_PROJECT_NAME`,
112+
:envvar:`OS_USERNAME`, :envvar:`OS_PASSWORD`) are set::
113+
114+
openstack server show appweb01
115+
116+
Create a new image::
117+
118+
openstack image create \
119+
--disk-format=qcow2 \
120+
--container-format=bare \
121+
--public \
122+
--copy-from http://somewhere.net/foo.img \
123+
foo
124+
125+
81126
FILES
82127
=====
83128

@@ -95,6 +140,12 @@ The following environment variables can be set to alter the behaviour of :progra
95140
:envvar:`OS_PASSWORD`
96141
Set the password
97142

143+
:envvar:`OS_PROJECT_NAME`
144+
Set the project name
145+
146+
:envvar:`OS_AUTH_URL`
147+
Set the authentication URL
148+
98149

99150
BUGS
100151
====
@@ -124,4 +175,8 @@ http://www.apache.org/licenses/LICENSE-2.0
124175
SEE ALSO
125176
========
126177

127-
The OpenStack project CLIs, the OpenStack API references. <links TBD>
178+
The `OpenStackClient page <https://wiki.openstack.org/wiki/OpenStackClient>`_
179+
in the `OpenStack Wiki <https://wiki.openstack.org/>`_ contains further
180+
documentation.
181+
182+
The individual OpenStack project CLIs, the OpenStack API references.

‎doc/source/plugins.rst‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
=======
2+
Plugins
3+
=======
4+
5+
The OpenStackClient plugin system is designed so that the plugin need only be
6+
properly installed for OSC to find and use it. It utilizes the
7+
``setuptools`` entry points mechanism to advertise to OSC the
8+
plugin module and supported commands.
9+
10+
Implementation
11+
--------------
12+
13+
Plugins are discovered by enumerating the entry points
14+
found under ``openstack.cli.extension`` and initializing the specified
15+
client module.
16+
17+
::
18+
19+
[entry_points]
20+
openstack.cli.extension =
21+
oscplugin = oscplugin.client
22+
23+
The client module must implement the following interface functions:
24+
25+
* ``API_NAME`` - A string containing the plugin API name; this is
26+
the name of the entry point declaring the plugin client module
27+
(``oscplugin = ...`` in the example above) and the group name for
28+
the plugin commands (``openstack.oscplugin.v1 =`` in the example below)
29+
* ``API_VERSION_OPTION`` (optional) - If set, the name of the API
30+
version attribute; this must be a valid Python identifier and
31+
match the destination set in ``build_option_parser()``.
32+
* ``API_VERSIONS`` - A dict mapping a version string to the client class
33+
* ``build_option_parser(parser)`` - Hook to add global options to the parser
34+
* ``make_client(instance)`` - Hook to create the client object
35+
36+
OSC enumerates the plugin commands from the entry points in the usual manner
37+
defined for the API version:
38+
39+
::
40+
41+
openstack.oscplugin.v1 =
42+
plugin_list = oscplugin.v1.plugin:ListPlugin
43+
plugin_show = oscplugin.v1.plugin:ShowPlugin
44+
45+
Note that OSC defines the group name as ``openstack.<api-name>.v<version>``
46+
so the version should not contain the leading 'v' character.

‎doc/source/releases.rst‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22
Release Notes
33
=============
44

5+
0.3.0 (xx Dec 2013)
6+
===================
7+
8+
* add new command plugin structure
9+
* complete converting base test classes
10+
* add options to support TLS cetificate verification
11+
* add object-store show commands for container and object
12+
13+
.. commented to save format of bug fix
14+
.. * 1254168_: OS_REGION_NAME is not used
15+
.. _1254168: https://bugs.launchpad.net/python-openstackclient/+bug/1254168
16+
517
0.2.2 (20 Sep 2013)
618
===================
719

0 commit comments

Comments
 (0)