[placement] Add api-ref for PUT RP inventory

This provides simple documentation of the response body and path
parameters when setting or replacing an inventory record for a resource
provider.

Change-Id: I77d99c174b50eef5d2b72e226ff31f03807e69aa
This commit is contained in:
Andrey Volkov 2017-04-10 13:03:20 +03:00
parent 59c02f48ee
commit f31c79f961
3 changed files with 65 additions and 0 deletions

View File

@ -42,3 +42,55 @@ Response Example
.. literalinclude:: get-inventory.json
:language: javascript
Update resource provider inventory
==================================
Replace the inventory record of the `{resource_class}` for the resource
provider identified by `{uuid}`.
.. rest_method:: PUT /resource_providers/{uuid}/inventories/{resource_class}
Normal Response Codes: 200
Error response codes: badRequest(400), itemNotFound(404), conflict(409)
Request
-------
.. rest_parameters:: parameters.yaml
- uuid: resource_provider_uuid_path
- resource_class: resource_class_path
- resource_provider_generation: resource_provider_generation
- allocation_ratio: allocation_ratio_opt
- max_unit: max_unit_opt
- min_unit: min_unit_opt
- reserved: reserved_opt
- step_size: step_size_opt
- total: total
Request example
---------------
.. literalinclude:: update-inventory-request.json
:language: javascript
Response
--------
.. rest_parameters:: parameters.yaml
- resource_provider_generation: resource_provider_generation
- allocation_ratio: allocation_ratio
- max_unit: max_unit
- min_unit: min_unit
- reserved: reserved
- step_size: step_size
- total: total
Response Example
----------------
.. literalinclude:: update-inventory.json
:language: javascript

View File

@ -0,0 +1,4 @@
{
"resource_provider_generation": 7,
"total": 50
}

View File

@ -0,0 +1,9 @@
{
"allocation_ratio": 1.0,
"max_unit": 2147483647,
"min_unit": 1,
"reserved": 0,
"resource_provider_generation": 8,
"step_size": 1,
"total": 50
}