From 254910d3ce34c954551a0827aa8727d6367f48f3 Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Mon, 17 Nov 2014 16:42:30 -0600 Subject: [PATCH] Begin copying wiki command list here * Sort by command objects * Drop the comparison to the project CLIs * Minor updates to command help to match docs Initially include the cross-API commands to establish the structure and format. Change-Id: I77a7b3c89e088b66aa62941e29ce0b65b532285b --- doc/source/command-list.rst | 9 ++ doc/source/command-objects/extension.rst | 41 ++++++ doc/source/command-objects/limits.rst | 28 ++++ doc/source/command-objects/quota.rst | 157 ++++++++++++++++++++++ doc/source/commands.rst | 14 +- doc/source/index.rst | 1 + doc/source/releases.rst | 2 +- openstackclient/common/extension.py | 12 +- openstackclient/common/quota.py | 2 +- openstackclient/identity/v2_0/endpoint.py | 2 +- 10 files changed, 250 insertions(+), 18 deletions(-) create mode 100644 doc/source/command-list.rst create mode 100644 doc/source/command-objects/extension.rst create mode 100644 doc/source/command-objects/limits.rst create mode 100644 doc/source/command-objects/quota.rst diff --git a/doc/source/command-list.rst b/doc/source/command-list.rst new file mode 100644 index 0000000000..c4045b0406 --- /dev/null +++ b/doc/source/command-list.rst @@ -0,0 +1,9 @@ +============ +Command List +============ + +.. toctree:: + :glob: + :maxdepth: 2 + + command-objects/* diff --git a/doc/source/command-objects/extension.rst b/doc/source/command-objects/extension.rst new file mode 100644 index 0000000000..8f39a62529 --- /dev/null +++ b/doc/source/command-objects/extension.rst @@ -0,0 +1,41 @@ +========= +extension +========= + +Many OpenStack server APIs include API extensions that enable +additional functionality. + +extension list +-------------- + +List API extensions + +.. program:: extension list +.. code:: bash + + os extension list + [--compute] + [--identity] + [--network] + [--volume] + [--long] + +.. option:: --compute + + List extensions for the Compute API + +.. option:: --identity + + List extensions for the Identity API + +.. option:: --network + + List extensions for the Network API + +.. option:: --volume + + List extensions for the Volume API + +.. option:: --long + + List additional fields in output diff --git a/doc/source/command-objects/limits.rst b/doc/source/command-objects/limits.rst new file mode 100644 index 0000000000..ac388e0f56 --- /dev/null +++ b/doc/source/command-objects/limits.rst @@ -0,0 +1,28 @@ +====== +limits +====== + +The Compute and Volume APIs have resource usage limits. + +limits show +----------- + +Show compute and volume limits + +.. program:: limits show +.. code:: bash + + os limits show + --absolute [--reserved] | --rate + +.. option:: --absolute + + Show absolute limits + +.. option:: --rate + + Show rate limits + +.. option:: --reserved + + Include reservations count [only valid with :option:`--absolute`] diff --git a/doc/source/command-objects/quota.rst b/doc/source/command-objects/quota.rst new file mode 100644 index 0000000000..ba6712c083 --- /dev/null +++ b/doc/source/command-objects/quota.rst @@ -0,0 +1,157 @@ +===== +quota +===== + +Resource quotas appear in multiple APIs, OpenStackClient presents them as a single object with multiple properties. + +quota set +--------- + +Set quotas for project + +.. program:: quota set +.. code:: bash + + os quota set + # Compute settings + [--cores ] + [--fixed-ips ] + [--floating-ips ] + [--injected-file-size ] + [--injected-files ] + [--instances ] + [--key-pairs ] + [--properties ] + [--ram ] + + # Volume settings + [--gigabytes ] + [--snapshots ] + [--volumes ] + + + +Set quotas for class + +.. code:: bash + + os quota set + --class + # Compute settings + [--cores ] + [--fixed-ips ] + [--floating-ips ] + [--injected-file-size ] + [--injected-files ] + [--instances ] + [--key-pairs ] + [--properties ] + [--ram ] + + # Volume settings + [--gigabytes ] + [--snapshots ] + [--volumes ] + + + +.. option:: --class + + Set quotas for ```` + +.. option:: --properties + + New value for the properties quota + +.. option:: --ram + + New value for the ram quota + +.. option:: --secgroup-rules + + New value for the secgroup-rules quota + +.. option:: --instances + + New value for the instances quota + +.. option:: --key-pairs + + New value for the key-pairs quota + +.. option:: --fixed-ips + + New value for the fixed-ips quota + +.. option:: --secgroups + + New value for the secgroups quota + +.. option:: --injected-file-size + + New value for the injected-file-size quota + +.. option:: --floating-ips + + New value for the floating-ips quota + +.. option:: --injected-files + + New value for the injected-files quota + +.. option:: --cores + + New value for the cores quota + +.. option:: --injected-path-size + + New value for the injected-path-size quota + +.. option:: --gigabytes + + New value for the gigabytes quota + +.. option:: --volumes + + New value for the volumes quota + +.. option:: --snapshots + + New value for the snapshots quota + +quota show +---------- + +Show quotas for project + +.. program:: quota show +.. code:: bash + + os quota show + [--default] + + + +.. option:: --default + + Show default quotas for :ref:`\ ` + +.. _quota_show-project: +.. describe:: + + Show quotas for class + +.. code:: bash + + os quota show + --class + + +.. option:: --class + + Show quotas for :ref:`\ ` + +.. _quota_show-class: +.. describe:: + + Class to show \ No newline at end of file diff --git a/doc/source/commands.rst b/doc/source/commands.rst index 8857f3d55d..37c62e8ec3 100644 --- a/doc/source/commands.rst +++ b/doc/source/commands.rst @@ -1,8 +1,4 @@ -======== -Commands -======== - - +================= Command Structure ================= @@ -83,7 +79,7 @@ referring to both Compute and Volume quotas. * ``credential``: Identity - specific to identity providers * ``domain``: Identity - a grouping of projects * ``endpoint``: Identity - the base URL used to contact a specific service -* ``extension``: Compute, Identity, Volume - additional APIs available +* ``extension``: (**Compute**, **Identity**, **Volume**) OpenStack server API extensions * ``flavor``: Compute - pre-defined configurations of servers: ram, root disk, etc * ``group``: Identity - a grouping of users * ``host``: Compute - the physical computer running a hypervisor @@ -93,13 +89,13 @@ referring to both Compute and Volume quotas. * ``ip fixed``: Compute, Network - an internal IP address assigned to a server * ``ip floating``: Compute, Network - a public IP address that can be mapped to a server * ``keypair``: Compute - an SSH public key -* ``limits``: Compute, Volume - resource usage limits +* ``limits``: (**Compute**, **Volume**) resource usage limits * ``module``: internal - installed Python modules in the OSC process * ``network``: Network - a virtual network for connecting servers and other resources * ``object``: Object Store - a single file in the Object Store * ``policy``: Identity - determines authorization * ``project``: Identity - the owner of a group of resources -* ``quota``: Compute, Volume - limit on resource usage +* ``quota``: (**Compute**, **Volume**) resource usage restrictions * ``request token``: Identity - temporary OAuth-based token * ``role``: Identity - a policy object used to determine authorization * ``security group``: Compute, Network - groups of network access rules @@ -149,7 +145,7 @@ Those actions with an opposite action are noted in parens if applicable. Implementation -============== +-------------- The command structure is designed to support seamless addition of plugin command modules via ``setuptools`` entry points. The plugin commands must diff --git a/doc/source/index.rst b/doc/source/index.rst index b6145a86b6..2edbb35d57 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -12,6 +12,7 @@ Contents: :maxdepth: 1 releases + command-list commands plugins authentication diff --git a/doc/source/releases.rst b/doc/source/releases.rst index 89b4ad111e..909c362eaf 100644 --- a/doc/source/releases.rst +++ b/doc/source/releases.rst @@ -26,7 +26,7 @@ Release Notes * add ``object create`` and ``object delete`` commands * add initial support for global ``--timing`` options (similar to nova CLI) * complete Python 3 compatibility -* fix ``server resize` command +* fix ``server resize`` command * add authentication via ``--os-trust-id`` for Identity v3 * Add initial support for Network API, ``network create|delete|list|show`` diff --git a/openstackclient/common/extension.py b/openstackclient/common/extension.py index be7426daa0..dad7ed6285 100644 --- a/openstackclient/common/extension.py +++ b/openstackclient/common/extension.py @@ -24,7 +24,7 @@ from openstackclient.common import utils class ListExtension(lister.Lister): - """List extension command""" + """List API extensions""" log = logging.getLogger(__name__ + '.ListExtension') @@ -40,11 +40,6 @@ class ListExtension(lister.Lister): action='store_true', default=False, help='List extensions for the Identity API') - parser.add_argument( - '--long', - action='store_true', - default=False, - help='List additional fields in output') parser.add_argument( '--network', action='store_true', @@ -55,6 +50,11 @@ class ListExtension(lister.Lister): action='store_true', default=False, help='List extensions for the Volume API') + parser.add_argument( + '--long', + action='store_true', + default=False, + help='List additional fields in output') return parser def take_action(self, parsed_args): diff --git a/openstackclient/common/quota.py b/openstackclient/common/quota.py index e011fd3619..edf4ffdb98 100644 --- a/openstackclient/common/quota.py +++ b/openstackclient/common/quota.py @@ -72,7 +72,7 @@ class SetQuota(command.Command): COMPUTE_QUOTAS.items(), VOLUME_QUOTAS.items()): parser.add_argument( '--%s' % v, - metavar='' % v, + metavar='<%s>' % v, type=int, help='New value for the %s quota' % v, ) diff --git a/openstackclient/identity/v2_0/endpoint.py b/openstackclient/identity/v2_0/endpoint.py index f7d7883109..c5189b62e7 100644 --- a/openstackclient/identity/v2_0/endpoint.py +++ b/openstackclient/identity/v2_0/endpoint.py @@ -28,7 +28,7 @@ from openstackclient.identity import common class CreateEndpoint(show.ShowOne): - """Create endpoint command""" + """Create endpoint""" log = logging.getLogger(__name__ + '.CreateEndpoint')