ironic.api.controllers.v1.volume_target module

class ironic.api.controllers.v1.volume_target.VolumeTargetsController(*args, **kwargs)[source]

Bases: RestController

REST controller for VolumeTargets.

delete(target_uuid)[source]

Delete a volume target.

Parameters:

target_uuid – UUID of a volume target.

Raises:

OperationNotPermitted if accessed with specifying a parent node.

Raises:

NodeLocked if node is locked by another conductor

Raises:

NodeNotFound if the node associated with the target does not exist

Raises:

VolumeTargetNotFound if the volume target cannot be found

Raises:

InvalidStateRequested If a node associated with the volume target is not powered off.

get_all(node=None, marker=None, limit=None, sort_key='id', sort_dir='asc', fields=None, detail=None, project=None)[source]

Retrieve a list of volume targets.

Parameters:
  • node – UUID or name of a node, to get only volume targets for that node.

  • 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”.

  • fields – Optional, a list with a specified set of fields of the resource to be returned.

  • detail – Optional, whether to retrieve with detail.

  • project – Optional, an associated node project (owner, or lessee) to filter the query upon.

Returns:

a list of volume targets, or an empty list if no volume target is found.

Raises:

InvalidParameterValue if sort_key does not exist

Raises:

InvalidParameterValue if sort key is invalid for sorting.

Raises:

InvalidParameterValue if both fields and detail are specified.

get_one(target_uuid, fields=None)[source]

Retrieve information about the given volume target.

Parameters:
  • target_uuid – UUID of a volume target.

  • fields – Optional, a list with a specified set of fields of the resource to be returned.

Returns:

API-serializable volume target object.

Raises:

OperationNotPermitted if accessed with specifying a parent node.

Raises:

VolumeTargetNotFound if no volume target with this UUID exists

invalid_sort_key_list = ['extra', 'properties']
patch(target_uuid, patch)[source]

Update an existing volume target.

Parameters:
  • target_uuid – UUID of a volume target.

  • patch – a json PATCH document to apply to this volume target.

Returns:

API-serializable volume target object.

Raises:

OperationNotPermitted if accessed with specifying a parent node.

Raises:

PatchError if a given patch can not be applied.

Raises:

InvalidParameterValue if the volume target’s UUID is being changed

Raises:

NodeLocked if the node is already locked

Raises:

NodeNotFound if the node associated with the volume target does not exist

Raises:

VolumeTargetNotFound if the volume target cannot be found

Raises:

VolumeTargetBootIndexAlreadyExists if a volume target already exists with the same node ID and boot index values

Raises:

InvalidUUID if invalid node UUID is passed in the patch.

Raises:

InvalidStateRequested If a node associated with the volume target is not powered off.

post(target)[source]

Create a new volume target.

Parameters:

target – a volume target within the request body.

Returns:

API-serializable volume target object.

Raises:

OperationNotPermitted if accessed with specifying a parent node.

Raises:

VolumeTargetBootIndexAlreadyExists if a volume target already exists with the same node ID and boot index

Raises:

VolumeTargetAlreadyExists if a volume target with the same UUID exists