Files
nova/placement-api-ref/source/reshaper.inc
Chris Dent 4d525b4ec1 [placement] Add /reshaper handler for POST
/reshaper provides a way to atomically modify some allocations and
inventory in a single transaction, allowing operations like migrating
some inventory from a parent provider to a new child.

A fair amount of code is reused from handler/inventory.py, some
refactoring is in order before things get too far with that.

In handler/allocation.py some code is extracted to its own methods
so it can be reused from reshaper.py.

This is done as microversion 1.30.

A suite of gabbi tests is provided which attempt to cover various
failures including schema violations, generation conflicts, and
data conflicts.

api-ref, release notes and rest history are updated

Change-Id: I5b33ac3572bc3789878174ffc86ca42ae8035cfa
Partially-Implements: blueprint reshape-provider-tree
2018-08-23 00:36:17 +00:00

45 lines
1.4 KiB
PHP

========
Reshaper
========
.. note:: Reshaper requests are available starting from version 1.30.
Reshaper
========
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.
.. note:: This is a special operation that should only be used in rare cases
of resource provider topology changing when inventory is in use.
Only use this if you are really sure of what you are doing.
.. rest_method:: POST /reshaper
Normal Response Codes: 204
Error Response Codes: badRequest(400), conflict(409)
Request
-------
.. rest_parameters:: parameters.yaml
- inventories: reshaper_inventories
- inventories.{resource_provider_uuid}.resource_provider_generation: resource_provider_generation
- inventories.{resource_provider_uuid}.inventories: inventories
- allocations: reshaper_allocations
- allocations.{consumer_uuid}.allocations: allocations_dict_empty
- allocations.{consumer_uuid}.allocations.{resource_provider_uuid}.resources: resources
- allocations.{consumer_uuid}.project_id: project_id_body
- allocations.{consumer_uuid}.user_id: user_id_body
- allocations.{consumer_uuid}.consumer_generation: consumer_generation
Request Example
---------------
.. literalinclude:: ./samples/reshaper/post-reshaper-1.30.json
:language: javascript