Add api ref for list attributes

Change-Id: I0f82256d7d10a619fcac751c0641050011586cd5
This commit is contained in:
songwenping 2023-03-19 16:22:25 +08:00
parent 3e8114d353
commit 371213bfcf
2 changed files with 129 additions and 0 deletions

View File

@ -0,0 +1,81 @@
.. -*- rst -*-
.. needs:body_verification
Attributes
++++++++++
Lists, shows details for attributes.
A `attribute` represents the trait of a physical card like FPGA or GPU.
List Attributes
---------------
.. rest_method:: GET /v2/attributes
Lists UUID, deployable_id, key, value and more information for all devices.
Normal response codes: 200
Error response codes: unauthorized(401), forbidden(403)
Request
=======
.. rest_parameters:: parameters.yaml
- attribute_request_depid: attribute_request_depid
Response
========
.. rest_parameters:: parameters.yaml
- attributes: attributes
- uuid: attribute_uuid_resp
- id: attribute_id_resp
- deployable_id: attribute_deployable_id_resp
- key: attribute_key_resp
- value: attribute_value_resp
- created_at: created
- updated_at: updated
- links: links
**Example response: list all attributes**
.. literalinclude:: ../../doc/api_samples/attributes/attributes-list-resp.json
:language: javascript
Get One Attribute
--------------
.. rest_method:: GET /v2/attributes/{attribute_uuid}
Gets the UUID, id, deployable_id, key, value and more information for one attribute with the specified UUID.
Normal response codes: 200
Error response codes: badRequest(400), unauthorized(401), forbidden(403), notfound(404)
Request
=======
.. rest_parameters:: parameters.yaml
- attribute_uuid: attribute_request_uuid
Response
========
.. rest_parameters:: parameters.yaml
- uuid: attribute_uuid_resp
- id: attribute_id_resp
- deployable_id: attribute_deployable_id_resp
- key: attribute_key_resp
- value: attribute_value_resp
- created_at: created
- updated_at: updated
- links: links
**Example response: show details of a specific attribute**
.. literalinclude:: ../../doc/api_samples/attributes/attributes-getone-resp.json
:language: javascript

View File

@ -5,6 +5,12 @@ accelerator_request_uuid:
in: path
required: true
type: string
attribute_request_uuid:
description: |
The UUID of the attribute.
in: path
required: true
type: string
deployable_uuid:
description: |
The UUID of the deployable.
@ -35,6 +41,12 @@ device_uuid:
required: true
type: string
# variables in query
attribute_request_depid:
description: |
ID of deployable associated with the attribute.
in: query
required: true
type: integer
device_filters:
description: |
A list of filter of ``FilterType`` to get device list by filter.
@ -67,6 +79,42 @@ hostname:
type: string
# variables in body
attribute_deployable_id_resp:
description: |
ID of deployable associated with the attribute.
in: body
required: true
type: integer
attribute_id_resp:
description: |
ID of the attribute.
in: body
required: true
type: integer
attribute_key_resp:
description: |
The key of the attribute.
in: body
required: true
type: string
attribute_uuid_resp:
description: |
The UUID of the attribute.
in: body
required: true
type: string
attribute_value_resp:
description: |
The value of the attribute.
in: body
required: true
type: string
attributes:
description: |
A list of ``attributes`` objects.
in: body
required: true
type: array
created:
description: |
The date and time when the resource was created. The date and time