ironicclient.v1.allocation module

class ironicclient.v1.allocation.Allocation(manager, info, loaded=False)[source]

Bases: ironicclient.common.base.Resource

class ironicclient.v1.allocation.AllocationManager(api)[source]

Bases: ironicclient.common.base.CreateManager

delete(allocation_id, os_ironic_api_version=None, global_request_id=None)[source]

Delete the Allocation.

Parameters
  • allocation_id – The UUID or name of an allocation.

  • os_ironic_api_version – String version (e.g. “1.35”) to use for the request. If not specified, the client’s default is used.

  • global_request_id – String containing global request ID header value (in form “req-<UUID>”) to use for the request.

get(allocation_id, fields=None, os_ironic_api_version=None, global_request_id=None)[source]

Get an allocation with the specified identifier.

Parameters
  • allocation_id – The UUID or name of an allocation.

  • fields – Optional, a list with a specified set of fields of the resource to be returned. Can not be used when ‘detail’ is set.

  • os_ironic_api_version – String version (e.g. “1.35”) to use for the request. If not specified, the client’s default is used.

  • global_request_id – String containing global request ID header value (in form “req-<UUID>”) to use for the request.

Returns

an Allocation object.

list(resource_class=None, state=None, node=None, limit=None, marker=None, sort_key=None, sort_dir=None, fields=None, owner=None, os_ironic_api_version=None, global_request_id=None)[source]

Retrieve a list of allocations.

Parameters
  • resource_class – Optional, get allocations with this resource class.

  • state – Optional, get allocations in this state. One of allocating, active or error.

  • node – UUID or name of the node of the allocation.

  • marker – Optional, the UUID of an allocation, eg the last allocation from a previous result set. Return the next result set.

  • limit

    The maximum number of results to return per

    request, if:

    1. limit > 0, the maximum number of allocations to return.

    2. limit == 0, return the entire list of allocations.

    3. limit == None, the number of items returned respect the maximum imposed by the Ironic API (see Ironic’s api.max_limit option).

  • sort_key – Optional, field used for sorting.

  • sort_dir – Optional, direction of sorting, either ‘asc’ (the default) or ‘desc’.

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

  • owner – Optional, project that owns the allocation.

  • os_ironic_api_version – String version (e.g. “1.35”) to use for the request. If not specified, the client’s default is used.

  • global_request_id – String containing global request ID header value (in form “req-<UUID>”) to use for the request.

Returns

A list of allocations.

Raises

InvalidAttribute if a subset of fields is requested with detail option set.

resource_class

alias of ironicclient.v1.allocation.Allocation

update(allocation_id, patch, os_ironic_api_version=None, global_request_id=None)[source]

Updates the Allocation. Only ‘name’ and ‘extra’ field are allowed.

Parameters
  • allocation_id – The UUID or name of an allocation.

  • patch – a json PATCH document to apply to this allocation.

  • os_ironic_api_version – String version (e.g. “1.35”) to use for the request. If not specified, the client’s default is used.

  • global_request_id – String containing global request ID header value (in form “req-<UUID>”) to use for the request.

wait(allocation_id, timeout=0, poll_interval=1, poll_delay_function=None, os_ironic_api_version=None, global_request_id=None)[source]

Wait for the Allocation to become active.

Parameters
  • timeout – timeout in seconds, no timeout if 0.

  • poll_interval – interval in seconds between polls.

  • poll_delay_function – function to use to wait between polls (defaults to time.sleep). Should take one argument - delay time in seconds. Any exceptions raised inside it will abort the wait.

  • os_ironic_api_version – String version (e.g. “1.35”) to use for the request. If not specified, the client’s default is used.

  • global_request_id – String containing global request ID header value (in form “req-<UUID>”) to use for the request.

Returns

updated Allocation object.

Raises

StateTransitionFailed if allocation reaches the error state.

Raises

StateTransitionTimeout on timeout.