From 495b44ae0ed3e69e21022ccfc9e2d67ba4d0a97e Mon Sep 17 00:00:00 2001 From: Steve Martinelli Date: Thu, 25 Sep 2014 12:08:15 -0400 Subject: Update the CLI examples to also use openstackclient In the CLI example section, use openstackclient examples and keystoneclient examples. Change-Id: Ia13730fbac5900998993c56d9a792b392a1ba3ac --- doc/source/cli_examples.rst | 298 ++++++++++++++++++++++++++++++++++++++++++- doc/source/configuration.rst | 6 +- 2 files changed, 295 insertions(+), 9 deletions(-) diff --git a/doc/source/cli_examples.rst b/doc/source/cli_examples.rst index b76f575c8..46f8a97af 100644 --- a/doc/source/cli_examples.rst +++ b/doc/source/cli_examples.rst @@ -18,16 +18,300 @@ Command Line Interface Examples =============================== +The Keystone command line interface packaged in `python-keystoneclient`_ only +supports the Identity v2.0 API. The OpenStack common command line interface +packaged in `python-openstackclient`_ supports both v2.0 and v3 APIs. + +.. NOTE:: + + As of the Juno release, it is recommended to use ``python-openstackclient``, + as it suports both v2.0 and v3 APIs. For the purpose of backwards compatibility, + the CLI packaged in ``python-keystoneclient`` is not being removed. + +.. _`python-openstackclient`: http://docs.openstack.org/developer/python-openstackclient/ +.. _`python-keystoneclient`: http://docs.openstack.org/developer/python-keystoneclient/ + +Using python-openstackclient +============================ + +-------- +Projects +-------- + +``project create`` +------------------ + +positional arguments:: + + New project name + +optional arguments:: + + --description New project description + --enable Enable project (default) + --disable Disable project + +example: + +.. code-block:: bash + + $ openstack project create demo + + +``project delete`` +------------------ + +positional arguments:: + + Project to delete (name or ID) + +example: + +.. code-block:: bash + + $ openstack project delete demo + +----- +Users +----- + +``user create`` +--------------- + +positional arguments:: + + New user name + +optional arguments:: + + --password New user password + --password-prompt Prompt interactively for password + --email New user email address + --project Set default project (name or ID) + --enable Enable user (default) + --disable Disable user + + +example: + +.. code-block:: bash + + $ openstack user create heat-user \ + --password secrete \ + --project demo \ + --email admin@example.com + +``user delete`` +--------------- + +positional arguments:: + + User to delete (name or ID) + +example: + +.. code-block:: bash + + $ openstack user delete heat-user + +``user list`` +------------- + +optional arguments:: + + --project Filter users by project (name or ID) + --long List additional fields in output + +example: + +.. code-block:: bash + + $ openstack user list + +``user set`` +------------ + +positional arguments:: + + User to change (name or ID) + +optional arguments:: + + --name New user name + --password New user password + --password-prompt Prompt interactively for password + --email New user email address + --project New default project (name or ID) + --enable Enable user (default) + --disable Disable user + + +example: + +.. code-block:: bash + + $ openstack user set heat-user --email newemail@example.com + +----- +Roles +----- + +``role create`` +--------------- + +positional arguments:: + + New role name + +example: + +.. code-block:: bash + + $ openstack role create demo + +``role delete`` +--------------- + +positional arguments:: + + Name or ID of role to delete + +example: + +.. code-block:: bash + + $ openstack role delete demo + +``role list`` +------------- + +example: + +.. code-block:: bash + + $ openstack role list + +``role show`` +------------- + +positional arguments:: + + Name or ID of role to display + +example: + +.. code-block:: bash + + $ openstack role show demo + + +``role add`` +------------ + +positional arguments:: + + Role name or ID to add to user + +optional arguments:: + + --project Include project (name or ID) + --user Name or ID of user to include + + +example: + +.. code-block:: bash + + $ openstack user role add demo --user heat-user --project heat + +``role remove`` +--------------- + +positional arguments:: + + Role name or ID to remove from user + +optional arguments:: + + --project Project to include (name or ID) + --user Name or ID of user + + +example: + +.. code-block:: bash + + $ openstack user role remove demo --user heat-user --project heat + +-------- +Services +-------- + +``service create`` +------------------ + +positional arguments:: + + New service name + +optional arguments:: + + --type New service type (compute, image, identity, volume, etc) + --description New service description + +example: + +.. code-block:: bash + + $ openstack service create nova --type compute --description "Nova Compute Service" + +``service list`` +---------------- + +optional arguments:: + + --long List additional fields in output + +example: + +.. code-block:: bash + + $ openstack service list + +``service show`` +---------------- + +positional arguments:: + + Service to display (type, name or ID) + +example: + +.. code-block:: bash + + $ openstack service show nova + +``service delete`` +------------------ + +positional arguments:: + + Service to delete (name or ID) + +example: + +.. code-block:: bash + + $ openstack service delete nova + + +Using python-keystoneclient +=========================== + ------- Tenants ------- -Tenants are the high level grouping within Keystone that represent groups of -users. A tenant is the grouping that owns virtual machines within Nova, or -containers within Swift. A tenant can have zero or more users, Users can be -associated with more than one tenant, and each tenant - user pairing can have -a role associated with it. - ``tenant-create`` ----------------- @@ -112,7 +396,7 @@ example: $ keystone user-list ``user-update`` ---------------- +--------------------- arguments diff --git a/doc/source/configuration.rst b/doc/source/configuration.rst index 172efe4d2..ea70ed7df 100644 --- a/doc/source/configuration.rst +++ b/doc/source/configuration.rst @@ -1236,9 +1236,11 @@ as follows: $ openstack --os-username=admin --os-password=secrete --os-project-name=admin --os-auth-url=http://localhost:35357/v2.0 user list $ openstack --os-username=admin --os-password=secrete --os-project-name=admin --os-auth-url=http://localhost:35357/v2.0 project create demo -For additional examples using ``python-keystoneclient`` refer to `CLI Examples`_. +For additional examples using ``python-keystoneclient`` refer to `python-keystoneclient examples`_, +likewise, for additional examples using ``python-openstackclient``, refer to `python-openstackclient examples`_. -.. _`CLI Examples`: cli_examples.html +.. _`python-keystoneclient examples`: cli_examples.html#using-python-keystoneclient +.. _`python-openstackclient examples`: cli_examples.html#using-python-openstackclient Removing Expired Tokens -- cgit v1.2.1