The ironic.api.controllers.v1.node Module

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.InjectNmiController[source]

Bases: pecan.rest.RestController

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

Inject NMI for a node.

Inject NMI (Non Maskable Interrupt) for a node immediately.

Parameters:node_ident – the UUID or logical name of a node.
Raises:NotFound if requested version of the API doesn’t support inject nmi.
Raises:HTTPForbidden if the policy is not authorized.
Raises:NodeNotFound if the node is not found.
Raises:NodeLocked if the node is locked by another conductor.
Raises:UnsupportedDriverExtension if the node’s driver doesn’t support management or management.inject_nmi.
Raises:InvalidParameterValue when the wrong driver info is specified or an invalid boot device is specified.
Raises:MissingParameterValue if missing supplied info.
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.
  • timeout – timeout (in seconds) positive integer (> 0) for any power state. None indicates to use default timeout.
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.

Raises:

NotAcceptable (HTTP 406) for soft reboot, soft power off or timeout parameter, if requested version of the API is less than 1.27.

Raises:

Invalid (HTTP 400) if timeout value is less than 1.

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” or “rebuild”.
  • 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”.

  • rescue_password – A string representing the password to be set inside the rescue environment. This is required (and only valid), when target is “rescue”.
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.NodeTraitsController(node_ident)[source]

Bases: pecan.rest.RestController

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

Remove one or all traits from a node.

Parameters:trait – String value; trait to remove from a node, or None. If None, all traits are removed.
get_all(*args, **kwargs)[source]

List node traits.

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

Add a trait to a node.

Parameters:
  • trait – String value; trait to add to a node, or None. Mutually exclusive with ‘traits’. If not None, adds this trait to the node.
  • traits – List of Strings; traits to set for a node, or None. Mutually exclusive with ‘trait’. If not None, replaces the node’s traits with this list.
class ironic.api.controllers.v1.node.NodeVIFController(node_ident)[source]

Bases: pecan.rest.RestController

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

Detach a VIF from this node

Parameters:vif_id – The ID of a VIF to detach
get_all(*args, **kwargs)[source]

Get a list of attached VIFs

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

Attach a VIF to this node

Parameters:vif – a dictionary of information about a VIF. It must have an ‘id’ key, whose value is a unique identifier for that VIF.
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.
class ironic.api.controllers.v1.node.Traits(**kw)[source]

Bases: ironic.api.controllers.base.APIBase

API representation of the traits for a node.

classmethod sample()[source]
class ironic.api.controllers.v1.node.VifCollection(**kw)[source]

Bases: wsme.types.Base

API representation of a collection of VIFs.

static collection_from_list(vifs)[source]
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.