Access the cloud APIs
Your project is a real OpenStack project. The portal is one way to work with it; the OpenStack CLI, an SDK or Terraform are another, and they reach the same resources. Both routes use your own identity, so what you can do is the same either way.
Credentials are issued per project, from the project's Access page.
Create an application credential
An application credential is the recommended way to reach the APIs. It carries no password, is bound to you and to one project, and can be deleted at any time without affecting your sign-in.
- Open the project and go to Access → Application Credentials.
- Select Create an Application Credential.
- Choose the location — the cloud and region the credential is for.
- Give it a name and, optionally, a description. Use a name that says where it will be used, so you can tell credentials apart later.
- Select Create.
The id and the secret are displayed once. Select Download the openrc file before closing the dialog — the secret is not recoverable afterwards. If you lose it, delete the credential and create another.
The downloaded file looks like this:
#!/usr/bin/env bash
export OS_AUTH_TYPE=v3applicationcredential
export OS_AUTH_URL=https://keystone.example.com/v3
export OS_IDENTITY_API_VERSION=3
export OS_REGION_NAME="eu-central-1"
export OS_INTERFACE=public
export OS_APPLICATION_CREDENTIAL_ID=<id>
export OS_APPLICATION_CREDENTIAL_SECRET=<secret>
Use the application credential
Install the client, load the file, and work with the project:
pip3 install python-openstackclient
source my-project.openrc
openstack server list
openstack image list
openstack network list
Prefer a configuration file over environment variables? The same credential as clouds.yaml:
clouds:
my-project:
auth_type: v3applicationcredential
auth:
auth_url: https://keystone.example.com/v3
application_credential_id: <id>
application_credential_secret: <secret>
region_name: eu-central-1
interface: public
identity_api_version: 3
openstack --os-cloud my-project server list
The same file drives Terraform, Ansible and the OpenStack SDKs — anything that speaks to OpenStack natively.
Endpoints. The API Access view on the same page lists the service endpoints available to the project, so you do not have to look them up.
Credential scope
A credential is scoped to one project on one cloud, and grants what you hold there and nothing more:
- Resources in other projects are not visible to it, including projects of your own. Issue a separate credential in each project you work with.
- It cannot be used to sign in to the portal, and it cannot manage members or billing.
- It stops working when it is deleted, and when you stop being a member of the project.
If you have access to several regions of the same cloud, create one credential per region — the region is part of what you selected when you issued it.
Other credential types
Application credentials suit most uses. Where a tool needs a username and password, or an S3-compatible key pair, see Credentials for a project.