The ironic.api.controllers.v1.node Module

class ironic.api.controllers.v1.node.BootDeviceController[source]

Bases: pecan.rest.RestController

get(*args, **kwargs)[source]

Get the current boot device for a node.

Parameters:node_ident – the UUID or logical name of a node.
Returns:a json object containing:
boot_device:the boot device, one of ironic.common.boot_devices or None if it is unknown.
persistent:Whether the boot device will persist to all future boots or not, None if it is unknown.
put(*args, **kwargs)[source]

Set the boot device for a node.

Set the boot device to use on next reboot of the node.

Parameters:
  • node_ident – the UUID or logical name of a node.
  • boot_device – the boot device, one of ironic.common.boot_devices.
  • persistent – Boolean value. True if the boot device will persist to all future boots, False if not. Default: False.
supported(*args, **kwargs)[source]

Get a list of the supported boot devices.

Parameters:node_ident – the UUID or logical name of a node.
Returns:A json object with the list of supported boot devices.
class ironic.api.controllers.v1.node.ConsoleInfo(**kw)[source]

Bases: ironic.api.controllers.base.APIBase

API representation of the console information for a node.

classmethod sample()[source]
class ironic.api.controllers.v1.node.Node(**kwargs)[source]

Bases: ironic.api.controllers.base.APIBase

API representation of a bare metal node.

This class enforces type checking and value constraints, and converts between the internal object model and the API representation of a node.

classmethod sample(expand=True)[source]
class ironic.api.controllers.v1.node.NodeCollection(**kwargs)[source]

Bases: ironic.api.controllers.v1.collection.Collection

API representation of a collection of nodes.

classmethod sample()[source]
class ironic.api.controllers.v1.node.NodeConsoleController[source]

Bases: pecan.rest.RestController

get(*args, **kwargs)[source]

Get connection information about the console.

Parameters:node_ident – UUID or logical name of a node.
put(*args, **kwargs)[source]

Start and stop the node console.

Parameters:
  • node_ident – UUID or logical name of a node.
  • enabled – Boolean value; whether to enable or disable the console.
class ironic.api.controllers.v1.node.NodeMaintenanceController[source]

Bases: pecan.rest.RestController

delete(*args, **kwargs)[source]

Remove the node from maintenance mode.

Parameters:node_ident – the UUID or logical name of a node.
put(*args, **kwargs)[source]

Put the node in maintenance mode.

Parameters:
  • node_ident – the UUID or logical_name of a node.
  • reason – Optional, the reason why it’s in maintenance.
class ironic.api.controllers.v1.node.NodeManagementController[source]

Bases: pecan.rest.RestController

class ironic.api.controllers.v1.node.NodePatchType(**kw)[source]

Bases: ironic.api.controllers.v1.types.JsonPatchType

static internal_attrs()[source]
class ironic.api.controllers.v1.node.NodeStates(**kw)[source]

Bases: ironic.api.controllers.base.APIBase

API representation of the states of a node.

static convert(rpc_node)[source]
classmethod sample()[source]
class ironic.api.controllers.v1.node.NodeStatesController[source]

Bases: pecan.rest.RestController

get(*args, **kwargs)[source]

List the states of the node.

Parameters:node_ident – the UUID or logical_name of a node.
power(*args, **kwargs)[source]

Set the power state of the node.

Parameters:
  • node_ident – the UUID or logical name of a node.
  • target – The desired power state of the node.
Raises:

ClientSideError (HTTP 409) if a power operation is already in progress.

Raises:

InvalidStateRequested (HTTP 400) if the requested target state is not valid or if the node is in CLEANING state.

provision(*args, **kwargs)[source]

Asynchronous trigger the provisioning of the node.

This will set the target provision state of the node, and a background task will begin which actually applies the state change. This call will return a 202 (Accepted) indicating the request was accepted and is in progress; the client should continue to GET the status of this node to observe the status of the requested action.

Parameters:
  • node_ident – UUID or logical name of a node.
  • target – The desired provision state of the node or verb.
  • configdrive – Optional. A gzipped and base64 encoded configdrive. Only valid when setting provision state to “active”.
  • clean_steps

    An ordered list of cleaning steps that will be performed on the node. A cleaning step is a dictionary with required keys ‘interface’ and ‘step’, and optional key ‘args’. If specified, the value for ‘args’ is a keyword variable argument dictionary that is passed to the cleaning step method.:

    { 'interface': <driver_interface>,
      'step': <name_of_clean_step>,
      'args': {<arg1>: <value1>, ..., <argn>: <valuen>} }
    

    For example (this isn’t a real example, this cleaning step doesn’t exist):

    { 'interface': 'deploy',
      'step': 'upgrade_firmware',
      'args': {'force': True} }
    

    This is required (and only valid) when target is “clean”.

Raises:

NodeLocked (HTTP 409) if the node is currently locked.

Raises:

ClientSideError (HTTP 409) if the node is already being provisioned.

Raises:

InvalidParameterValue (HTTP 400), if validation of clean_steps or power driver interface fails.

Raises:

InvalidStateRequested (HTTP 400) if the requested transition is not possible from the current state.

Raises:

NodeInMaintenance (HTTP 400), if operation cannot be performed because the node is in maintenance mode.

Raises:

NoFreeConductorWorker (HTTP 503) if no workers are available.

Raises:

NotAcceptable (HTTP 406) if the API version specified does not allow the requested state transition.

raid(*args, **kwargs)[source]

Set the target raid config of the node.

Parameters:
  • node_ident – the UUID or logical name of a node.
  • target_raid_config – Desired target RAID configuration of the node. It may be an empty dictionary as well.
Raises:

UnsupportedDriverExtension, if the node’s driver doesn’t support RAID configuration.

Raises:

InvalidParameterValue, if validation of target raid config fails.

Raises:

NotAcceptable, if requested version of the API is less than 1.12.

class ironic.api.controllers.v1.node.NodeVendorPassthruController[source]

Bases: pecan.rest.RestController

REST controller for VendorPassthru.

This controller allow vendors to expose a custom functionality in the Ironic API. Ironic will merely relay the message from here to the appropriate driver, no introspection will be made in the message body.

methods(*args, **kwargs)[source]

Retrieve information about vendor methods of the given node.

Parameters:node_ident – UUID or logical name of a node.
Returns:dictionary with <vendor method name>:<method metadata> entries.
Raises:NodeNotFound if the node is not found.
class ironic.api.controllers.v1.node.NodesController[source]

Bases: pecan.rest.RestController

REST controller for Nodes.

delete(*args, **kwargs)[source]

Delete a node.

Parameters:node_ident – UUID or logical name of a node.
detail(*args, **kwargs)[source]

Retrieve a list of nodes with detail.

Parameters:
  • chassis_uuid – Optional UUID of a chassis, to get only nodes for that chassis.
  • instance_uuid – Optional UUID of an instance, to find the node associated with that instance.
  • associated – Optional boolean whether to return a list of associated or unassociated nodes. May be combined with other parameters.
  • maintenance – Optional boolean value that indicates whether to get nodes in maintenance mode (“True”), or not in maintenance mode (“False”).
  • provision_state – Optional string value to get only nodes in that provision state.
  • marker – pagination marker for large data sets.
  • limit – maximum number of resources to return in a single result. This value cannot be larger than the value of max_limit in the [api] section of the ironic configuration, or only max_limit resources will be returned.
  • sort_key – column to sort results by. Default: id.
  • sort_dir – direction to sort. “asc” or “desc”. Default: asc.
  • driver – Optional string value to get only nodes using that driver.
  • resource_class – Optional string value to get only nodes with that resource_class.
get_all(*args, **kwargs)[source]

Retrieve a list of nodes.

Parameters:
  • chassis_uuid – Optional UUID of a chassis, to get only nodes for that chassis.
  • instance_uuid – Optional UUID of an instance, to find the node associated with that instance.
  • associated – Optional boolean whether to return a list of associated or unassociated nodes. May be combined with other parameters.
  • maintenance – Optional boolean value that indicates whether to get nodes in maintenance mode (“True”), or not in maintenance mode (“False”).
  • provision_state – Optional string value to get only nodes in that provision state.
  • marker – pagination marker for large data sets.
  • limit – maximum number of resources to return in a single result. This value cannot be larger than the value of max_limit in the [api] section of the ironic configuration, or only max_limit resources will be returned.
  • sort_key – column to sort results by. Default: id.
  • sort_dir – direction to sort. “asc” or “desc”. Default: asc.
  • driver – Optional string value to get only nodes using that driver.
  • resource_class – Optional string value to get only nodes with that resource_class.
  • fields – Optional, a list with a specified set of fields of the resource to be returned.
get_one(*args, **kwargs)[source]

Retrieve information about the given node.

Parameters:
  • node_ident – UUID or logical name of a node.
  • fields – Optional, a list with a specified set of fields of the resource to be returned.
patch(*args, **kwargs)[source]

Update an existing node.

Parameters:
  • node_ident – UUID or logical name of a node.
  • patch – a json PATCH document to apply to this node.
post(*args, **kwargs)[source]

Create a new node.

Parameters:node – a node within the request body.
validate(*args, **kwargs)[source]

Validate the driver interfaces, using the node’s UUID or name.

Note that the ‘node_uuid’ interface is deprecated in favour of the ‘node’ interface

Parameters:
  • node – UUID or name of a node.
  • node_uuid – UUID of a node.

Project Source

This Page