add api ref for enable/disable device

Change-Id: Ifb607e170321ca28a0447d117c05a755fee4c12c
This commit is contained in:
anguoming 2023-09-23 14:29:18 +08:00
parent ab8b851424
commit 36f5c84148
2 changed files with 51 additions and 1 deletions

View File

@ -4,7 +4,7 @@
Devices
+++++++
Lists, shows details for devices.
Lists, shows details for devices. Enable or disable for a device.
A `device` represent a physical card like FPGA card or GPU card.
@ -40,6 +40,7 @@ Response
- std_board_info: device_std_board_info_resp
- vendor_board_info: device_vendor_board_info_resp
- hostname: hostname_resp
- status: device_status_resp
- created_at: created
- updated_at: updated
- links: links
@ -77,6 +78,7 @@ Response
- std_board_info: device_std_board_info_resp
- vendor_board_info: device_vendor_board_info_resp
- hostname: hostname_resp
- status: device_status_resp
- created_at: created
- updated_at: updated
- links: links
@ -85,3 +87,45 @@ Response
.. literalinclude:: ../../doc/api_samples/devices/devices-getone-resp.json
:language: javascript
Enable a device
---------------
.. rest_method:: POST /v2/devices/{device_uuid}/enable
Set the device to enabled status.
Normal response codes: 200
Error response codes: 404(the device is not found),403(the role is not admin)
Request
=======
.. rest_parameters:: parameters.yaml
- device_uuid: device_uuid
Response
========
There is no body content for the response of a successful request.
Disable a device
----------------
.. rest_method:: POST /v2/devices/{device_uuid}/disable
Set the device to maintaining status.
Normal response codes: 200
Error response codes: 404(the device is not found),403(the role is not admin)
Request
=======
.. rest_parameters:: parameters.yaml
- device_uuid: device_uuid
Response
========
There is no body content for the response of a successful request.

View File

@ -305,6 +305,12 @@ device_rp_uuid_bind_unbind_req:
in: body
required: true
type: string
device_status_resp:
description: |
The status of device. One of maintaining or enabled.
in: body
required: true
type: string
device_std_board_info_resp:
description: |
The standard board information of the device.