Add api ref for create of attributes

Change-Id: I6fe61a13a3fb0b99f5400b9cf50c10b9cf10a66e
This commit is contained in:
songwenping 2023-03-20 16:51:34 +08:00 committed by zhangbailin
parent a08942c901
commit aa16c5a6d2
2 changed files with 42 additions and 1 deletions

View File

@ -4,7 +4,7 @@
Attributes
++++++++++
Lists, shows details for attributes.
Lists, shows details, creates for attributes.
A `attribute` represents the trait of a physical card like FPGA or GPU.
@ -79,3 +79,26 @@ Response
.. literalinclude:: ../../doc/api_samples/attributes/attributes-getone-resp.json
:language: javascript
Create Attributes
-----------------
.. rest_method:: POST /v2/attributes
Creates an attribute. The payload should have the following field:
Request
=======
.. rest_parameters:: parameters.yaml
- deployable_id: attribute_deployable_id_req
- key: attribute_key_req
- value: attribute_value_req
**Example post curl**
.. literalinclude:: ../../doc/api_samples/attributes/attributes-post-curl.json
**Example response: create an attribute**
.. literalinclude:: ../../doc/api_samples/attributes/attributes-create-resp.json

View File

@ -79,6 +79,12 @@ hostname:
type: string
# variables in body
attribute_deployable_id_req:
description: |
ID of deployable associated with the attribute.
in: body
required: true
type: integer
attribute_deployable_id_resp:
description: |
ID of deployable associated with the attribute.
@ -91,6 +97,12 @@ attribute_id_resp:
in: body
required: true
type: integer
attribute_key_req:
description: |
The key of the attribute.
in: body
required: true
type: string
attribute_key_resp:
description: |
The key of the attribute.
@ -103,6 +115,12 @@ attribute_uuid_resp:
in: body
required: true
type: string
attribute_value_req:
description: |
The value of the attribute.
in: body
required: true
type: string
attribute_value_resp:
description: |
The value of the attribute.