[placement] Add api-ref for PUT resource provider

This provides simple documentation of the request and response body
parameters when setting or replacing a resource provider.

Change-Id: Ifa3c0bad0ec3f9d85f0f18bfd6f90e0bcb52773d
This commit is contained in:
Andrey Volkov 2017-05-24 11:40:32 +03:00
parent 06141e2064
commit f5c6af7619
3 changed files with 72 additions and 0 deletions

View File

@ -41,3 +41,47 @@ Response Example
.. literalinclude:: get-resource_provider.json
:language: javascript
Update resource provider
========================
.. rest_method:: PUT /resource_providers/{uuid}
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
-------
.. rest_parameters:: parameters.yaml
- uuid: resource_provider_uuid_path
- name: resource_provider_name
Request example
---------------
.. literalinclude:: update-resource_provider-request.json
:language: javascript
Response
--------
.. rest_parameters:: parameters.yaml
- generation: resource_provider_generation
- uuid: resource_provider_uuid
- links: resource_provider_links
- name: resource_provider_name
Response Example
----------------
.. literalinclude:: update-resource_provider.json
:language: javascript

View File

@ -0,0 +1 @@
{"name": "Shared storage"}

View File

@ -0,0 +1,27 @@
{
"generation": 0,
"links": [
{
"href": "/placement/resource_providers/33f26ae0-dbf2-485b-a24a-244d8280e29f",
"rel": "self"
},
{
"href": "/placement/resource_providers/33f26ae0-dbf2-485b-a24a-244d8280e29f/aggregates",
"rel": "aggregates"
},
{
"href": "/placement/resource_providers/33f26ae0-dbf2-485b-a24a-244d8280e29f/inventories",
"rel": "inventories"
},
{
"href": "/placement/resource_providers/33f26ae0-dbf2-485b-a24a-244d8280e29f/usages",
"rel": "usages"
},
{
"href": "/placement/resource_providers/33f26ae0-dbf2-485b-a24a-244d8280e29f/traits",
"rel": "traits"
}
],
"name": "Shared storage",
"uuid": "33f26ae0-dbf2-485b-a24a-244d8280e29f"
}