The ironicclient python API lets you access ironic, the OpenStack Bare Metal Provisioning Service.
For example, to manipulate nodes, you interact with an ironicclient.v1.node object. You obtain access to nodes via attributes of the ironicclient.v1.client.Client object.
First, create an ironicclient.v1.client.Client instance by passing your credentials to ironicclient.client.get_client(). By default, the Bare Metal Provisioning system is configured so that only administrators (users with ‘admin’ role) have access.
Note
Explicit instantiation of ironicclient.v1.client.Client may cause errors since it doesn’t verify provided arguments, using ironicclient.client.get_client() is preferred way to get client object.
There are two different sets of credentials that can be used:
* ironic endpoint and auth token
* Identity Service (keystone) credentials
An auth token and the ironic endpoint can be used to authenticate:
* os_auth_token: authentication token (from Identity Service)
* ironic_url: ironic API endpoint, eg http://ironic.example.org:6385/v1
To create the client, you can use the API like so:
>>> from ironicclient import client
>>>
>>> kwargs = {'os_auth_token': '3bcc3d3a03f44e3d8377f9247b0ad155',
>>> 'ironic_url': 'http://ironic.example.org:6385/'}
>>> ironic = client.get_client(1, **kwargs)
These Identity Service credentials can be used to authenticate:
* os_username: name of user
* os_password: user's password
* os_auth_url: Identity Service endpoint for authorization
* insecure: Boolean. If True, does not perform X.509 certificate
validation when establishing SSL connection with identity
service. default: False (optional)
* os_tenant_{name|id}: name or ID of tenant
To create a client, you can use the API like so:
>>> from ironicclient import client
>>>
>>> kwargs = {'os_username': 'name',
>>> 'os_password': 'password',
>>> 'os_auth_url': 'http://keystone.example.org:5000/',
>>> 'os_project_name': 'project'}
>>> ironic = client.get_client(1, **kwargs)
Once you have an ironic Client, you can perform various tasks:
>>> ironic.driver.list() # list of drivers
>>> ironic.node.list() # list of nodes
>>> ironic.node.get(node_uuid) # information about a particular node
When the Client needs to propagate an exception, it will usually raise an instance subclassed from ironicclient.exc.BaseException or ironicclient.exc.ClientException.
Refer to the modules themselves, for more details.
ironicclient.client
Moduleironicclient.common.apiclient.base
Moduleironicclient.common.apiclient.exceptions
Moduleironicclient.common.base
Moduleironicclient.common.cliutils
Moduleironicclient.common.filecache
Moduleironicclient.common.http
Moduleironicclient.common.i18n
Moduleironicclient.common.utils
Moduleironicclient.exc
Moduleironicclient.osc.plugin
Moduleironicclient.osc.v1.baremetal_chassis
Moduleironicclient.osc.v1.baremetal_create
Moduleironicclient.osc.v1.baremetal_driver
Moduleironicclient.osc.v1.baremetal_node
Moduleironicclient.osc.v1.baremetal_port
Moduleironicclient.osc.v1.baremetal_portgroup
Moduleironicclient.shell
Moduleironicclient.tests.unit.common.apiclient.test_base
Moduleironicclient.tests.unit.common.apiclient.test_exceptions
Moduleironicclient.tests.unit.common.test_base
Moduleironicclient.tests.unit.common.test_cliutils
Moduleironicclient.tests.unit.common.test_filecache
Moduleironicclient.tests.unit.common.test_http
Moduleironicclient.tests.unit.common.test_utils
Moduleironicclient.tests.unit.osc.fakes
Moduleironicclient.tests.unit.osc.test_plugin
Moduleironicclient.tests.unit.osc.v1.fakes
Moduleironicclient.tests.unit.osc.v1.test_baremetal_chassis
Moduleironicclient.tests.unit.osc.v1.test_baremetal_create
Moduleironicclient.tests.unit.osc.v1.test_baremetal_driver
Moduleironicclient.tests.unit.osc.v1.test_baremetal_node
Moduleironicclient.tests.unit.osc.v1.test_baremetal_port
Moduleironicclient.tests.unit.osc.v1.test_baremetal_portgroup
Moduleironicclient.tests.unit.test_client
Moduleironicclient.tests.unit.test_exc
Moduleironicclient.tests.unit.test_import
Moduleironicclient.tests.unit.test_shell
Moduleironicclient.tests.unit.utils
Moduleironicclient.tests.unit.v1.test_chassis
Moduleironicclient.tests.unit.v1.test_chassis_shell
Moduleironicclient.tests.unit.v1.test_client
Moduleironicclient.tests.unit.v1.test_create_resources
Moduleironicclient.tests.unit.v1.test_create_resources_shell
Moduleironicclient.tests.unit.v1.test_driver
Moduleironicclient.tests.unit.v1.test_driver_shell
Moduleironicclient.tests.unit.v1.test_node
Moduleironicclient.tests.unit.v1.test_node_shell
Moduleironicclient.tests.unit.v1.test_port
Moduleironicclient.tests.unit.v1.test_port_shell
Moduleironicclient.tests.unit.v1.test_portgroup
Moduleironicclient.tests.unit.v1.test_portgroup_shell
Moduleironicclient.tests.unit.v1.test_resource_fields
Moduleironicclient.tests.unit.v1.test_volume_connector
Moduleironicclient.tests.unit.v1.test_volume_target
Moduleironicclient.v1.chassis
Moduleironicclient.v1.chassis_shell
Moduleironicclient.v1.client
Moduleironicclient.v1.create_resources
Moduleironicclient.v1.create_resources_shell
Moduleironicclient.v1.driver
Moduleironicclient.v1.driver_shell
Moduleironicclient.v1.node
Moduleironicclient.v1.node_shell
Moduleironicclient.v1.port
Moduleironicclient.v1.port_shell
Moduleironicclient.v1.portgroup
Moduleironicclient.v1.portgroup_shell
Moduleironicclient.v1.resource_fields
Moduleironicclient.v1.shell
Moduleironicclient.v1.utils
Moduleironicclient.v1.volume_connector
Moduleironicclient.v1.volume_target
ModuleExcept where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.