| 1 |
.. -*- rst -*- |
| 2 |
.. needs:body_verification |
| 3 |
|
| 4 |
Attributes |
| 5 |
++++++++++ |
| 6 |
|
| 7 |
Lists, shows details, creates and deletes for attributes. |
| 8 |
|
| 9 |
A `attribute` represents the trait of a physical card like FPGA or GPU. |
| 10 |
|
| 11 |
List Attributes |
| 12 |
--------------- |
| 13 |
|
| 14 |
.. rest_method:: GET /v2/attributes |
| 15 |
|
| 16 |
Lists UUID, deployable_id, key, value and more information for all devices. |
| 17 |
|
| 18 |
Normal response codes: 200 |
| 19 |
|
| 20 |
Error response codes: unauthorized(401), forbidden(403) |
| 21 |
|
| 22 |
Request |
| 23 |
======= |
| 24 |
.. rest_parameters:: parameters.yaml |
| 25 |
|
| 26 |
- attribute_request_depid: attribute_request_depid |
| 27 |
|
| 28 |
Response |
| 29 |
======== |
| 30 |
.. rest_parameters:: parameters.yaml |
| 31 |
|
| 32 |
- attributes: attributes |
| 33 |
- uuid: attribute_uuid_resp |
| 34 |
- id: attribute_id_resp |
| 35 |
- deployable_id: attribute_deployable_id_resp |
| 36 |
- key: attribute_key_resp |
| 37 |
- value: attribute_value_resp |
| 38 |
- created_at: created |
| 39 |
- updated_at: updated |
| 40 |
- links: links |
| 41 |
|
| 42 |
**Example response: list all attributes** |
| 43 |
|
| 44 |
.. literalinclude:: ../../doc/api_samples/attributes/attributes-list-resp.json |
| 45 |
:language: javascript |
| 46 |
|
| 47 |
|
| 48 |
Get One Attribute |
| 49 |
----------------- |
| 50 |
|
| 51 |
.. rest_method:: GET /v2/attributes/{attribute_uuid} |
| 52 |
|
| 53 |
Gets the UUID, id, deployable_id, key, value and more information for one attribute with the specified UUID. |
| 54 |
|
| 55 |
Normal response codes: 200 |
| 56 |
|
| 57 |
Error response codes: badRequest(400), unauthorized(401), forbidden(403), notfound(404) |
| 58 |
|
| 59 |
Request |
| 60 |
======= |
| 61 |
.. rest_parameters:: parameters.yaml |
| 62 |
|
| 63 |
- attribute_uuid: attribute_request_uuid |
| 64 |
|
| 65 |
Response |
| 66 |
======== |
| 67 |
.. rest_parameters:: parameters.yaml |
| 68 |
|
| 69 |
- uuid: attribute_uuid_resp |
| 70 |
- id: attribute_id_resp |
| 71 |
- deployable_id: attribute_deployable_id_resp |
| 72 |
- key: attribute_key_resp |
| 73 |
- value: attribute_value_resp |
| 74 |
- created_at: created |
| 75 |
- updated_at: updated |
| 76 |
- links: links |
| 77 |
|
| 78 |
**Example response: show details of a specific attribute** |
| 79 |
|
| 80 |
.. literalinclude:: ../../doc/api_samples/attributes/attributes-getone-resp.json |
| 81 |
:language: javascript |
| 82 |
|
| 83 |
Create Attributes |
| 84 |
----------------- |
| 85 |
|
| 86 |
.. rest_method:: POST /v2/attributes |
| 87 |
|
| 88 |
Creates an attribute. The payload should have the following field: |
| 89 |
|
| 90 |
Request |
| 91 |
======= |
| 92 |
.. rest_parameters:: parameters.yaml |
| 93 |
|
| 94 |
- deployable_id: attribute_deployable_id_req |
| 95 |
- key: attribute_key_req |
| 96 |
- value: attribute_value_req |
| 97 |
|
| 98 |
**Example post curl** |
| 99 |
|
| 100 |
.. literalinclude:: ../../doc/api_samples/attributes/attributes-post-curl.json |
| 101 |
|
| 102 |
**Example response: create an attribute** |
| 103 |
|
| 104 |
.. literalinclude:: ../../doc/api_samples/attributes/attributes-create-resp.json |
| 105 |
|
| 106 |
Delete One Attribute by uuid |
| 107 |
---------------------------- |
| 108 |
|
| 109 |
.. rest_method:: DELETE /v2/attributes/{attribute_uuid} |
| 110 |
|
| 111 |
Delete an attribute. No query parameters required. |