2013-12-05 13:23:44 -06:00
====================
2013-07-29 17:05:02 -05:00
:program: `openstack`
2013-12-05 13:23:44 -06:00
====================
2013-07-29 17:05:02 -05:00
2013-12-05 13:23:44 -06:00
OpenStack Command Line
2013-07-29 17:05:02 -05:00
2015-03-03 23:12:07 -06:00
2013-07-29 17:05:02 -05:00
SYNOPSIS
========
:program: `openstack` [<global-options> ] <command> [<command-arguments> ]
:program: `openstack help` <command>
2016-09-25 14:10:20 +09:00
:program: `openstack` :option: `--help`
2013-07-29 17:05:02 -05:00
DESCRIPTION
===========
:program: `openstack` provides a common command-line interface to OpenStack APIs. It is generally
2014-02-21 12:46:07 -06:00
equivalent to the CLIs provided by the OpenStack project client libraries, but with
2013-07-29 17:05:02 -05:00
a distinct and consistent command structure.
2014-07-18 19:18:25 +02:00
AUTHENTICATION METHODS
======================
2013-07-29 17:05:02 -05:00
:program: `openstack` uses a similar authentication scheme as the OpenStack project CLIs, with
the credential information supplied either as environment variables or as options on the
2013-12-05 13:23:44 -06:00
command line. The primary difference is the use of 'project' in the name of the options
`` OS_PROJECT_NAME `` /`` OS_PROJECT_ID `` over the old tenant-based names.
2013-07-29 17:05:02 -05:00
::
export OS_AUTH_URL=<url-to-openstack-identity>
export OS_PROJECT_NAME=<project-name>
export OS_USERNAME=<user-name>
export OS_PASSWORD=<password> # (optional)
2014-07-18 19:18:25 +02:00
:program: `openstack` can use different types of authentication plugins provided by the keystoneclient library. The following default plugins are available:
* `` token `` : Authentication with a token
* `` password `` : Authentication with a username and a password
Refer to the keystoneclient library documentation for more details about these plugins and their options, and for a complete list of available plugins.
Please bear in mind that some plugins might not support all of the functionalities of :program: `openstack` ; for example the v3unscopedsaml plugin can deliver only unscoped tokens, some commands might not be available through this authentication method.
Additionally, it is possible to use Keystone's service token to authenticate, by setting the options :option: `--os-token` and :option: `--os-url` (or the environment variables :envvar: `OS_TOKEN` and :envvar: `OS_URL` respectively). This method takes precedence over authentication plugins.
2013-07-29 17:05:02 -05:00
2014-09-25 18:15:59 +02:00
.. NOTE ::
To use the `` v3unscopedsaml `` method, the lxml package will need to be installed.
2013-07-29 17:05:02 -05:00
OPTIONS
=======
2014-02-21 12:46:07 -06:00
:program: `openstack` takes global options that control overall behaviour and command-specific options that control the command operation. 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.
2015-03-05 19:15:19 -05:00
:program: `openstack` recognizes the following global options:
2013-07-29 17:05:02 -05:00
2015-03-03 23:12:07 -06:00
:option: `--os-cloud` <cloud-name>
:program: `openstack` will look for a `` clouds.yaml `` file that contains
a cloud configuration to use for authentication. See CLOUD CONFIGURATION
below for more information.
:option: `--os-auth-type` <auth-type>
The authentication plugin type to use when connecting to the Identity service.
If this option is not set, :program: `openstack` will attempt to guess the
authentication method to use based on the other options.
2015-07-04 09:32:16 -06:00
If this option is set, its version must match :option: `--os-identity-api-version`
2014-07-18 19:18:25 +02:00
2014-02-21 12:46:07 -06:00
:option: `--os-auth-url` <auth-url>
2013-07-29 17:05:02 -05:00
Authentication URL
2014-07-18 19:18:25 +02:00
:option: `--os-url` <service-url>
Service URL, when using a service token for authentication
2014-02-21 12:46:07 -06:00
:option: `--os-domain-name` <auth-domain-name> | :option: `--os-domain-id` <auth-domain-id>
Domain-level authorization scope (name or ID)
:option: `--os-project-name` <auth-project-name> | :option: `--os-project-id` <auth-project-id>
Project-level authentication scope (name or ID)
2013-07-29 17:05:02 -05:00
2014-02-21 12:46:07 -06:00
:option: `--os-project-domain-name` <auth-project-domain-name> | :option: `--os-project-domain-id` <auth-project-domain-id>
2016-05-31 18:11:46 +08:00
Domain name or ID containing project
2013-07-29 17:05:02 -05:00
2014-02-21 12:46:07 -06:00
:option: `--os-username` <auth-username>
2013-07-29 17:05:02 -05:00
Authentication username
2014-09-06 14:32:47 -05:00
:option: `--os-password` <auth-password>
Authentication password
2014-07-18 19:18:25 +02:00
:option: `--os-token` <token>
Authenticated token or service token
2014-02-21 12:46:07 -06:00
:option: `--os-user-domain-name` <auth-user-domain-name> | :option: `--os-user-domain-id` <auth-user-domain-id>
2016-05-31 18:11:46 +08:00
Domain name or ID containing user
2014-02-21 12:46:07 -06:00
2014-09-06 14:32:47 -05:00
:option: `--os-trust-id` <trust-id>
2016-05-31 18:11:46 +08:00
ID of the trust to use as a trustee user
2013-07-29 17:05:02 -05:00
2014-02-21 12:46:07 -06:00
:option: `--os-default-domain` <auth-domain>
2013-12-05 13:23:44 -06:00
Default domain ID (Default: 'default')
2014-09-06 14:32:47 -05:00
:option: `--os-region-name` <auth-region-name>
Authentication region name
2014-02-21 12:46:07 -06:00
:option: `--os-cacert` <ca-bundle-file>
2013-12-05 13:23:44 -06:00
CA certificate bundle file
2014-02-21 12:46:07 -06:00
:option: `--verify` | :option: `--insecure`
2013-12-05 13:23:44 -06:00
Verify or ignore server certificate (default: verify)
2016-04-01 23:42:27 +02:00
:option: `--os-cert` <certificate-file>
Client certificate bundle file
:option: `--os-key` <key-file>
Client certificate key file
2014-02-21 12:46:07 -06:00
:option: `--os-identity-api-version` <identity-api-version>
2013-12-05 13:23:44 -06:00
Identity API version (Default: 2.0)
2014-02-21 12:46:07 -06:00
:option: `--os-XXXX-api-version` <XXXX-api-version>
Additional API version options will be available depending on the installed API libraries.
2013-07-29 17:05:02 -05:00
2015-07-04 09:32:16 -06:00
:option: `--os-interface` <interface>
Interface type. Valid options are `public` , `admin` and `internal` .
2014-07-18 19:18:25 +02:00
2016-04-18 14:39:21 -05:00
:option: `--os-profile` <hmac-key>
Performance profiling HMAC key for encrypting context data
This key should be the value of one of the HMAC keys defined in the
configuration files of OpenStack services to be traced.
2015-12-10 15:48:52 +03:00
2016-06-02 09:53:55 -05:00
:option: `--os-beta-command`
Enable beta commands which are subject to change
2015-05-29 20:39:24 +09:00
:option: `--log-file` <LOGFILE>
Specify a file to log output. Disabled by default.
:option: `-v, --verbose`
Increase verbosity of output. Can be repeated.
:option: `-q, --quiet`
2016-05-31 18:11:46 +08:00
Suppress output except warnings and errors
2015-05-29 20:39:24 +09:00
:option: `--debug`
2016-05-31 18:11:46 +08:00
Show tracebacks on errors and set verbosity to debug
2015-05-29 20:39:24 +09:00
2013-07-29 17:05:02 -05:00
COMMANDS
========
To get a list of the available commands::
2014-02-21 12:46:07 -06:00
openstack --help
2013-07-29 17:05:02 -05:00
To get a description of a specific command::
openstack help <command>
2014-09-06 14:32:47 -05:00
Note that the set of commands shown will vary depending on the API versions
that are in effect at that time. For example, to force the display of the
Identity v3 commands:
openstack --os-identity-api-version 3 --help
2013-07-29 17:05:02 -05:00
2013-12-05 13:23:44 -06:00
:option: `complete`
Print the bash completion functions for the current command set.
:option: `help <command>`
Print help for an individual command
2014-09-06 14:32:47 -05:00
Additional information on the OpenStackClient command structure and arguments
is available in the `OpenStackClient Commands`_ wiki page.
.. _`OpenStackClient Commands`: https://wiki.openstack.org/wiki/OpenStackClient/Commands
Command Objects
---------------
The list of command objects is growing longer with the addition of OpenStack
project support. The object names may consist of multiple words to compose a
unique name. Occasionally when multiple APIs have a common name with common
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
2015-11-08 22:05:15 +08:00
referring to both Compute and Block Storage quotas.
2014-09-06 14:32:47 -05:00
Command Actions
---------------
The actions used by OpenStackClient are defined with specific meaning to provide a consistent behavior for each object. Some actions have logical opposite actions, and those pairs will always match for any object that uses them.
2013-12-05 13:23:44 -06:00
2015-03-03 23:12:07 -06:00
CLOUD CONFIGURATION
===================
Working with multiple clouds can be simplified by keeping the configuration
information for those clouds in a local file. :program: `openstack` supports
using a `` clouds.yaml `` configuration file.
Config Files
------------
:program: `openstack` will look for a file called clouds.yaml in the following
locations:
* Current Directory
* ~/.config/openstack
* /etc/openstack
The first file found wins.
The keys match the :program: `openstack` global options but without the
`` --os- `` prefix:
::
clouds:
devstack:
auth:
auth_url: http://192.168.122.10:35357/
project_name: demo
username: demo
password: 0penstack
region_name: RegionOne
ds-admin:
auth:
auth_url: http://192.168.122.10:35357/
project_name: admin
username: admin
password: 0penstack
region_name: RegionOne
infra:
cloud: rackspace
auth:
project_id: 275610
username: openstack
password: xyzpdq!lazydog
region_name: DFW,ORD,IAD
In the above example, the `` auth_url `` for the `` rackspace `` cloud is taken
from :file: `clouds-public.yaml` :
::
public-clouds:
rackspace:
auth:
auth_url: 'https://identity.api.rackspacecloud.com/v2.0/'
Authentication Settings
-----------------------
OpenStackClient uses the Keystone authentication plugins so the required
auth settings are not always known until the authentication type is
selected. :program: `openstack` will attempt to detect a couple of common
auth types based on the arguments passed in or found in the configuration
file, but if those are incomplete it may be impossible to know which
auth type is intended. The :option: `--os-auth-type` option can always be
used to force a specific type.
When :option: `--os-token` and :option: `--os-url` are both present the
`` token_endpoint `` auth type is selected automatically. If
:option: `--os-auth-url` and :option: `--os-username` are present `` password ``
auth type is selected.
2015-05-29 20:39:24 +09:00
Logging Settings
----------------
:program: `openstack` can record the operation history by logging settings
in configuration file. Recording the user operation, it can identify the
change of the resource and it becomes useful information for troubleshooting.
See :doc: `../configuration` about Logging Settings for more details.
2015-03-03 23:12:07 -06:00
2014-02-21 12:46:07 -06:00
NOTES
=====
The command list displayed in help output reflects the API versions selected. For
example, to see Identity v3 commands `` OS_IDENTITY_API_VERSION `` must be set to `` 3 `` .
2013-12-05 13:23:44 -06:00
EXAMPLES
========
Show the detailed information for server `` appweb01 `` ::
2014-02-21 12:46:07 -06:00
openstack \
--os-project-name ExampleCo \
--os-username demo --os-password secrete \
--os-auth-url http://localhost:5000:/v2.0 \
server show appweb01
2013-12-05 13:23:44 -06:00
The same command if the auth environment variables (:envvar: `OS_AUTH_URL` , :envvar: `OS_PROJECT_NAME` ,
:envvar: `OS_USERNAME` , :envvar: `OS_PASSWORD` ) are set::
openstack server show appweb01
Create a new image::
openstack image create \
--disk-format=qcow2 \
--container-format=bare \
--public \
--copy-from http://somewhere.net/foo.img \
foo
2013-07-29 17:05:02 -05:00
FILES
=====
2015-03-03 23:12:07 -06:00
:file: `~/.config/openstack/clouds.yaml`
Configuration file used by the :option: `--os-cloud` global option.
:file: `~/.config/openstack/clouds-public.yaml`
Configuration file containing public cloud provider information such as
authentication URLs and service definitions. The contents of this file
should be public and sharable. `` clouds.yaml `` may contain references
to clouds defined here as shortcuts.
2014-02-21 12:46:07 -06:00
:file: `~/.openstack`
Placeholder for future local state directory. This directory is intended to be shared among multiple OpenStack-related applications; contents are namespaced with an identifier for the app that owns it. Shared contents (such as :file: `~/.openstack/cache` ) have no prefix and the contents must be portable.
2013-07-29 17:05:02 -05:00
ENVIRONMENT VARIABLES
=====================
2014-02-21 12:46:07 -06:00
The following environment variables can be set to alter the behaviour of :program: `openstack` . Most of them have corresponding command-line options that take precedence if set.
2015-03-03 23:12:07 -06:00
:envvar: `OS_CLOUD`
The name of a cloud configuration in `` clouds.yaml `` .
2014-07-18 19:18:25 +02:00
:envvar: `OS_AUTH_PLUGIN`
2015-07-04 09:32:16 -06:00
The authentication plugin to use when connecting to the Identity service, its version must match the Identity API version
2014-07-18 19:18:25 +02:00
2014-02-21 12:46:07 -06:00
:envvar: `OS_AUTH_URL`
Authentication URL
2014-07-18 19:18:25 +02:00
:envvar: `OS_URL`
Service URL (when using the service token)
2014-02-21 12:46:07 -06:00
:envvar: `OS_DOMAIN_NAME`
Domain-level authorization scope (name or ID)
:envvar: `OS_PROJECT_NAME`
Project-level authentication scope (name or ID)
:envvar: `OS_PROJECT_DOMAIN_NAME`
2016-05-31 18:11:46 +08:00
Domain name or ID containing project
2013-07-29 17:05:02 -05:00
:envvar: `OS_USERNAME`
2014-02-21 12:46:07 -06:00
Authentication username
2014-07-18 19:18:25 +02:00
:envvar: `OS_TOKEN`
Authenticated or service token
2013-07-29 17:05:02 -05:00
:envvar: `OS_PASSWORD`
2014-02-21 12:46:07 -06:00
Authentication password
2013-07-29 17:05:02 -05:00
2014-09-06 14:32:47 -05:00
:envvar: `OS_USER_DOMAIN_NAME`
2016-05-31 18:11:46 +08:00
Domain name or ID containing user
2014-09-06 14:32:47 -05:00
:envvar: `OS_TRUST_ID`
2016-05-31 18:11:46 +08:00
ID of the trust to use as a trustee user
2013-12-05 13:23:44 -06:00
2014-02-21 12:46:07 -06:00
:envvar: `OS_DEFAULT_DOMAIN`
2014-07-07 19:52:30 +02:00
Default domain ID (Default: 'default')
2014-02-21 12:46:07 -06:00
2014-09-06 14:32:47 -05:00
:envvar: `OS_REGION_NAME`
Authentication region name
2014-02-21 12:46:07 -06:00
:envvar: `OS_CACERT`
CA certificate bundle file
2016-04-01 23:42:27 +02:00
:envvar: `OS_CERT`
Client certificate bundle file
:envvar: `OS_KEY`
Client certificate key file
2014-06-30 19:12:27 +02:00
:envvar: `OS_IDENTITY_API_VERSION`
2014-02-21 12:46:07 -06:00
Identity API version (Default: 2.0)
2014-06-30 19:12:27 +02:00
:envvar: `OS_XXXX_API_VERSION`
2014-02-21 12:46:07 -06:00
Additional API version options will be available depending on the installed API libraries.
2013-12-05 13:23:44 -06:00
2015-07-04 09:32:16 -06:00
:envvar: `OS_INTERFACE`
Interface type. Valid options are `public` , `admin` and `internal` .
2015-05-22 16:22:35 -07:00
2014-07-18 19:18:25 +02:00
2013-07-29 17:05:02 -05:00
BUGS
====
Bug reports are accepted at the python-openstackclient LaunchPad project
"https://bugs.launchpad.net/python-openstackclient/+bugs".
AUTHORS
=======
Please refer to the AUTHORS file distributed with OpenStackClient.
COPYRIGHT
=========
2014-02-21 12:46:07 -06:00
Copyright 2011-2014 OpenStack Foundation and the authors listed in the AUTHORS file.
2013-07-29 17:05:02 -05:00
LICENSE
=======
http://www.apache.org/licenses/LICENSE-2.0
SEE ALSO
========
2016-10-21 01:34:03 -07:00
The `OpenStackClient page <http://docs.openstack.org/developer/python-openstackclient/> `_
in the `OpenStack Docs <https://docs.openstack.org/> `_ contains further
2013-12-05 13:23:44 -06:00
documentation.
The individual OpenStack project CLIs, the OpenStack API references.