File: attributes.inc

package info (click to toggle)
cyborg 16.0.0~rc2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,704 kB
  • sloc: python: 20,659; sh: 158; pascal: 66; makefile: 66
file content (111 lines) | stat: -rw-r--r-- 2,567 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
.. -*- rst -*-
.. needs:body_verification

Attributes
++++++++++

Lists, shows details, creates and deletes 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

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

Delete One Attribute by uuid
----------------------------

.. rest_method:: DELETE /v2/attributes/{attribute_uuid}

Delete an attribute. No query parameters required.