openstack.placement.v1.allocation_candidate

The AllocationCandidate Class

The AllocationCandidate class inherits from Resource.

class openstack.placement.v1.allocation_candidate.AllocationCandidate(_synchronized=False, connection=None, **attrs)

A single candidate set of allocations.

Represents one entry from allocation_requests in the placement allocation candidates response, with the corresponding provider_summaries data filtered to only the resource providers referenced by this candidate.

An AllocationCandidate contains enough information to issue a update_allocation() call: the allocations dict maps resource provider UUIDs to the resources to request from each, while provider_summaries supplies the capacity and trait information for those providers to help choose between candidates.

The base resource

Parameters:
  • _synchronized – This is not intended to be used directly. See new() and existing().

  • connection – Reference to the Connection being used. Defaults to None to allow Resource objects to be used without an active Connection, such as in unit tests. Use of self._connection in Resource code should protect itself with a check for None.

resource_key = None

Singular form of key for resource.

resources_key = None

Plural form of key for resource.

base_path = '/allocation_candidates'

The base part of the URI for this resource.

requires_id = False

Do calls for this resource require an ID.

allow_list = True

Allow list operation for this resource.

mappings

A dict mapping request-group suffixes to the list of resource provider UUIDs that satisfy that group. Available from microversion 1.34.

provider_summaries

A dict keyed by resource provider UUID with capacity and trait information for each provider referenced in allocations. This is derived from the top-level provider_summaries field in the API response, filtered to only the providers relevant to this candidate.

classmethod list(session, paginated=True, base_path=None, allow_unknown_params=False, *, microversion=None, **params)

This method is a generator which yields resource objects.

A re-implementation of list() that handles the allocation candidates response format. The API returns a single dict with allocation_requests (a list) and provider_summaries (a shared dict keyed by resource provider UUID). This method yields one AllocationCandidate per entry in allocation_requests, with provider_summaries filtered to only the resource providers referenced by that candidate.

Refer to list() for full documentation including parameter, exception and return type documentation.