Registry / devops / python-ironicclient

python-ironicclient

JSON →
library6.1.0pypypi✓ verified 87d ago

python-ironicclient is the official Python client library for the OpenStack Ironic API, which provides bare metal provisioning services. It offers a Python API for programmatic interaction and integrates with the `openstack baremetal` command-line interface. The current stable version is 6.0.0, actively maintained within the OpenStack project, with releases generally aligned with the OpenStack release cycle (typically every six months).

pip install python-ironicclient
INSTALL
IMPORT
SIG · PYTHON-IRONICCLIEN
P
python-ironicclient
devopspythonv6.1.0
Install
10.7s avg
Import
1861ms
Disk
140MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v6.1.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 1.921s · 129.6MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 10.7s · import 1.802s · 131MB
140MB installed
● package 140MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

client
from ironicclient import client
from ironicclient.v1 import client
The primary `client` object is available directly under `ironicclient`, abstracting API versioning.

Initializes the Ironic client using an authentication token and the Ironic API endpoint, then attempts to list all bare metal nodes. Environment variables are used for sensitive credentials.

import os from ironicclient import client # Configure with actual Ironic API endpoint and Keystone authentication token IRONIC_URL = os.environ.get('IRONIC_URL', 'http://localhost:6385/') OS_AUTH_TOKEN = os.environ.get('OS_AUTH_TOKEN', 'YOUR_AUTH_TOKEN_HERE') if not OS_AUTH_TOKEN or 'YOUR_AUTH_TOKEN_HERE' in OS_AUTH_TOKEN: print("Warning: OS_AUTH_TOKEN not set or is a placeholder. API calls may fail.") kwargs = { 'os_auth_token': OS_AUTH_TOKEN, 'ironic_url': IRONIC_URL } try: # API version 1 is common, newer microversions can be specified if needed ironic = client.get_client(1, **kwargs) nodes = ironic.node.list() print(f"Successfully connected to Ironic. Found {len(nodes)} nodes.") for node in nodes: print(f" - Node UUID: {node.uuid}, Name: {node.name}") except Exception as e: print(f"Error connecting to Ironic or listing nodes: {e}") print("Please ensure IRONIC_URL and OS_AUTH_TOKEN are correctly configured and Ironic API is reachable.")
openstack --version
Debug
Known issues
deprecatedThe standalone `ironic` command-line interface (CLI) is largely superseded by the unified `openstack baremetal` commands available through `python-openstackclient`.
fix
Use `openstack baremetal <subcommand>` after installing `python-openstackclient` or `python-ironicclient[cli]`.
affects: All versions, `openstack baremetal` is the long-standing preferred CLI.
gotchaThe `python-ironic-inspector-client` library is no longer maintained. Its functionality for hardware introspection has been integrated directly into Ironic itself.
fix
Migrate to using Ironic's built-in in-band inspection capabilities instead of relying on the deprecated `ironic-inspector-client`.
affects: All versions, especially for new deployments.
gotchaIronic client initialization requires both `os_auth_token` and `ironic_url`. Forgetting either, or providing incorrect values, will lead to authentication or connection errors.
fix
Ensure `os_auth_token` is a valid Keystone token and `ironic_url` points to the correct Ironic API endpoint (e.g., `http://<ironic-host>:6385/`).
affects: All versions
Errors
Common errors & fixes
ironicclient.exc.HTTPClientError: Error contacting Ironic server: Connection refused
The Ironic API endpoint specified in `ironic_url` is unreachable, either due to an incorrect URL/port, network configuration (firewall), or the Ironic API service not running.
fix
Verify the `ironic_url` (default port is 6385) is correct and that the Ironic API service is running and accessible from where the client is executed. Check firewall rules and network routes.
keystoneauth1.exceptions.catalog.EndpointNotFound: Could not find endpoint for service 'baremetal' in region 'RegionOne'.
The OpenStack service catalog, usually retrieved via Keystone, does not contain an entry for the Ironic (baremetal) service, or the specified region is incorrect.
fix
Ensure the Ironic service is registered in Keystone and its endpoint is correctly configured. Verify the `region_name` if explicitly provided, or ensure the default region is correct for your OpenStack deployment.
AttributeError: 'ClientManager' object has no attribute 'node'
This usually indicates an issue with the API version or an internal client error where the expected resource manager (e.g., `node`) is not available or has changed its access path.
fix
Ensure you are initializing the client with a supported API version, e.g., `client.get_client(1, **kwargs)`. Consult Ironic API documentation for the correct microversion usage if needed.
Upgrade
Version history
6.1.0latest on PyPI · released May 18, 2026
Audit
Dependencies
keystoneauth1requiredRequired for authentication with OpenStack Identity (Keystone).
openstacksdkrequiredUsed for broader OpenStack service interaction and is a dependency for `openstackclient`.
osc-librequiredOpenStackClient Library, a common utility library for OpenStack clients.
oslo.utilsrequiredCommon OpenStack utility library for various functionalities.
requestsrequiredHTTP client library for making API requests.
Agent activity
16 hits · last 30 days
node
14
Resources
python-ironicclient — pip install python-ironicclient · libregistry