Interactions — python-openstackclient — branch stable/2026.2
Branch
stable/2026.2@8bb083b83829— repository https://opendev.org/openstack/python-openstackclient — analysed on 2026-11-01
Database, RabbitMQ and cache: none. All exchanges are outbound HTTP through keystoneauth1, plus local files and stdin. The complete list of operations, per service, is [_rewrite/api-surface_stable-2026.2.md](_rewrite/api-surface_stable-2026.2.md).
1. The three client stacks
| Stack | Used by | Created at | Notes |
|---|---|---|---|
openstacksdk Proxy | compute, network, image, volume, most of identity | osc-lib:osc_lib/clientmanager.py:197 | negotiates microversions; carries most of the behaviour |
| python-keystoneclient | Identity v2, OAuth1, EC2 credentials, endpoint groups, some lookups | openstackclient/identity/client.py:44 | being replaced by the SDK |
| project HTTP code | object store; some compute and volume calls | openstackclient/api/object_store_v1.py:35, openstackclient/api/compute_v2.py:29, openstackclient/api/volume_v3.py:29 | no negotiation; openstackclient/api/api.py:53 wraps the session |
All share one keystoneauth session, and therefore one token (osc-lib:osc_lib/clientmanager.py:195). The user agent is python-openstackclient (openstackclient/common/clientmanager.py:40).
2. Keystone
| Step | Request [observed] | When |
|---|---|---|
| Discovery | GET {auth_url} | before authenticating |
| Authentication | POST /v3/auth/tokens, with the password method by default | before the first command needing auth |
| Result | X-Subject-Token and a body with catalog, expires_at, user, project, roles |
The stub shows what the CLI needs from that token: a catalog with public, internal and admin interfaces and a region (openstackclient/shell.py:84, and the stub in the probe). The default interface is public, set with --os-interface (osc-lib:osc_lib/shell.py:274).
Each run authenticates once. The token is not reused between invocations unless a token plugin or a cache is configured [inferred]. A loop of 100 commands therefore costs 100 POST /v3/auth/tokens.
Sample frame
POST /identity/v3/auth/tokens HTTP/1.1
Content-Type: application/json
User-Agent: openstacksdk/… keystoneauth1/5.17.0 python-requests/…
{"auth": {"identity": {"methods": ["password"], "password": {"user": {"name": "admin", "domain": {"name": "Default"}, "password": "***"}}},
"scope": {"project": {"name": "admin", "domain": {"name": "Default"}}}}}
[Body shape inferred from the keystoneauth plugin; the route is observed.]
3. Service discovery
The SDK reads each service's version document before its first call [observed], and the catalog decides the endpoint.
| Service type | Document read | Fields required |
|---|---|---|
compute | GET /compute/v2.1 or the root | version, min_version, links, status |
block-storage (aliases volume, volumev3, volumev2, block-store) | GET /volume/v3 | same (openstackclient/common/clientmanager.py:171) |
network | GET /network | versions[].id, links |
image | GET /image (300 accepted) | versions[].id, links |
identity | GET /identity (300 accepted) | versions.values[] |
object-store | none; the endpoint comes from the catalog (openstackclient/object/client.py:32) |
4. Microversions
Requests carry OpenStack-API-Version: <service> <version> [observed].
| Case | Sent [observed] |
|---|---|
| no option | the highest version known by the SDK for that resource, capped by the service: compute 2.100 on servers, 2.88 on hypervisors, 2.81 on aggregates, 2.61 on flavors; volume 3.71, 3.64, 3.55… |
--os-compute-api-version 2.1 | compute 2.1 on every call |
| legacy calls | pinned: compute 2.1 on os-agents, os-security-groups, os-networks (openstackclient/api/compute_v2.py:68) |
| Neutron, Glance, Swift, Keystone | no header |
| version above the service maximum | no request; error before sending (see 02) |
Values gated in the code: compute 2.2 to 2.104 (55 values), volume 3.1 to 3.66 (29 values). The list per command is in [_rewrite/client-contract_stable-2026.2.json](_rewrite/client-contract_stable-2026.2.json).
Sample frame [observed]
GET /compute/v2.1/servers/detail?deleted=False HTTP/1.1
OpenStack-API-Version: compute 2.100
X-Auth-Token: stub-token
5. Outbound REST summary
Discovered from the Keystone catalog for every service. Authentication is X-Auth-Token.
| Target service | Operations (observed + static) | Example [observed] | Timeout / retry | Errors handled |
|---|---|---|---|---|
Nova (compute) | 136 | POST /servers/{id}/action | api_timeout unset by default (openstacksdk:openstack/config/cloud_region.py:997); connect_retries and status_code_retries per service (openstacksdk:openstack/config/cloud_region.py:775) | 404 on the first lookup leads to the fallback list; the rest is printed |
Neutron (network) | 293 | GET /networks?name=x | same | same |
Keystone (identity) | 150 | GET /users/{id} | same | same |
Cinder (block-storage) | 151 | GET /volumes/detail?name=x | same | same |
Glance (image) | 68 | GET /images/{id} | same | same |
Swift (object-store) | 13 | HEAD /{container} | same; the wrapper has no retry of its own (openstackclient/api/api.py:53) | printed |
6. Object store detail
| Operation | Request | Source |
|---|---|---|
| create or update a container | PUT /{container}, with X-Container-* headers | openstackclient/api/object_store_v1.py:64 |
| container metadata | POST /{container} | openstackclient/api/object_store_v1.py:174 |
| show a container | HEAD /{container} | openstackclient/api/object_store_v1.py:185 |
| upload | PUT /{container}/{object} streamed from a file | openstackclient/api/object_store_v1.py:254 |
| download | GET with stream=True, 64 KiB chunks | openstackclient/api/object_store_v1.py:378 |
| show an object | HEAD /{container}/{object} | openstackclient/api/object_store_v1.py:454 |
| account | HEAD /, POST / | openstackclient/api/object_store_v1.py:501, openstackclient/api/object_store_v1.py:494 |
The account shown is the last part of the endpoint path, not an answer from the service (openstackclient/api/object_store_v1.py:532). A Swift replacement must therefore keep AUTH_<id> at the end of the catalog URL.
7. Other local interactions
| Interaction | Direction | Source |
|---|---|---|
clouds.yaml, secure.yaml | read | osc-lib:osc_lib/shell.py:450 |
| stdin for image data | read when stdin is not a terminal | openstackclient/image/v2/image.py:181 |
| terminal password prompt | read | openstackclient/identity/v3/user.py:771, openstackclient/common/project_cleanup.py:33 |
local files (--file, --rules, object create) | read | openstackclient/identity/v3/mapping.py:50, openstackclient/api/object_store_v1.py:253 |
image save, object save | write to a file or stdout | openstackclient/image/v2/image.py:1141, openstackclient/api/object_store_v1.py:386 |
ssh binary | server ssh runs it through os.system [not run] | openstackclient/compute/v2/server.py:5206 |
| Plugins | Python import through stevedore | openstackclient/common/clientmanager.py:231 |
Source: reverse-spec-python-openstackclient/03-interactions_stable-2026.2.md. The _rewrite/ and _inventory/ files are not published on the site.