{"library":"python-ironicclient","title":"OpenStack Ironic Client Library","description":"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).","language":"python","status":"active","last_verified":"Thu Apr 16","install":{"commands":["pip install python-ironicclient","pip install python-ironicclient[cli]"],"cli":{"name":"openstack","version":"sh: 1: openstack: not found"}},"imports":["from ironicclient import client"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nfrom ironicclient import client\n\n# Configure with actual Ironic API endpoint and Keystone authentication token\nIRONIC_URL = os.environ.get('IRONIC_URL', 'http://localhost:6385/')\nOS_AUTH_TOKEN = os.environ.get('OS_AUTH_TOKEN', 'YOUR_AUTH_TOKEN_HERE')\n\nif not OS_AUTH_TOKEN or 'YOUR_AUTH_TOKEN_HERE' in OS_AUTH_TOKEN:\n    print(\"Warning: OS_AUTH_TOKEN not set or is a placeholder. API calls may fail.\")\n\nkwargs = {\n    'os_auth_token': OS_AUTH_TOKEN,\n    'ironic_url': IRONIC_URL\n}\n\ntry:\n    # API version 1 is common, newer microversions can be specified if needed\n    ironic = client.get_client(1, **kwargs)\n    nodes = ironic.node.list()\n    print(f\"Successfully connected to Ironic. Found {len(nodes)} nodes.\")\n    for node in nodes:\n        print(f\" - Node UUID: {node.uuid}, Name: {node.name}\")\nexcept Exception as e:\n    print(f\"Error connecting to Ironic or listing nodes: {e}\")\n    print(\"Please ensure IRONIC_URL and OS_AUTH_TOKEN are correctly configured and Ironic API is reachable.\")","lang":"python","description":"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.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}