ironic.objects.node module

ironic.objects.node module

service None

Bases: ironic.objects.base.IronicObject, oslo_versionedobjects.base.VersionedObjectDictCompat

Node.as_dict(secure=False)

Return the object represented as a dict.

The returned object is JSON-serialisable.

Node.create(context=None)

Create a Node record in the DB.

Column-wise updates will be made based on the result of self.what_changed(). If target_power_state is provided, it will be checked against the in-database copy of the node before updates are made.

Parameters:context – Security context. NOTE: This should only be used internally by the indirection_api. Unfortunately, RPC requires context as the first argument, even though we don’t use it. A context should be set when instantiating the object, e.g.: Node(context)
Raises:InvalidParameterValue if some property values are invalid.
Node.destroy(context=None)

Delete the Node from the DB.

Parameters:context – Security context. NOTE: This should only be used internally by the indirection_api. Unfortunately, RPC requires context as the first argument, even though we don’t use it. A context should be set when instantiating the object, e.g.: Node(context)
classmethod Node.get(context, node_id)

Find a node based on its id or uuid and return a Node object.

Parameters:
  • context – Security context
  • node_id – the id or uuid of a node.
Returns:

a Node object.

classmethod Node.get_by_id(context, node_id)

Find a node based on its integer ID and return a Node object.

Parameters:
  • cls – the Node
  • context – Security context
  • node_id – the ID of a node.
Returns:

a Node object.

classmethod Node.get_by_instance_uuid(context, instance_uuid)

Find a node based on the instance UUID and return a Node object.

Parameters:
  • cls – the Node
  • context – Security context
  • uuid – the UUID of the instance.
Returns:

a Node object.

classmethod Node.get_by_name(context, name)

Find a node based on name and return a Node object.

Parameters:
  • cls – the Node
  • context – Security context
  • name – the logical name of a node.
Returns:

a Node object.

classmethod Node.get_by_port_addresses(context, addresses)

Get a node by associated port addresses.

Parameters:
  • cls – the Node
  • context – Security context.
  • addresses – A list of port addresses.
Raises:

NodeNotFound if the node is not found.

Returns:

a Node object.

classmethod Node.get_by_uuid(context, uuid)

Find a node based on UUID and return a Node object.

Parameters:
  • cls – the Node
  • context – Security context
  • uuid – the UUID of a node.
Returns:

a Node object.

classmethod Node.list(context, limit=None, marker=None, sort_key=None, sort_dir=None, filters=None)

Return a list of Node objects.

Parameters:
  • cls – the Node
  • context – Security context.
  • limit – maximum number of resources to return in a single result.
  • marker – pagination marker for large data sets.
  • sort_key – column to sort results by.
  • sort_dir – direction to sort. “asc” or “desc”.
  • filters – Filters to apply.
Returns:

a list of Node object.

Node.refresh(context=None)

Refresh the object by re-fetching from the DB.

Parameters:context – Security context. NOTE: This should only be used internally by the indirection_api. Unfortunately, RPC requires context as the first argument, even though we don’t use it. A context should be set when instantiating the object, e.g.: Node(context)
classmethod Node.release(context, tag, node_id)

Release the reservation on a node.

Parameters:
  • context – Security context.
  • tag – A string uniquely identifying the reservation holder.
  • node_id – A node id or uuid.
Raises:

NodeNotFound if the node is not found.

classmethod Node.reserve(context, tag, node_id)

Get and reserve a node.

To prevent other ManagerServices from manipulating the given Node while a Task is performed, mark it reserved by this host.

Parameters:
  • cls – the Node
  • context – Security context.
  • tag – A string uniquely identifying the reservation holder.
  • node_id – A node ID or UUID.
Raises:

NodeNotFound if the node is not found.

Returns:

a Node object.

Node.save(context=None)

Save updates to this Node.

Column-wise updates will be made based on the result of self.what_changed(). If target_power_state is provided, it will be checked against the in-database copy of the node before updates are made.

Parameters:context – Security context. NOTE: This should only be used internally by the indirection_api. Unfortunately, RPC requires context as the first argument, even though we don’t use it. A context should be set when instantiating the object, e.g.: Node(context)
Raises:InvalidParameterValue if some property values are invalid.
Node.touch_provisioning(context=None)

Touch the database record to mark the provisioning as alive.

service None

Bases: ironic.objects.notification.NotificationBase

Notification emitted when ironic creates, updates or deletes a node.

service None

Bases: ironic.objects.node.NodePayload

Payload schema for when ironic creates, updates or deletes a node.

service None

Bases: ironic.objects.notification.NotificationBase

Notification emitted when node console state changed.

service None

Bases: ironic.objects.notification.NotificationBase

Notification for when a node’s power state is corrected in the database.

This notification is emitted when ironic detects that the actual power state on a bare metal hardware is different from the power state on an ironic node (DB). This notification is emitted after the database is updated to reflect this correction.

service None

Bases: ironic.objects.node.NodePayload

Notification payload schema for when a node’s power state is corrected.

“from_power” indicates the previous power state on the ironic node before the node was updated.

service None

Bases: ironic.objects.notification.NotificationBase

Notification emitted when maintenance state changed via API.

service None

Bases: ironic.objects.notification.NotificationPayloadBase

Base class used for all notification payloads about a Node object.

service None

Bases: ironic.objects.notification.NotificationBase

Notification emitted when ironic changes a node’s power state.

service None

Bases: ironic.objects.node.NodePayload

Payload schema for when ironic changes a node’s power state.

service None

Bases: ironic.objects.notification.NotificationBase

Notification emitted when ironic changes a node provision state.

service None

Bases: ironic.objects.node.NodePayload

Payload schema for when ironic changes a node provision state.

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.