1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
|
========================
Resource provider traits
========================
See `Traits`_ for a description.
This group of API requests queries/edits the association between
traits and resource providers.
.. note:: Traits API requests are available starting from version 1.6.
List resource provider traits
=============================
Return a list of traits for the resource provider identified by `{uuid}`.
.. rest_method:: GET /resource_providers/{uuid}/traits
Normal Response Codes: 200
Error response codes: itemNotFound(404)
Request
-------
.. rest_parameters:: parameters.yaml
- uuid: resource_provider_uuid_path
Response
--------
.. rest_parameters:: parameters.yaml
- traits: traits
- resource_provider_generation: resource_provider_generation
Response Example
----------------
.. literalinclude:: ./samples/resource_provider_traits/get-resource_provider-traits.json
:language: javascript
Update resource provider traits
===============================
Associate traits with the resource provider identified by `{uuid}`.
All the associated traits will be replaced by the traits specified in
the request body.
.. rest_method:: PUT /resource_providers/{uuid}/traits
Normal Response Codes: 200
Error response codes: badRequest(400), itemNotFound(404), conflict(409)
* `400 Bad Request` if any of the specified traits are not valid. The valid
traits can be queried by `GET /traits`.
* `409 Conflict` if the `resource_provider_generation` doesn't match with the
server side.
Request
-------
.. rest_parameters:: parameters.yaml
- uuid: resource_provider_uuid_path
- traits: traits
- resource_provider_generation: resource_provider_generation
Request example
---------------
.. literalinclude:: ./samples/resource_provider_traits/update-resource_provider-traits-request.json
:language: javascript
Response
--------
.. rest_parameters:: parameters.yaml
- traits: traits
- resource_provider_generation: resource_provider_generation
Response Example
----------------
.. literalinclude:: ./samples/resource_provider_traits/update-resource_provider-traits.json
:language: javascript
Delete resource provider traits
===============================
Dissociate all the traits from the resource provider identified by `{uuid}`.
.. rest_method:: DELETE /resource_providers/{uuid}/traits
Normal Response Codes: 204
Error response codes: itemNotFound(404), conflict(409)
* `409 Conflict` if the provider's traits are updated by another
thread while attempting the operation.
.. note:: Since this request does not accept the resource provider generation,
it is not safe to use when multiple threads are managing traits for
a single provider. In such situations, use the
``PUT /resource_providers/{uuid}/traits`` API with an empty
``traits`` list.
Request
-------
.. rest_parameters:: parameters.yaml
- uuid: resource_provider_uuid_path
Response
--------
No body content is returned on a successful DELETE.
|