Placement¶
This is a reference for the OpenStack Placement API. To learn more about OpenStack Placement API concepts, please refer to the Placement Introduction.
version¶
resource_classes¶
Create a new resource class. The new class must be a custom resource class, prefixed with CUSTOM_ and distinct from the standard resource classes.
Normal Response Codes: 201
Error response codes: badRequest(400), conflict(409)
A 400 BadRequest response code will be returned if the resource class does not have prefix CUSTOM_.
A 409 Conflict response code will be returned if another resource class exists with the provided name.
Request¶
Responses¶
201¶
Ok
404¶
Error
Create or validate the existence of single resource class identified by {name}.
Normal Response Codes: 201, 204
A 201 Created response code will be returned if the new resource class is successfully created. A 204 No Content response code will be returned if the resource class already exists.
Error response codes: badRequest(400)
Request¶
Responses¶
200¶
Ok
404¶
Error
Delete the resource class identified by {name}.
Normal Response Codes: 204
Error response codes: badRequest(400), itemNotFound(404), conflict(409)
A 400 BadRequest response code will be returned if trying to delete a standard resource class.
A 409 Conflict response code will be returned if there exist inventories for the resource class.
Responses¶
204¶
Ok
404¶
Error
resource_providers¶
Create a new resource provider.
Normal Response Codes: 201 (microversions 1.0 - 1.19), 200 (microversions 1.20 - )
Error response codes: conflict(409)
A 409 Conflict response code will be returned if another resource provider exists with the provided name or uuid.
Request¶
Responses¶
201¶
Ok
404¶
Error
Update the name of the resource provider identified by {uuid}.
Normal Response Codes: 200
Error response codes: badRequest(400), itemNotFound(404), conflict(409)
A 409 Conflict response code will be returned if another resource provider exists with the provided name.
Request¶
Responses¶
200¶
Ok
404¶
Error
Delete the resource provider identified by {uuid}. This will also disassociate aggregates and delete inventories.
Normal Response Codes: 204
Error response codes: itemNotFound(404), conflict(409)
A 409 Conflict response code will be returned if there exist allocations records for any of the inventories that would be deleted as a result of removing the resource provider.
This error code will be also returned if there are existing child resource providers under the parent resource provider being deleted.
Responses¶
204¶
Ok
404¶
Error
Deletes all inventory records for the resource provider identified by {uuid}.
Troubleshooting
The request returns an HTTP 409 when there are allocations against the provider or if the provider’s inventory is updated by another thread while attempting the operation.
Normal Response Codes: 204
Error response codes: itemNotFound(404), conflict(409)
Responses¶
204¶
Ok
404¶
Error
Delete the inventory record of the {resource_class} for the resource provider identified by {uuid}.
See [Troubleshooting] section in Delete resource provider inventories
for a description. In addition, the request returns
HTTP 409 when there are allocations for the specified resource
provider and resource class.
Normal Response Codes: 204
Error response codes: itemNotFound(404), conflict(409)
Responses¶
204¶
Ok
404¶
Error
Return a report of usage information for resources associated with the resource provider identified by {uuid}. The value is a dictionary of resource classes paired with the sum of the allocations of that resource class for this resource provider.
Normal Response Codes: 200
Error response codes: itemNotFound(404)
Responses¶
200¶
Ok
404¶
Error
Return a list of aggregates associated with the resource provider identified by {uuid}.
Normal Response Codes: 200
Error response codes: itemNotFound(404) if the provider does not exist. (If the provider has no aggregates, the result is 200 with an empty aggregate list.)
Responses¶
200¶
Ok
404¶
Error
allocations¶
Allocations are records representing resources that have been assigned and used by some consumer of that resource. They indicate the amount of a particular resource that has been allocated to a given consumer of that resource from a particular resource provider.
Create, update or delete allocations for multiple consumers in a single request. This allows a client to atomically set or swap allocations for multiple consumers as may be required during a migration or move type operation.
The allocations for an individual consumer uuid mentioned in the request can be removed by setting the allocations to an empty object (see the example below).
Available as of microversion 1.13.
Normal response codes: 204
Error response codes: badRequest(400), conflict(409)
Request¶
Responses¶
201¶
Ok
404¶
Error
Create or update one or more allocation records representing the consumption of one or more classes of resources from one or more resource providers by the consumer identified by {consumer_uuid}. If allocations already exist for this consumer, they are replaced.
Normal Response Codes: 204
Error response codes: badRequest(400), itemNotFound(404), conflict(409)
Request¶
Responses¶
200¶
Ok
404¶
Error
allocation_candidates¶
Returns a dictionary representing a collection of allocation requests
and resource provider summaries. Each allocation request has
information to form a PUT /allocations/{consumer_uuid}
request to claim
resources against a related set of resource providers. Additional parameters
might be required, see Update allocations. As several allocation
requests are available it’s necessary to select one. To make a
decision, resource provider summaries are provided with the
inventory/capacity information. For example, this information is used by
nova-scheduler’s FilterScheduler to make decisions about on which compute host
to build a server.
You can also find additional case studies of the request parameters in the Modeling with Provider Trees document.
Normal Response Codes: 200
Error response codes: badRequest(400)
Responses¶
200¶
Ok
404¶
Error
traits¶
Traits are qualitative characteristics of resource providers. The classic example for traits can be requesting disk from different providers: a user may request 80GiB of disk space for an instance (quantitative), but may also expect that the disk be SSD instead of spinning disk (qualitative). Traits provide a way to mark that a storage provider is SSD or spinning.
Insert a new custom trait. If traits already exists 204 will be returned.
There are two kinds of traits: the standard traits and the custom traits. The standard traits are interoperable across different OpenStack cloud deployments. The definition of standard traits comes from the os-traits library. The standard traits are read-only in the placement API which means that the user can’t modify any standard traits through API. The custom traits are used by admin users to manage the non-standard qualitative information of resource providers.
Normal Response Codes: 201, 204
Error response codes: badRequest(400)
Request¶
Responses¶
200¶
Ok
404¶
Error
usages¶
Represent the consumption of resources for a project and user.
Return a report of usage information for resources associated with the project identified by project_id and user identified by user_id. The value is a dictionary of resource classes paired with the sum of the allocations of that resource class for provided parameters.
Normal Response Codes: 200
Error response codes: badRequest(400)
Responses¶
200¶
Ok
404¶
Error
reshaper¶
Note
Atomically migrate resource provider inventories and associated allocations. This is used when some of the inventory needs to move from one resource provider to another, such as when a class of inventory moves from a parent provider to a new child provider.
Normal Response Codes: 204
Error Response Codes: badRequest(400), conflict(409)
Request¶
Responses¶
201¶
Ok
404¶
Error