diff --git a/api-ref/source/attributes.inc b/api-ref/source/attributes.inc index cc6b3bc1..98422f01 100644 --- a/api-ref/source/attributes.inc +++ b/api-ref/source/attributes.inc @@ -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 diff --git a/api-ref/source/parameters.yaml b/api-ref/source/parameters.yaml index 9d0fb643..2ad56713 100644 --- a/api-ref/source/parameters.yaml +++ b/api-ref/source/parameters.yaml @@ -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.