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_requestsin the placement allocation candidates response, with the correspondingprovider_summariesdata filtered to only the resource providers referenced by this candidate.An
AllocationCandidatecontains enough information to issue aupdate_allocation()call: theallocationsdict maps resource provider UUIDs to the resources to request from each, whileprovider_summariessupplies 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()andexisting().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._connectionin 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-levelprovider_summariesfield 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 withallocation_requests(a list) andprovider_summaries(a shared dict keyed by resource provider UUID). This method yields oneAllocationCandidateper entry inallocation_requests, withprovider_summariesfiltered to only the resource providers referenced by that candidate.Refer to
list()for full documentation including parameter, exception and return type documentation.