ironic_inspector_client.
ClientV1
(**kwargs)[source]¶Bases: ironic_inspector_client.common.http.BaseClient
Client for API v1.
Create this object to use Python API, for example:
import ironic_inspector_client
client = ironic_inspector_client.ClientV1(session=keystone_session)
This code creates a client with API version 1.0 and a given Keystone
session.
The service URL is fetched from the service catalog in this case. Optional
arguments service_type
, interface
and region_name
can be
provided to modify how the URL is looked up.
If the catalog lookup fails, the local host with port 5050 is tried.
However, this behaviour is deprecated and should not be relied on.
Also an explicit inspector_url
can be passed to bypass service catalog.
Optional api_version
argument is a minimum API version that a server
must support. It can be a tuple (MAJ, MIN), string “MAJ.MIN” or integer
(only major, minimum supported minor version is assumed).
Variables: | rules – Reference to the introspection rules API.
Instance of ironic_inspector_client.v1.RulesAPI . |
---|
abort
(uuid)[source]¶Abort running introspection for a node.
Parameters: | uuid – node UUID or name. |
---|---|
Raises: | ironic_inspector_client.ClientError on error
reported from a server |
Raises: | ironic_inspector_client.VersionNotSupported if
requested api_version is not supported |
Raises: | requests library exception on connection problems. |
Raises: | TypeError if uuid is not a string. |
get_all_interface_data
(node_ident, field_sel, vlan=None)[source]¶Get interface data for all of the interfaces on this node
Parameters: |
|
---|---|
Returns: | list of interface data, each interface in a list |
get_data
(uuid, raw=False)[source]¶Get introspection data from the last introspection of a node.
If swift support is disabled, introspection data won’t be stored, this request will return error response with 404 code.
Parameters: |
|
---|---|
Returns: | bytes or a dict depending on the ‘raw’ argument |
Raises: |
|
Raises: |
|
Raises: | requests library exception on connection problems. |
Raises: | TypeError if uuid is not a string |
get_interface_data
(node_ident, interface, field_sel)[source]¶Get interface data for the input node and interface
To get LLDP data, collection must be enabled by the kernel parameter
ipa-collect-lldp=1
, and the inspector plugin basic_lldp
must
be enabled.
Parameters: |
|
---|---|
Returns: | interface data in OrderedDict |
Raises: | ValueError if interface is not found. |
get_status
(uuid)[source]¶Get introspection status for a node.
Parameters: | uuid – node UUID or name. |
---|---|
Raises: | ironic_inspector_client.ClientError on error
reported from a server |
Raises: | ironic_inspector_client.VersionNotSupported
if requested api_version is not supported |
Raises: | requests library exception on connection problems. |
Returns: | dictionary with the keys:
|
introspect
(uuid, manage_boot=None)[source]¶Start introspection for a node.
Parameters: |
|
---|---|
Raises: |
|
Raises: |
|
Raises: | requests library exception on connection problems. |
list_statuses
(marker=None, limit=None)[source]¶List introspection statuses.
Supports pagination via the marker and limit params. The items are sorted by the server according to the started_at attribute, newer items first.
Parameters: |
|
---|---|
Raises: |
|
Raises: |
|
Raises: | requests library exception on connection problems. |
Returns: | a list of status dictionaries with the keys:
|
reprocess
(uuid)[source]¶Reprocess stored introspection data.
If swift support is disabled, introspection data won’t be stored, this request will return error response with 404 code.
Parameters: | uuid – node UUID or name. |
---|---|
Raises: | ironic_inspector_client.ClientError on error
reported from a server |
Raises: | ironic_inspector_client.VersionNotSupported if
requested api_version is not supported |
Raises: | requests library exception on connection problems. |
Raises: | TypeError if uuid is not a string. |
wait_for_finish
(uuids, retry_interval=10, max_retries=3600, sleep_function=<built-in function sleep>)[source]¶Wait for introspection finishing for given nodes.
Parameters: |
|
---|---|
Raises: |
|
Raises: |
|
Raises: |
|
Raises: | requests library exception on connection problems. |
Returns: | dictionary UUID -> status (the same as in get_status). |
ironic_inspector_client.
ClientError
(response)[source]¶Bases: requests.exceptions.HTTPError
Error returned from a server.
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.