This repository was archived by the owner on Sep 20, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2
API Reference [experimental]
MaxiHuHe04 edited this page Sep 1, 2019
·
17 revisions
Required parameters:
-
device_uuid: The device
Responses:
- Success:
{
"uuid": "<UUID of the device>",
"name": "<Name of the device>",
"owner": "<Owner of the device>",
"powered_on": "<Device powered on [boolean]>"
}- Device not found:
{"error": "device_not_found", "origin": "user"}- Missing or invalid parameters:
{"error": "invalid_input_data"}Required parameters:
-
device_uuid: The device to ping
Responses:
- Device is online:
{"online": true}- Device not found:
{"error": "device_not_found", "origin": "user"}- Missing or invalid parameters:
{"error": "invalid_input_data"}No parameters
Responses:
- Success:
{
"devices": [{
"uuid": "<UUID of the device>",
"name": "<Name of the device>",
"owner": "<Owner of the device>",
"powered_on": "<Device powered on [boolean]>"
}]
}Required parameters:
-
gpu: The name of the graphics processing unit -
cpu: The name of the central processing unit -
motherboard: The name of the motherboard -
ram: The name of the memory -
disk: The name of the disk
Responses:
- Success:
{
"uuid": "<UUID of the device>",
"name": "<Name of the device>",
"owner": "<Owner of the device>",
"powered_on": "<Device powered on [boolean]>"
}- A part does not exist (gpu, cpu, motherboard, ram or disk):
{"error": "element_<part>_not_found"}- A part is missing from the inventory (gpu, cpu, motherboard, ram or disk):
{"error": "<part>_not_in_inventory"}- The motherboard socket is not compatible with the cpu:
{"error": "incompatible_cpu_socket"}- The motherboard has not enough ram slots:
{"error": "not_enough_ram_slots"}- A ram type is incompatible with the motherboard:
{"error": "incompatible_ram_types"}- The drive interface is not compatible with the motherboard:
{"error": "incompatible_drive_interface"}- No memory was chosen:
{"error": "missing_ram"}- No hard drive was chosen:
{"error": "missing_hard_drive"}- Missing or invalid parameters:
{"error": "invalid_input_data"}No parameters
Responses:
- Success:
{
"uuid": "<UUID of the device>",
"name": "<Name of the device>",
"owner": "<Owner of the device>",
"powered_on": "<Device powered on [boolean]>"
}- You already have a device:
{"error": "already_own_a_device"}Required parameters:
-
device_uuid: UUID of the device
Responses:
- Success:
{
"uuid": "<UUID of the device>",
"name": "<Name of the device>",
"owner": "<Owner of the device>",
"powered_on": "<Device powered on [boolean]>"
}- No permission to turn on/off the device
{"error": "permission_denied", "origin": "user"}- Missing or invalid parameters:
{"error": "invalid_input_data"}Required parameters:
-
device_uuid: UUID of the device you want to rename -
name: The name you want to change to
Responses:
- Success:
{
"uuid": "<UUID of the device>",
"name": "<Name of the device>",
"owner": "<Owner of the device>",
"powered_on": "<Device powered on [boolean]>"
}- Device not found:
{"error": "device_not_found", "origin": "user"}- No permission to rename the device
{"error": "permission_denied", "origin": "user"}- Missing or invalid parameters (Note:
namemust not have more than 15 letters):
{"error": "invalid_input_data"}Required parameters:
-
device_uuid: UUID of the device you want to delete
Responses:
- Success:
{"ok": true}- Device not found:
{"error": "device_not_found", "origin": "user"}- No permission to delete the device:
{"error": "permission_denied", "origin": "user"}- Missing or invalid parameters:
{"error": "invalid_input_data"}No parameters
Responses:
- Success:
{
"uuid": "<UUID of the device>",
"name": "<Name of the device>",
"owner": "<Owner of the device>",
"powered_on": "<Device powered on [boolean]>"
}Required parameters:
-
device_uuid: UUID of the device you want to know whether it exists or not
Responses:
- The device exists:
{"exist": true}- The device does not exist:
{"exist": false}Required parameters:
-
device_uuid: UUID of the device you want to know the owner from
Responses:
- Success:
{"owner": "<Owner UUID of the device>"}- Missing or invalid
device_uuid:
{"error": "device_not_found", "origin": "user"}Required parameters:
-
device_uuid: The device you want to get all files from
Responses:
- Success:
{
"files": [{
"uuid": "<UUID of the file>",
"device": "<UUID of the device the file is on>",
"filename": "<Name of the file>",
"content": "<Content of the file>"
}]
}- Device not found:
{"error": "device_not_found", "origin": "user"}- No permission to see the files on the device:
{"error": "permission_denied", "origin": "user"}- Missing or invalid parameters:
{"error": "invalid_input_data"}Required parameters:
-
device_uuid: The device the file you want to get information about is on -
file_uuid: The UUID of the file you want to get information about
Responses:
- Success:
{
"uuid": "<UUID of the file>",
"device": "<UUID of the device the file is on>",
"filename": "<Name of the file>",
"content": "<Content of the file>"
}- Device not found:
{"error": "device_not_found", "origin": "user"}- File not found:
{"error": "file_not_found", "origin": "user"}- No permission to see the files on the device:
{"error": "permission_denied", "origin": "user"}- Missing or invalid parameters:
{"error": "invalid_input_data"}Required parameters:
-
device_uuid: The device the file you want to move is on -
file_uuid: The UUID of the file you want to move -
filename: The new filename
Responses:
- Success:
{
"uuid": "<UUID of the file>",
"device": "<UUID of the device the file is on>",
"filename": "<Name of the file>",
"content": "<Content of the file>"
}- Device not found:
{"error": "device_not_found", "origin": "user"}- File not found:
{"error": "file_not_found", "origin": "user"}- A file with the specified filename already exists:
{"error": "file_already_exists", "origin": "user"}- No permission to move files on the device:
{"error": "permission_denied", "origin": "user"}- Missing or invalid parameters:
{"error": "invalid_input_data"}Required parameters:
-
device_uuid: The device the file you want to change is on -
file_uuid: The UUID of the file you want to change -
content: The new content of the file
Responses:
- Success:
{
"uuid": "<UUID of the file>",
"device": "<UUID of the device the file is on>",
"filename": "<Name of the file>",
"content": "<Content of the file>"
}- Device not found:
{"error": "device_not_found", "origin": "user"}- File not found:
{"error": "file_not_found", "origin": "user"}- No permission to change files on the device:
{"error": "permission_denied", "origin": "user"}- Missing or invalid parameters:
{"error": "invalid_input_data"}Required parameters:
-
device_uuid: The device the file you want to delete is on -
file_uuid: The UUID of the file you want to delete
Responses:
- Success:
{"ok": true}- Device not found:
{"error": "device_not_found", "origin": "user"}- File not found:
{"error": "file_not_found", "origin": "user"}- No permission to delete files on the device:
{"error": "permission_denied", "origin": "user"}- Missing or invalid parameters:
{"error": "invalid_input_data"}Required parameters:
-
device_uuid: The UUID of the device to create the file on -
filename: The name of the file you want to create -
content: The content of the new file
Responses:
- Success:
{
"uuid": "<UUID of the file>",
"device": "<UUID of the device the file is on>",
"filename": "<Name of the file>",
"content": "<Content of the file>"
}- Device not found:
{"error": "device_not_found", "origin": "user"}- No permission to create files on the device:
{"error": "permission_denied", "origin": "user"}- A file with the specified filename already exists:
{"error": "file_already_exists", "origin": "user"}- Missing or invalid parameters (Note:
filenamemust not be empty and must have more than 64 letters, the length ofcontentis also limited):
{"error": "invalid_input_data"}Required parameters:
-
gpu: The name of the graphics processing unit -
cpu: The name of the central processing unit -
motherboard: The name of the motherboard -
ram: The name of the memory -
disk: The name of the disk
Responses:
- Success:
{
"success": true,
"performance": [
"<CPU performance [number]>",
"<RAM performance [number]>",
"<GPU performance [number]>",
"<Disk performance [number]>",
"<Network speed [number]>"
]
}- A part does not exist (gpu, cpu, motherboard, ram or disk):
{"error": "element_<part>_not_found"}- The motherboard socket is not compatible with the cpu:
{"error": "incompatible_cpu_socket"}- The motherboard has not enough ram slots:
{"error": "not_enough_ram_slots"}- A ram type is incompatible with the motherboard:
{"error": "incompatible_ram_types"}- The drive interface is not compatible with the motherboard:
{"error": "incompatible_drive_interface"}- No memory was chosen:
{"error": "missing_ram"}- No hard drive was chosen:
{"error": "missing_hard_drive"}- Missing or invalid parameters:
{"error": "invalid_input_data"}Required parameters:
-
device_uuid: The device you want to know the resource usage of
Responses:
- Success:
{
"cpu": "<CPU usage [number 0-1]>",
"ram": "<RAM usage [number 0-1]>",
"gpu": "<GPU usage [number 0-1]>",
"disk": "<Disk usage [number 0-1]>",
"network": "<Network usage [number 0-1]>"
}- Device not found:
{"error": "device_not_found"}Required parameters:
device_uuidservice_uuiduser
Responses:
- Success:
{
"service_uuid": "The UUID of the service",
"cpu": "<[number]>",
"ram": "<[number]>",
"gpu": "<[number]>",
"disk": "<[number]>",
"network": "<[number]>"
}- Device not found:
{"error": "device_not_found", "origin": "user"}- The service is already running:
{"error": "service_already_running", "origin": "service"}- Missing or invalid parameters:
{"error": "invalid_input_data"}Required parameters:
device_uuidservice_uuiduser
Responses:
- Success:
{"success": true}- Device not found:
{"error": "device_not_found", "origin": "user"}- The service is not running:
{"error": "service_not_running", "origin": "service"}Required parameters:
device_uuidservice_uuiduser
Responses:
- Success:
{
"service_uuid": "The UUID of the service",
"cpu": "<[number]>",
"ram": "<[number]>",
"gpu": "<[number]>",
"disk": "<[number]>",
"network": "<[number]>"
}- Device not found:
{"error": "device_not_found", "origin": "user"}- The service was not found:
{"error": "service_not_found", "origin": "service"}