From f31c79f961507a282bb8362168f59f462b8fa7a6 Mon Sep 17 00:00:00 2001 From: Andrey Volkov Date: Mon, 10 Apr 2017 13:03:20 +0300 Subject: [PATCH] [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 --- placement-api-ref/source/inventory.inc | 52 +++++++++++++++++++ .../source/update-inventory-request.json | 4 ++ .../source/update-inventory.json | 9 ++++ 3 files changed, 65 insertions(+) create mode 100644 placement-api-ref/source/update-inventory-request.json create mode 100644 placement-api-ref/source/update-inventory.json diff --git a/placement-api-ref/source/inventory.inc b/placement-api-ref/source/inventory.inc index c0704a8d03fe..aaf5f4cca191 100644 --- a/placement-api-ref/source/inventory.inc +++ b/placement-api-ref/source/inventory.inc @@ -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 \ No newline at end of file diff --git a/placement-api-ref/source/update-inventory-request.json b/placement-api-ref/source/update-inventory-request.json new file mode 100644 index 000000000000..cee9a2f58364 --- /dev/null +++ b/placement-api-ref/source/update-inventory-request.json @@ -0,0 +1,4 @@ +{ + "resource_provider_generation": 7, + "total": 50 +} diff --git a/placement-api-ref/source/update-inventory.json b/placement-api-ref/source/update-inventory.json new file mode 100644 index 000000000000..690b5837a0fe --- /dev/null +++ b/placement-api-ref/source/update-inventory.json @@ -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 +}