Debian Codegraph @

api-ref/source/devices.inc

raw
1 .. -*- rst -*-
2 .. needs:body_verification
3
4 Devices
5 +++++++
6
7 Lists, shows details for devices. Enable or disable for a device.
8
9 A `device` represent a physical card like FPGA card or GPU card.
10
11 List Devices
12 ------------
13
14 .. rest_method:: GET /v2/devices
15
16 Lists UUIDs, names, type and more information for all devices.
17
18 Normal response codes: 200
19
20 Error response codes: unauthorized(401), forbidden(403)
21
22 Request
23 =======
24 .. rest_parameters:: parameters.yaml
25
26 - type: device_type
27 - vendor: device_vendor
28 - hostname: hostname
29 - filters: device_filters
30
31 Response
32 ========
33 .. rest_parameters:: parameters.yaml
34
35 - devices: devices
36 - uuid: device_uuid_resp
37 - type: device_type_resp
38 - vendor: device_vendor_resp
39 - model: device_model_resp
40 - std_board_info: device_std_board_info_resp
41 - vendor_board_info: device_vendor_board_info_resp
42 - hostname: hostname_resp
43 - status: device_status_resp
44 - created_at: created
45 - updated_at: updated
46 - links: links
47
48 **Example response: list all devices**
49
50 .. literalinclude:: ../../doc/api_samples/devices/devices-list-resp.json
51 :language: javascript
52
53 Get One Device
54 --------------
55
56 .. rest_method:: GET /v2/devices/{device_uuid}
57
58 Gets the UUID, name, type and more information for one device with the specified UUID.
59
60 Normal response codes: 200
61
62 Error response codes: badRequest(400), unauthorized(401), forbidden(403), notfound(404)
63
64 Request
65 =======
66 .. rest_parameters:: parameters.yaml
67
68 - device_uuid: device_uuid
69
70 Response
71 ========
72 .. rest_parameters:: parameters.yaml
73
74 - uuid: device_uuid_resp
75 - type: device_type_resp
76 - vendor: device_vendor_resp
77 - model: device_model_resp
78 - std_board_info: device_std_board_info_resp
79 - vendor_board_info: device_vendor_board_info_resp
80 - hostname: hostname_resp
81 - status: device_status_resp
82 - created_at: created
83 - updated_at: updated
84 - links: links
85
86 **Example response: show details of a specific device**
87
88 .. literalinclude:: ../../doc/api_samples/devices/devices-getone-resp.json
89 :language: javascript
90
91 Enable a device
92 ---------------
93
94 .. rest_method:: POST /v2/devices/{device_uuid}/enable
95
96 Set the device to enabled status.
97
98 Normal response codes: 200
99
100 Error response codes: 404(the device is not found),403(the role is not admin)
101
102 Request
103 =======
104 .. rest_parameters:: parameters.yaml
105
106 - device_uuid: device_uuid
107
108 Response
109 ========
110 There is no body content for the response of a successful request.
111
112 Disable a device
113 ----------------
114
115 .. rest_method:: POST /v2/devices/{device_uuid}/disable
116
117 Set the device to maintaining status.
118
119 Normal response codes: 200
120
121 Error response codes: 404(the device is not found),403(the role is not admin)
122
123 Request
124 =======
125 .. rest_parameters:: parameters.yaml
126
127 - device_uuid: device_uuid
128
129 Response
130 ========
131 There is no body content for the response of a successful request.