Merge "Add api ref for create of attributes"

This commit is contained in:
Zuul 2023-03-21 07:24:10 +00:00 committed by Gerrit Code Review
commit 77a62f2e90
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.