For details on how to use baremetal, see Using OpenStack Baremetal
The baremetal high-level interface is available through the baremetal
member of a Connection
object.
The baremetal
member will only be added if the service is detected.
Retrieve a generator of nodes.
details – A boolean indicating whether the detailed information for every node should be returned.
query (dict) –
Optional query parameters to be sent to restrict the nodes returned. Available parameters include:
associated
: Only return those which are, or are not,
associated with an instance_id
.
conductor_group
: Only return those in the specified
conductor_group
.
driver
: Only return those with the specified driver
.
fault
: Only return those with the specified fault type.
fields
: A list containing one or more fields to be returned
in the response. This may lead to some performance gain
because other fields of the resource are not refreshed.
instance_id
: Only return the node with this specific instance
UUID or an empty set if not found.
is_maintenance
: Only return those with maintenance
set to
True
or False
.
limit
: Requests at most the specified number of nodes be
returned from the query.
marker
: Specifies the ID of the last-seen node. Use the
limit
parameter to make an initial limited request and
use the ID of the last-seen node from the response as
the marker
value in a subsequent limited request.
provision_state
: Only return those nodes with the specified
provision_state
.
resource_class
: Only return those with the specified
resource_class
.
sort_dir
: Sorts the response by the requested sort direction.
A valid value is asc
(ascending) or desc
(descending). Default is asc
. You can specify multiple
pairs of sort key and sort direction query parameters. If
you omit the sort direction in a pair, the API uses the
natural sorting direction of the server attribute that is
provided as the sort_key
.
sort_key
: Sorts the response by the this attribute value.
Default is id
. You can specify multiple pairs of sort
key and sort direction query pa rameters. If you omit the
sort direction in a pair, the API uses the natural sorting
direction of the server attribute that is provided as the
sort_key
.
A generator of Node
Create a new node from attributes.
Find a single node.
name_or_id (str) – The name or ID of a node.
ignore_missing (bool) – When set to False
, an exception of
ResourceNotFound
will be raised
when the node does not exist. When set to True`, None will
be returned when attempting to find a nonexistent node.
One Node
object
or None.
Get a specific node.
Update a node.
node – The value can be the name or ID of a node or a
Node
instance.
retry_on_conflict (bool) – Whether to retry HTTP CONFLICT error.
Most of the time it can be retried, since it is caused by the node
being locked. However, when setting instance_id
, this is
a normal code and should not be retried.
attrs (dict) – The attributes to update on the node represented
by the node
parameter.
The updated node.
Apply a JSON patch to the node.
node – The value can be the name or ID of a node or a
Node
instance.
patch – JSON patch to apply.
reset_interfaces (bool) – whether to reset the node hardware interfaces to their defaults. This works only when changing drivers. Added in API microversion 1.45.
retry_on_conflict (bool) –
Whether to retry HTTP CONFLICT error.
Most of the time it can be retried, since it is caused by the node
being locked. However, when setting instance_id
, this is
a normal code and should not be retried.
See Update Node for details.
The updated node.
Run an action modifying node’s provision state.
This call is asynchronous, it will return success as soon as the Bare Metal service acknowledges the request.
node – The value can be the name or ID of a node or a
Node
instance.
target – Provisioning action, e.g. active
, provide
.
See the Bare Metal service documentation for available actions.
config_drive – Config drive to pass to the node, only valid
for active` and ``rebuild
targets. You can use functions from
openstack.baremetal.configdrive
to build it.
clean_steps – Clean steps to execute, only valid for clean
target.
rescue_password – Password for the rescue operation, only valid
for rescue
target.
wait – Whether to wait for the node to get into the expected
state. The expected state is determined from a combination of
the current provision state and target
.
timeout – If wait
is set to True
, specifies how much (in
seconds) to wait for the expected state to be reached. The value of
None
(the default) means no client-side timeout.
deploy_steps – Deploy steps to execute, only valid for active
and rebuild
target.
The updated Node
ValueError if config_drive
, clean_steps
,
deploy_steps
or rescue_password
are provided with an
invalid target
.
Wait for the nodes to reach the expected state.
nodes – List of nodes - name, ID or
Node
instance.
expected_state – The expected provisioning state to reach.
timeout – If wait
is set to True
, specifies how much (in
seconds) to wait for the expected state to be reached. The value of
None
(the default) means no client-side timeout.
abort_on_failed_state – If True
(the default), abort waiting
if any node reaches a failure state which does not match the
expected one. Note that the failure state for enroll
->
manageable
transition is enroll
again.
fail – If set to False
this call will not raise on timeouts
and provisioning failures.
If fail is True
(the default), the list of
Node
instances that reached
the requested state. If fail is False
, a
WaitResult
named tuple.
ResourceFailure
if a node
reaches an error state and abort_on_failed_state
is True
.
ResourceTimeout
on timeout.
Run an action modifying node’s power state.
This call is asynchronous, it will return success as soon as the Bare Metal service acknowledges the request.
node – The value can be the name or ID of a node or a
Node
instance.
target – Target power state, one of
PowerAction
or a string.
wait – Whether to wait for the node to get into the expected state.
timeout – If wait
is set to True
, specifies how much (in
seconds) to wait for the expected state to be reached. The value of
None
(the default) means no client-side timeout.
Wait for the node to reach the power state.
Wait for a lock on the node to be released.
Bare metal nodes in ironic have a reservation lock that is used to represent that a conductor has locked the node while performing some sort of action, such as changing configuration as a result of a machine state change.
This lock can occur during power syncronization, and prevents updates to objects attached to the node, such as ports.
Note that nothing prevents a conductor from acquiring the lock again after this call returns, so it should be treated as best effort.
Returns immediately if there is no reservation on the node.
Validate required information on a node.
node – The value can be either the name or ID of a node or
a Node
instance.
required – List of interfaces that are required to pass validation. The default value is the list of minimum required interfaces for provisioning.
dict mapping interface names to
ValidationResult
objects.
ValidationException
if validation
fails for a required interface.
Enable maintenance mode on the node.
node – The value can be either the name or ID of a node or
a Node
instance.
reason – Optional reason for maintenance.
This Node
instance.
Disable maintenance mode on the node.
node – The value can be either the name or ID of a node or
a Node
instance.
This Node
instance.
Delete a node.
node – The value can be either the name or ID of a node or
a Node
instance.
ignore_missing (bool) – When set to False
, an exception
ResourceNotFound
will be raised
when the node could not be found. When set to True
, no
exception will be raised when attempting to delete a non-existent
node.
The instance of the node which was deleted.
Node
.
Retrieve a generator of ports.
details – A boolean indicating whether the detailed information for every port should be returned.
query (dict) –
Optional query parameters to be sent to restrict the ports returned. Available parameters include:
address
: Only return ports with the specified physical
hardware address, typically a MAC address.
driver
: Only return those with the specified driver
.
fields
: A list containing one or more fields to be returned
in the response. This may lead to some performance gain
because other fields of the resource are not refreshed.
limit
: Requests at most the specified number of ports be
returned from the query.
marker
: Specifies the ID of the last-seen port. Use the
limit
parameter to make an initial limited request and
use the ID of the last-seen port from the response as
the marker
value in a subsequent limited request.
node
:only return the ones associated with this specific node
(name or UUID), or an empty set if not found.
node_id
:only return the ones associated with this specific
node UUID, or an empty set if not found.
portgroup
: only return the ports associated with this
specific Portgroup (name or UUID), or an empty set if not
found. Added in API microversion 1.24.
sort_dir
: Sorts the response by the requested sort direction.
A valid value is asc
(ascending) or desc
(descending). Default is asc
. You can specify multiple
pairs of sort key and sort direction query parameters. If
you omit the sort direction in a pair, the API uses the
natural sorting direction of the server attribute that is
provided as the sort_key
.
sort_key
: Sorts the response by the this attribute value.
Default is id
. You can specify multiple pairs of sort
key and sort direction query parameters. If you omit the
sort direction in a pair, the API uses the natural sorting
direction of the server attribute that is provided as the
sort_key
.
A generator of port instances.
Create a new port from attributes.
Find a single port.
name_or_id (str) – The ID of a port.
ignore_missing (bool) – When set to False
, an exception of
ResourceNotFound
will be raised
when the port does not exist. When set to True`, None will
be returned when attempting to find a nonexistent port.
One Port
object
or None.
Get a specific port.
Update a port.
Apply a JSON patch to the port.
Delete a port.
port – The value can be either the ID of a port or
a Port
instance.
ignore_missing (bool) – When set to False
, an exception
ResourceNotFound
will be raised
when the port could not be found. When set to True
, no
exception will be raised when attempting to delete a non-existent
port.
The instance of the port which was deleted.
Port
.
Retrieve a generator of port groups.
details – A boolean indicating whether the detailed information for every port group should be returned.
query (dict) –
Optional query parameters to be sent to restrict the port groups returned. Available parameters include:
address
: Only return portgroups with the specified physical
hardware address, typically a MAC address.
fields
: A list containing one or more fields to be returned
in the response. This may lead to some performance gain
because other fields of the resource are not refreshed.
limit
: Requests at most the specified number of portgroups
returned from the query.
marker
: Specifies the ID of the last-seen portgroup. Use the
limit
parameter to make an initial limited request and
use the ID of the last-seen portgroup from the response as
the marker
value in a subsequent limited request.
node
:only return the ones associated with this specific node
(name or UUID), or an empty set if not found.
sort_dir
: Sorts the response by the requested sort direction.
A valid value is asc
(ascending) or desc
(descending). Default is asc
. You can specify multiple
pairs of sort key and sort direction query parameters. If
you omit the sort direction in a pair, the API uses the
natural sorting direction of the server attribute that is
provided as the sort_key
.
sort_key
: Sorts the response by the this attribute value.
Default is id
. You can specify multiple pairs of sort
key and sort direction query parameters. If you omit the
sort direction in a pair, the API uses the natural sorting
direction of the server attribute that is provided as the
sort_key
.
A generator of port group instances.
Create a new portgroup from attributes.
Find a single port group.
name_or_id (str) – The name or ID of a portgroup.
ignore_missing (bool) – When set to False
, an exception of
ResourceNotFound
will be raised
when the port group does not exist. When set to True`, None will
be returned when attempting to find a nonexistent port group.
One PortGroup
object or None.
Get a specific port group.
Update a port group.
Apply a JSON patch to the port_group.
Delete a port group.
port_group – The value can be either the name or ID of
a port group or a
PortGroup
instance.
ignore_missing (bool) – When set to False
, an exception
ResourceNotFound
will be raised
when the port group could not be found. When set to True
, no
exception will be raised when attempting to delete a non-existent
port group.
The instance of the port group which was deleted.
Retrieve a generator of drivers.
details (bool) – A boolean indicating whether the detailed information for every driver should be returned.
query (kwargs) – Optional query parameters to be sent to limit the resources being returned.
A generator of driver instances.
Retrieve a generator of chassis.
details – A boolean indicating whether the detailed information for every chassis should be returned.
query (dict) –
Optional query parameters to be sent to restrict the chassis to be returned. Available parameters include:
fields
: A list containing one or more fields to be returned
in the response. This may lead to some performance gain
because other fields of the resource are not refreshed.
limit
: Requests at most the specified number of items be
returned from the query.
marker
: Specifies the ID of the last-seen chassis. Use the
limit
parameter to make an initial limited request and
use the ID of the last-seen chassis from the response as
the marker
value in a subsequent limited request.
sort_dir
: Sorts the response by the requested sort direction.
A valid value is asc
(ascending) or desc
(descending). Default is asc
. You can specify multiple
pairs of sort key and sort direction query parameters. If
you omit the sort direction in a pair, the API uses the
natural sorting direction of the server attribute that is
provided as the sort_key
.
sort_key
: Sorts the response by the this attribute value.
Default is id
. You can specify multiple pairs of sort
key and sort direction query parameters. If you omit the
sort direction in a pair, the API uses the natural sorting
direction of the server attribute that is provided as the
sort_key
.
A generator of chassis instances.
Create a new chassis from attributes.
Find a single chassis.
name_or_id (str) – The ID of a chassis.
ignore_missing (bool) – When set to False
, an exception of
ResourceNotFound
will be raised
when the chassis does not exist. When set to True`, None will
be returned when attempting to find a nonexistent chassis.
One Chassis
object
or None.
Get a specific chassis.
Update a chassis.
Apply a JSON patch to the chassis.
Delete a chassis.
chassis – The value can be either the ID of a chassis or
a Chassis
instance.
ignore_missing (bool) – When set to False
, an exception
ResourceNotFound
will be raised
when the chassis could not be found. When set to True
, no
exception will be raised when attempting to delete a non-existent
chassis.
The instance of the chassis which was deleted.
Attach a VIF to the node.
The exact form of the VIF ID depends on the network interface used by the node. In the most common case it is a Network service port (NOT a Bare Metal port) ID. A VIF can only be attached to one node at a time.
node – The value can be either the name or ID of a node or
a Node
instance.
vif_id (string) – Backend-specific VIF ID.
retry_on_conflict – Whether to retry HTTP CONFLICT errors. This can happen when either the VIF is already used on a node or the node is locked. Since the latter happens more often, the default value is True.
None
NotSupported
if the server
does not support the VIF API.
Detach a VIF from the node.
The exact form of the VIF ID depends on the network interface used by the node. In the most common case it is a Network service port (NOT a Bare Metal port) ID.
node – The value can be either the name or ID of a node or
a Node
instance.
vif_id (string) – Backend-specific VIF ID.
ignore_missing (bool) – When set to False
ResourceNotFound
will be
raised when the VIF does not exist. Otherwise, False
is returned.
True
if the VIF was detached, otherwise False
.
NotSupported
if the server
does not support the VIF API.
List IDs of VIFs attached to the node.
The exact form of the VIF ID depends on the network interface used by the node. In the most common case it is a Network service port (NOT a Bare Metal port) ID.
node – The value can be either the name or ID of a node or
a Node
instance.
List of VIF IDs as strings.
NotSupported
if the server
does not support the VIF API.
Retrieve a generator of allocations.
query (dict) –
Optional query parameters to be sent to restrict the allocation to be returned. Available parameters include:
fields
: A list containing one or more fields to be returned
in the response. This may lead to some performance gain
because other fields of the resource are not refreshed.
limit
: Requests at most the specified number of items be
returned from the query.
marker
: Specifies the ID of the last-seen allocation. Use the
limit
parameter to make an initial limited request and
use the ID of the last-seen allocation from the response as
the marker
value in a subsequent limited request.
sort_dir
: Sorts the response by the requested sort direction.
A valid value is asc
(ascending) or desc
(descending). Default is asc
. You can specify multiple
pairs of sort key and sort direction query parameters. If
you omit the sort direction in a pair, the API uses the
natural sorting direction of the server attribute that is
provided as the sort_key
.
sort_key
: Sorts the response by the this attribute value.
Default is id
. You can specify multiple pairs of sort
key and sort direction query parameters. If you omit the
sort direction in a pair, the API uses the natural sorting
direction of the server attribute that is provided as the
sort_key
.
A generator of allocation instances.
Create a new allocation from attributes.
attrs (dict) – Keyword arguments that will be used to create a
Allocation
.
The results of allocation creation.
Get a specific allocation.
allocation – The value can be the name or ID of an allocation or
a Allocation
instance.
fields – Limit the resource fields to fetch.
One Allocation
ResourceNotFound
when no
allocation matching the name or ID could be found.
Update an allocation.
allocation – The value can be the name or ID of an allocation or
a Allocation
instance.
attrs (dict) – The attributes to update on the allocation
represented by the allocation
parameter.
The updated allocation.
Apply a JSON patch to the allocation.
allocation – The value can be the name or ID of an allocation or
a Allocation
instance.
patch – JSON patch to apply.
The updated allocation.
Delete an allocation.
allocation – The value can be the name or ID of an allocation or
a Allocation
instance.
ignore_missing (bool) – When set to False
, an exception
ResourceNotFound
will be raised
when the allocation could not be found. When set to True
, no
exception will be raised when attempting to delete a non-existent
allocation.
The instance of the allocation which was deleted.
Wait for the allocation to become active.
allocation – The value can be the name or ID of an allocation or
a Allocation
instance.
timeout – How much (in seconds) to wait for the allocation.
The value of None
(the default) means no client-side timeout.
ignore_error – If True
, this call will raise an exception
if the allocation reaches the error
state. Otherwise the error
state is considered successful and the call returns.
The instance of the allocation.
ResourceFailure
if allocation
fails and ignore_error
is False
.
ResourceTimeout
on timeout.
Retrieve a generator of volume_connector.
details – A boolean indicating whether the detailed information for every volume_connector should be returned.
query (dict) –
Optional query parameters to be sent to restrict the volume_connectors returned. Available parameters include:
fields
: A list containing one or more fields to be returned
in the response. This may lead to some performance gain
because other fields of the resource are not refreshed.
limit
: Requests at most the specified number of
volume_connector be returned from the query.
marker
: Specifies the ID of the last-seen volume_connector.
Use the limit
parameter to make an initial limited request
and use the ID of the last-seen volume_connector from the
response as the marker
value in subsequent limited request.
node
:only return the ones associated with this specific node
(name or UUID), or an empty set if not found.
sort_dir
:Sorts the response by the requested sort direction.
A valid value is asc
(ascending) or desc
(descending). Default is asc
. You can specify multiple
pairs of sort key and sort direction query parameters. If
you omit the sort direction in a pair, the API uses the
natural sorting direction of the server attribute that is
provided as the sort_key
.
sort_key
: Sorts the response by the this attribute value.
Default is id
. You can specify multiple pairs of sort
key and sort direction query parameters. If you omit the
sort direction in a pair, the API uses the natural sorting
direction of the server attribute that is provided as the
sort_key
.
A generator of volume_connector instances.
Create a new volume_connector from attributes.
attrs (dict) – Keyword arguments that will be used to create a
VolumeConnector
.
The results of volume_connector creation.
Find a single volume connector.
vc_id (str) – The ID of a volume connector.
ignore_missing (bool) – When set to False
, an exception of
ResourceNotFound
will be raised
when the volume connector does not exist. When set to True`,
None will be returned when attempting to find a nonexistent
volume connector.
One
VolumeConnector
object or None.
Get a specific volume_connector.
volume_connector – The value can be the ID of a
volume_connector or a
VolumeConnector
instance.
fields – Limit the resource fields to fetch.`
One :class: ~openstack.baremetal.v1.volume_connector.VolumeConnector
ResourceNotFound
when no
volume_connector matching the name or ID could be found.`
Update a volume_connector.
volume_connector – Either the ID of a volume_connector
or an instance of
VolumeConnector
.
attrs (dict) – The attributes to update on the
volume_connector represented by the volume_connector
parameter.
The updated volume_connector.
Apply a JSON patch to the volume_connector.
volume_connector – The value can be the ID of a
volume_connector or a
VolumeConnector
instance.
patch – JSON patch to apply.
The updated volume_connector.
Delete an volume_connector.
volume_connector – The value can be either the ID of a
volume_connector.VolumeConnector or a
VolumeConnector
instance.
ignore_missing (bool) – When set to False
, an exception
ResourceNotFound
will be raised
when the volume_connector could not be found.
When set to True
, no exception will be raised when
attempting to delete a non-existent volume_connector.
The instance of the volume_connector which was deleted.
Retrieve a generator of volume_target.
details – A boolean indicating whether the detailed information for every volume_target should be returned.
query (dict) –
Optional query parameters to be sent to restrict the volume_targets returned. Available parameters include:
fields
: A list containing one or more fields to be returned
in the response. This may lead to some performance gain
because other fields of the resource are not refreshed.
limit
: Requests at most the specified number of
volume_connector be returned from the query.
marker
: Specifies the ID of the last-seen volume_target.
Use the limit
parameter to make an initial limited request
and use the ID of the last-seen volume_target from the
response as the marker
value in subsequent limited request.
node
:only return the ones associated with this specific node
(name or UUID), or an empty set if not found.
sort_dir
:Sorts the response by the requested sort direction.
A valid value is asc
(ascending) or desc
(descending). Default is asc
. You can specify multiple
pairs of sort key and sort direction query parameters. If
you omit the sort direction in a pair, the API uses the
natural sorting direction of the server attribute that is
provided as the sort_key
.
sort_key
: Sorts the response by the this attribute value.
Default is id
. You can specify multiple pairs of sort
key and sort direction query parameters. If you omit the
sort direction in a pair, the API uses the natural sorting
direction of the server attribute that is provided as the
sort_key
.
A generator of volume_target instances.
Create a new volume_target from attributes.
attrs (dict) – Keyword arguments that will be used to create a
VolumeTarget
.
The results of volume_target creation.
Find a single volume target.
vt_id (str) – The ID of a volume target.
ignore_missing (bool) – When set to False
, an exception of
ResourceNotFound
will be raised
when the volume connector does not exist. When set to True`,
None will be returned when attempting to find a nonexistent
volume target.
One
VolumeTarget
object or None.
Get a specific volume_target.
volume_target – The value can be the ID of a
volume_target or a
VolumeTarget
instance.
fields – Limit the resource fields to fetch.`
One
VolumeTarget
ResourceNotFound
when no
volume_target matching the name or ID could be found.`
Update a volume_target.
volume_target – Either the ID of a volume_target
or an instance of
VolumeTarget
.
attrs (dict) – The attributes to update on the
volume_target represented by the volume_target
parameter.
The updated volume_target.
Apply a JSON patch to the volume_target.
volume_target – The value can be the ID of a
volume_target or a
VolumeTarget
instance.
patch – JSON patch to apply.
The updated volume_target.
Delete an volume_target.
volume_target – The value can be either the ID of a
volume_target.VolumeTarget or a
VolumeTarget
instance.
ignore_missing (bool) – When set to False
, an exception
ResourceNotFound
will be raised
when the volume_target could not be found.
When set to True
, no exception will be raised when
attempting to delete a non-existent volume_target.
The instance of the volume_target which was deleted.
Retrieve a generator of deploy_templates.
details – A boolean indicating whether the detailed information for every deploy_templates should be returned.
query (dict) – Optional query parameters to be sent to restrict the deploy_templates to be returned.
A generator of Deploy templates instances.
Create a new deploy_template from attributes.
attrs (dict) – Keyword arguments that will be used to create a
DeployTemplate
.
The results of deploy_template creation.
Update a deploy_template.
deploy_template – Either the ID of a deploy_template,
or an instance of
DeployTemplate
.
attrs (dict) – The attributes to update on
the deploy_template represented
by the deploy_template
parameter.
The updated deploy_template.
Delete a deploy_template.
either the ID of a deploy_template or a
DeployTemplate
instance.
ignore_missing (bool) – When set to False
,
an exception:class:~openstack.exceptions.ResourceNotFound
will be raised when the deploy_template
could not be found.
When set to True
, no
exception will be raised when attempting
to delete a non-existent
deploy_template.
The instance of the deploy_template which was deleted.
Get a specific deployment template.
deploy_template – The value can be the name or ID
of a deployment template
DeployTemplate
instance.
fields – Limit the resource fields to fetch.
One
DeployTemplate
ResourceNotFound
when no deployment template matching the name or
ID could be found.
Apply a JSON patch to the deploy_templates.
deploy_templates – The value can be the ID of a
deploy_template or a
DeployTemplate
instance.
patch – JSON patch to apply.
The updated deploy_template.
Helpers for building configdrive compatible with the Bare Metal service.
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.