
novaclient 2.27.0 introduced the API microversion discovery and client.Client now wants an api_version argument to properly work out the correct API version in use. OSC needs to provide this when required. Letting the compute client plugin do the version validity checking makes more sense than encoding it into shell.py, so I've added a new OSC plugin interface function check_api_version() that is called from shell.py if it exists. If it either does not exist or it returns False the previous version checking using API_VERSIONS is still performed. compute.client.check_api_version() conditionally imports the new novaclient.api_versions module and uses it if successful. Otherwise check_api_version() returns False and the previous code path is resumed. One side-effect of this is that it is now valid to use --os-compute-api-version with any valid microversion supported by the installed python-novaclient. Closes-Bug: #1492467 Change-Id: I4535b38a5639a03a9597bf83f6394f9bb45c2b9e
OpenStackClient
OpenStackClient (aka OSC) is a command-line client for OpenStack that brings the command set for Compute, Identity, Image, Object Store and Volume APIs together in a single shell with a uniform command structure.
The primary goal is to provide a unified shell command structure and a common language to describe operations in OpenStack.
- PyPi - package installation
- Online Documentation
- Launchpad project - release management
- Blueprints - feature specifications
- Bugs - issue tracking
- Source
- Developer - getting started as a developer
- Contributing - contributing code
- IRC: #openstack-sdks on Freenode (irc.freenode.net)
- License: Apache 2.0
Getting Started
OpenStack Client can be installed from PyPI using pip:
pip install python-openstackclient
There are a few variants on getting help. A list of global options
and supported commands is shown with --help
:
openstack --help
There is also a help
command that can be used to get
help text for a specific command:
openstack help
openstack help server create
Configuration
The CLI is configured via environment variables and command-line options as listed in http://docs.openstack.org/developer/python-openstackclient/authentication.html.
Authentication using username/password is most commonly used:
export OS_AUTH_URL=<url-to-openstack-identity>
export OS_PROJECT_NAME=<project-name>
export OS_USERNAME=<username>
export OS_PASSWORD=<password> # (optional)
The corresponding command-line options look very similar:
--os-auth-url <url>
--os-project-name <project-name>
--os-username <username>
[--os-password <password>]
If a password is not provided above (in plaintext), you will be interactively prompted to provide one securely.
Authentication may also be performed using an already-acquired token and a URL pointing directly to the service API that presumably was acquired from the Service Catalog:
export OS_TOKEN=<token>
export OS_URL=<url-to-openstack-service>
The corresponding command-line options look very similar:
--os-token <token>
--os-url <url-to-openstack-service>