ironic.api.controllers.v1.allocation module

ironic.api.controllers.v1.allocation module

class ironic.api.controllers.v1.allocation.Allocation(**kwargs)[source]

Bases: ironic.api.controllers.base.APIBase

API representation of an allocation.

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

candidate_nodes

Candidate nodes for this allocation

Add links to the allocation.

created_at

Complex type attribute definition.

Example:

class MyComplexType(wsme.types.Base):
    optionalvalue = int
    mandatoryvalue = wsattr(int, mandatory=True)
    named_value = wsattr(int, name='named.value')

After inspection, the non-wsattr attributes will be replaced, and the above class will be equivalent to:

class MyComplexType(wsme.types.Base):
    optionalvalue = wsattr(int)
    mandatoryvalue = wsattr(int, mandatory=True)
extra

This allocation’s meta data

last_error

Last error that happened to this allocation

A list containing a self link and associated allocation links

name

The logical name for this allocation

node_uuid

The UUID of the node this allocation belongs to

resource_class

Requested resource class for this allocation

classmethod sample()[source]

Return a sample of the allocation.

sanitize(fields=None)[source]

Removes sensitive and unrequested data.

Will only keep the fields specified in the fields parameter.

Parameters:fields (list of str) – list of fields to preserve, or None to preserve them all
state

The current state of the allocation

traits

Requested traits for the allocation

updated_at

Complex type attribute definition.

Example:

class MyComplexType(wsme.types.Base):
    optionalvalue = int
    mandatoryvalue = wsattr(int, mandatory=True)
    named_value = wsattr(int, name='named.value')

After inspection, the non-wsattr attributes will be replaced, and the above class will be equivalent to:

class MyComplexType(wsme.types.Base):
    optionalvalue = wsattr(int)
    mandatoryvalue = wsattr(int, mandatory=True)
uuid

Unique UUID for this allocation

class ironic.api.controllers.v1.allocation.AllocationCollection(**kwargs)[source]

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

API representation of a collection of allocations.

allocations

A list containing allocation objects

created_at

Complex type attribute definition.

Example:

class MyComplexType(wsme.types.Base):
    optionalvalue = int
    mandatoryvalue = wsattr(int, mandatory=True)
    named_value = wsattr(int, name='named.value')

After inspection, the non-wsattr attributes will be replaced, and the above class will be equivalent to:

class MyComplexType(wsme.types.Base):
    optionalvalue = wsattr(int)
    mandatoryvalue = wsattr(int, mandatory=True)
next

Complex type attribute definition.

Example:

class MyComplexType(wsme.types.Base):
    optionalvalue = int
    mandatoryvalue = wsattr(int, mandatory=True)
    named_value = wsattr(int, name='named.value')

After inspection, the non-wsattr attributes will be replaced, and the above class will be equivalent to:

class MyComplexType(wsme.types.Base):
    optionalvalue = wsattr(int)
    mandatoryvalue = wsattr(int, mandatory=True)
classmethod sample()[source]

Return a sample of the allocation.

updated_at

Complex type attribute definition.

Example:

class MyComplexType(wsme.types.Base):
    optionalvalue = int
    mandatoryvalue = wsattr(int, mandatory=True)
    named_value = wsattr(int, name='named.value')

After inspection, the non-wsattr attributes will be replaced, and the above class will be equivalent to:

class MyComplexType(wsme.types.Base):
    optionalvalue = wsattr(int)
    mandatoryvalue = wsattr(int, mandatory=True)
class ironic.api.controllers.v1.allocation.AllocationsController[source]

Bases: pecan.rest.RestController

REST controller for allocations.

delete(allocation_ident)[source]

Delete an allocation.

Parameters:allocation_ident – UUID or logical name of an allocation.
get_all(node=None, resource_class=None, state=None, marker=None, limit=None, sort_key='id', sort_dir='asc', fields=None)[source]

Retrieve a list of allocations.

Parameters:
  • node – UUID or name of a node, to get only allocations for that node.
  • resource_class – Filter by requested resource class.
  • state – Filter by allocation 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.
  • fields – Optional, a list with a specified set of fields of the resource to be returned.
get_one(allocation_ident, fields=None)[source]

Retrieve information about the given allocation.

Parameters:
  • allocation_ident – UUID or logical name of an allocation.
  • fields – Optional, a list with a specified set of fields of the resource to be returned.
invalid_sort_key_list = ['extra', 'candidate_nodes', 'traits']
post(allocation)[source]

Create a new allocation.

Parameters:allocation – an allocation within the request body.
class ironic.api.controllers.v1.allocation.NodeAllocationController(node_ident)[source]

Bases: pecan.rest.RestController

REST controller for allocations.

delete()[source]
get_all(fields=None)[source]
invalid_sort_key_list = ['extra', 'candidate_nodes', 'traits']
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.