[placement] Add api-ref for GET RP inventory

This provides simple documentation of the response body and path
parameters when showing a single class of inventory for a resource
provider.

Change-Id: Ic562baa3e74445c8f6dbeb416c1ec183cc2ad14d
This commit is contained in:
Andrey Volkov 2017-04-10 12:34:00 +03:00
parent b22f64a8a2
commit 59c02f48ee
4 changed files with 61 additions and 4 deletions

View File

@ -0,0 +1,9 @@
{
"allocation_ratio": 16.0,
"max_unit": 4,
"min_unit": 1,
"reserved": 0,
"resource_provider_generation": 9,
"step_size": 1,
"total": 4
}

View File

@ -15,3 +15,4 @@ Openstack Placement API concepts, please refer to the
.. include:: root.inc
.. include:: resource_providers.inc
.. include:: inventories.inc
.. include:: inventory.inc

View File

@ -0,0 +1,44 @@
===========================
Resource provider inventory
===========================
See `Resource provider inventories`_ for a description.
This group of API calls works with a single inventory identified by ``resource_class``.
One inventory can be listed, created, updated and deleted per each call.
Show resource provider inventory
================================
.. rest_method:: GET /resource_providers/{uuid}/inventories/{resource_class}
Normal Response Codes: 200
Error response codes: itemNotFound(404)
Request
-------
.. rest_parameters:: parameters.yaml
- uuid: resource_provider_uuid_path
- resource_class: resource_class_path
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:: get-inventory.json
:language: javascript

View File

@ -1,4 +1,10 @@
# variables in path
resource_class_path: &resource_class_path
type: string
in: path
required: true
description: >
The name of one resource class.
resource_provider_uuid_path: &resource_provider_uuid_path
type: string
in: path
@ -88,11 +94,8 @@ reserved_opt:
<<: *reserved
required: false
resource_class:
type: string
<<: *resource_class_path
in: body
required: true
description: >
The name of the resource class.
resource_provider_generation:
type: integer
in: body