Skip to main content
Latest Version

OpenStackClient (OSC) is a command-line client for OpenStack that brings the command set for Compute, Identity, Image, Network, Object Store and Block Storage APIs together in a single shell with a uniform command structure. Support for additional service APIs is provided via plugins.

The primary goal is to provide a unified shell command structure and a common language to describe operations in OpenStack.

Getting Started

OpenStack Client can be installed from PyPI using pip:

python3 -m pip install python-openstackclient

You can use --help or the help command to get a list of global options and supported commands:

openstack --help
openstack help

You can also get help for a specific command:

openstack server create --help
openstack help server create

You can add support for additional services by installing their clients. For example, to add support for the DNS service (designate):

python3 -m pip install python3-designateclient

A Dockerfile is provided for your convenience in the repository. You can use this to build your own container images:

git clone https://opendev.org/openstack/python-openstackclient
cd python-openstackclient
podman build . -t example.com/myuser/openstackclient

For more information the available options and commands, refer to the Users Guide.

Configuration

OpenStack Client must be configured with authentication information in order to communicate with a given OpenStack cloud. This configuration can be achieved via a clouds.yaml file, a set of environment variables (often shared via an openrc file), a set of command-line options, or a combination of all three. Your cloud provider or deployment tooling will typically provide either a clouds.yaml file or openrc file for you. If using a clouds.yaml file, OpenStack Client expects to find it in one of the following locations:

  • If set, the path indicated by the OS_CLIENT_CONFIG_FILE environment variable

  • . (the current directory)

  • $HOME/.config/openstack

  • /etc/openstack

The options you should set will depend on the configuration of your cloud and the authentication mechanism(s) supported. For example, consider a cloud that supports username/password authentication. Configuration for this cloud using a clouds.yaml file would look like so:

clouds:
  my-cloud:
    auth:
      auth_url: '<url-to-openstack-identity>'
      project_name: '<project-name>'
      project_domain_name: '<project-domain-name>'
      username: '<username>'
      user_domain_name: '<user-domain-name>'
      password: '<password>'  # (optional)
    region_name: '<region>'

The corresponding environment variables would look very similar:

export OS_AUTH_URL=<url-to-openstack-identity>
export OS_REGION_NAME=<region>
export OS_PROJECT_NAME=<project-name>
export OS_PROJECT_DOMAIN_NAME=<project-domain-name>
export OS_USERNAME=<username>
export OS_USER_DOMAIN_NAME=<user-domain-name>
export OS_PASSWORD=<password>  # (optional)

Likewise, the corresponding command-line options would look very similar:

openstack
--os-auth-url <url-to-openstack-identity>
--os-region <region>
--os-project-name <project-name>
--os-project-domain-name <project-domain-name>
--os-username <username>
--os-user-domain-name <user-domain-name>
[--os-password <password>]

Some clouds use federated authentication. If this is the case, your configuration will be slightly more involved. For example, to configure username/password authentication for a federated user using a clouds.yaml file:

clouds:
  my-cloud:
    auth:
      auth_url: '<url-to-openstack-identity>'
      project_name: '<project-name>'
      project_domain_name: '<project-domain-name>'
      username: '<username-in-idp>'
      user_domain_name: '<user-domain-name>'
      password: '<password-in-idp>'
      identity_provider: '<the-desired-idp-in-keystone>'
      client_id: '<the-client-id-configured-in-the-idp>'
      client_secret: '<the-client-secret-configured-in-the-idp>'
      openid_scope: '<the-scopes-of-desired-attributes-to-claim-from-idp>'
      protocol: '<the-protocol-used-in-the-apache2-oidc-proxy>'
      access_token_type: '<the-access-token-type-used-by-your-idp>'
      discovery_endpoint: '<the-well-known-endpoint-of-the-idp>'
    auth_type: 'v3oidcpassword'
    region_name: '<region>'

The corresponding environment variables would look very similar:

export OS_PROJECT_NAME=<project-name>
export OS_PROJECT_DOMAIN_NAME=<project-domain-name>
export OS_AUTH_URL=<url-to-openstack-identity>
export OS_IDENTITY_API_VERSION=3
export OS_AUTH_TYPE=v3oidcpassword
export OS_USERNAME=<username-in-idp>
export OS_PASSWORD=<password-in-idp>
export OS_IDENTITY_PROVIDER=<the-desired-idp-in-keystone>
export OS_CLIENT_ID=<the-client-id-configured-in-the-idp>
export OS_CLIENT_SECRET=<the-client-secred-configured-in-the-idp>
export OS_OPENID_SCOPE=<the-scopes-of-desired-attributes-to-claim-from-idp>
export OS_PROTOCOL=<the-protocol-used-in-the-apache2-oidc-proxy>
export OS_ACCESS_TOKEN_TYPE=<the-access-token-type-used-by-your-idp>
export OS_DISCOVERY_ENDPOINT=<the-well-known-endpoint-of-the-idp>

Likewise, the corresponding command-line options would look very similar:

--os-project-name <project-name>
--os-project-domain-name <project-domain-name>
--os-auth-url <url-to-openstack-identity>
--os-identity-api-version 3
--os-auth-plugin openid
--os-auth-type v3oidcpassword
--os-username <username-in-idp>
--os-password <password-in-idp>
--os-identity-provider <the-desired-idp-in-keystone>
--os-client-id <the-client-id-configured-in-the-idp>
--os-client-secret <the-client-secred-configured-in-the-idp>
--os-openid-scope <the-scopes-of-desired-attributes-to-claim-from-idp>
--os-protocol <the-protocol-used-in-the-apache2-oidc-proxy>
--os-access-token-type <the-access-token-type-used-by-your-idp>
--os-discovery-endpoint <the-well-known-endpoint-of-the-idp>

For more information on configuring authentication, including an overview of the many authentication mechanisms supported, refer to the Authentication guide. For more information on configuration in general, refer to the Configuration guide.

Contributing

You can clone the repository from opendev.org:

git clone https://opendev.org/openstack/python-openstackclient
cd python-openstackclient

OpenStack Client uses the same contributor process as other OpenStack projects. For information on this process, including help on setting up you Gerrit account and an overview of the CI process, refer to the OpenStack Contributors Guide.

For more information on contributing to OpenStack Client itself, including guidance on how to design new commands and how to report bugs, refer to the Contributors Guide.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_openstackclient-10.3.0.tar.gz (1.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_openstackclient-10.3.0-py3-none-any.whl (1.3 MB view details)

Uploaded Python 3

File details

Details for the file python_openstackclient-10.3.0.tar.gz.

File metadata

  • Download URL: python_openstackclient-10.3.0.tar.gz
  • Upload date:
  • Size: 1.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.15

File hashes

Hashes for python_openstackclient-10.3.0.tar.gz
Algorithm Hash digest
SHA256 6bcc2344d5dca9a4c4920998c0616eb82e9431e41033c91719247c72c61cca4d
MD5 5ad68e13092812aba743fd886b4af5db
BLAKE2b-256 9ad8cda0230fb90cfc40b5977beecc1f063e6bb7042ae5db1fac05c9d8ccfc64

See more details on using hashes here.

File details

Details for the file python_openstackclient-10.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for python_openstackclient-10.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7fb752196feda765b0c840803374127d18de62d242238e7950069784d9f76ce3
MD5 5ad9ee75aaa60ce7e4ddcee179b77ed4
BLAKE2b-256 0126e105d6214ad7ecacbb4a546817a53c39bf3b433a3e2c932255e6090a2836

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

10.3.0 This release

2 files

10.2.1

2 files

10.2.0

2 files

10.1.0

2 files

10.0.0

2 files

9.0.0

2 files

8.3.0

2 files

8.2.0

2 files

8.1.0

2 files

8.0.0

2 files

7.5.0

2 files

7.4.0

2 files

7.3.1

2 files

7.3.0

2 files

7.2.1

2 files

7.2.0

2 files

7.1.5

2 files

7.1.4

2 files

7.1.3

2 files

7.1.2

2 files

7.1.1

2 files

7.1.0

2 files

7.0.0

2 files

6.6.1

2 files

6.6.0

2 files

6.5.0

2 files

6.4.0

2 files

6.3.0

2 files

6.2.1

2 files

6.2.0

2 files

6.1.0

2 files

6.0.1

2 files

6.0.0

2 files

5.8.1

2 files

5.8.0

2 files

5.7.0

2 files

5.6.2

2 files

5.6.1

2 files

5.6.0

2 files

5.5.1

2 files

5.5.0

2 files

5.4.0

2 files

5.3.1

2 files

5.3.0

2 files

5.2.2

2 files

5.2.1

2 files

5.2.0

2 files

5.1.0

2 files

5.0.0

2 files

4.0.2

2 files

4.0.1

2 files

4.0.0

2 files

3.19.0

2 files

3.18.1

2 files

3.18.0

2 files

3.17.0

2 files

3.16.3

2 files

3.16.2

2 files

3.16.1

2 files

3.16.0

2 files

3.15.0

2 files

3.14.3

2 files

3.14.2

2 files

3.14.1

2 files

3.14.0

2 files

3.13.0

2 files

3.12.2

2 files

3.12.1

2 files

3.12.0

2 files

3.11.0

2 files

3.10.0

2 files

3.9.0

2 files

3.8.2

2 files

3.8.1

2 files

3.8.0

2 files

3.7.0

2 files

3.6.0

2 files

3.5.0

2 files

3.4.1

2 files

3.4.0

2 files

3.3.0

2 files

3.2.1

2 files

3.2.0

2 files

3.1.0

2 files

3.0.1

2 files

3.0.0

2 files

2.6.0

2 files

2.5.0

2 files

2.4.0

2 files

2.3.1

2 files

2.3.0

2 files

2.2.0

2 files

2.1.0

2 files

2.0.0

2 files

1.9.0

2 files

1.8.0

2 files

1.7.2

2 files

1.7.1

2 files

1.7.0

2 files

1.6.0

2 files

1.5.0

2 files

1.4.0

2 files

1.3.0

2 files

1.2.0

2 files

1.1.0

2 files

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.4.1

2 files

0.4.0

2 files

0.3.1

1 file

0.3.0

1 file

0.2.2

1 file

0.2.1

1 file

0.2.0

1 file

0.1.51

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page