System and logs¶
The following resources and requests expose the rc_reason_stack’s system-level API. They enable
- access to log files (system-wide or module-specific)
- access to information about the device and run-time statistics such as date, MAC address, clock-time synchronization status, and available resources;
- management of installed software licenses; and
- the rc_reason_stack to be updated with a new firmware image.
-
GET/logs¶ Get list of available log files.
Template request
GET /api/v2/logs HTTP/1.1
Sample response
HTTP/1.1 200 OK Content-Type: application/json [ { "date": 1503060035.0625782, "name": "rcsense-api.log", "size": 730 }, { "date": 1503060035.741574, "name": "stereo.log", "size": 39024 }, { "date": 1503060044.0475223, "name": "camera.log", "size": 1091 } ]
Response Headers: - Content-Type – application/json application/ubjson
Status Codes: - 200 OK – successful operation (returns array of LogInfo)
Referenced Data Models:
-
GET/logs/{log}¶ Get a log file. Content type of response depends on parameter ‘format’.
Template request
GET /api/v2/logs/<log>?format=<format>&limit=<limit> HTTP/1.1
Sample response
HTTP/1.1 200 OK Content-Type: application/json { "date": 1581609251.8168414, "log": [ { "component": "rc_gev_server", "level": "INFO", "message": "Application from IP 10.0.1.7 registered with control access.", "timestamp": 1581609249.61 }, { "component": "rc_gev_server", "level": "INFO", "message": "Application from IP 10.0.1.7 deregistered.", "timestamp": 1581609249.739 }, { "component": "rc_gev_server", "level": "INFO", "message": "Application from IP 10.0.1.7 registered with control access.", "timestamp": 1581609250.94 }, { "component": "rc_gev_server", "level": "INFO", "message": "Application from IP 10.0.1.7 deregistered.", "timestamp": 1581609251.819 } ], "name": "gev.log", "size": 42112 }
Parameters: - log (string) – name of the log file (required)
Query Parameters: - format (string) – return log as JSON or raw (one of
json,raw; default:json) (optional) - limit (integer) – limit to last x lines in JSON format (default:
100) (optional)
Response Headers: - Content-Type – text/plain application/json
Status Codes: - 200 OK – successful operation (returns Log)
- 404 Not Found – log not found
Referenced Data Models:
-
GET/system¶ Get system information on device.
Template request
GET /api/v2/system HTTP/1.1
Sample response
HTTP/1.1 200 OK Content-Type: application/json { "dongle_id": "dinkey:1234", "hostname": "rc-cube-00012e96ef39", "link_speed": 1000, "mac": "00:01:2e:96:ef:39", "model_name": "rc_cube S", "pipelines": { "config": { "0": { "type": "rc_visard" }, "1": { "type": "rc_visard" } }, "max_pipelines": 2, "pending_changes": false }, "ready": true, "reboot_required": false, "sensor_interfaces": { "sensor0": { "link_speed": 2500 } }, "serial": "00012e96ef39", "time": 1649678734.0306993, "uptime": 336455.25, "userspace": { "available": true, "enabled": true } }
Response Headers: - Content-Type – application/json application/ubjson
Status Codes: - 200 OK – successful operation (returns SysInfo)
Referenced Data Models:
-
GET/system/backup¶ Get backup.
Template request
GET /api/v2/system/backup?pipelines=<pipelines>&load_carriers=<load_carriers>®ions_of_interest=<regions_of_interest>&grippers=<grippers> HTTP/1.1
Query Parameters: - pipelines (boolean) – backup pipelines with node settings, i.e. parameters and preferred_orientation (default:
True) (optional) - load_carriers (boolean) – backup load_carriers (default:
True) (optional) - regions_of_interest (boolean) – backup regions_of_interest (default:
True) (optional) - grippers (boolean) – backup grippers (default:
True) (optional)
Response Headers: - Content-Type – application/json application/ubjson
Status Codes: - 200 OK – successful operation
- pipelines (boolean) – backup pipelines with node settings, i.e. parameters and preferred_orientation (default:
-
POST/system/backup¶ Restore backup.
Template request
POST /api/v2/system/backup HTTP/1.1 Accept: application/json application/ubjson {}
Sample response
HTTP/1.1 200 OK Content-Type: application/json { "return_code": { "message": "backup restored", "value": 0 }, "warnings": [] }
Request JSON Object: - backup (object) – backup data as json object (required)
Request Headers: - Accept – application/json application/ubjson
Response Headers: - Content-Type – application/json application/ubjson
Status Codes: - 200 OK – successful operation
-
GET/system/ca_certificates¶ Get ca-certificates.
Template request
GET /api/v2/system/ca_certificates HTTP/1.1
Response Headers: - Content-Type – application/json
Status Codes: - 200 OK – successful operation
-
GET/system/ca_certificates/{id}¶ Get ca-certificate file or details.
Template request
GET /api/v2/system/ca_certificates/<id> HTTP/1.1
Parameters: - id (string) – ID/filename without extension (required)
Response Headers: - Content-Type – application/json application/octet-stream
Status Codes: - 200 OK – successful operation
- 404 Not Found – crt file not found
-
PUT/system/ca_certificates/{id}¶ Create or update a crt file.
Template request
PUT /api/v2/system/ca_certificates/<id> HTTP/1.1 Accept: multipart/form-data application/json
Parameters: - id (string) – ID/filename without extension (required)
Form Parameters: - file – crt file (required)
Request Headers: - Accept – multipart/form-data application/json
Response Headers: - Content-Type – application/json
Status Codes: - 200 OK – successful operation
- 400 Bad Request – crt is not valid or max number of elements reached
- 413 Request Entity Too Large – File too large
-
DELETE/system/ca_certificates/{id}¶ Remove a crt file.
Template request
DELETE /api/v2/system/ca_certificates/<id> HTTP/1.1 Accept: application/json
Parameters: - id (string) – ID/filename without extension (required)
Request Headers: - Accept – application/json
Response Headers: - Content-Type – application/json
Status Codes: - 200 OK – successful operation
- 404 Not Found – element not found
-
GET/system/disk_info¶ Get disk space info
Template request
GET /api/v2/system/disk_info HTTP/1.1
Response Headers: - Content-Type – application/json application/ubjson
Status Codes: - 200 OK – successful operation
-
GET/system/license¶ Get information about licenses installed on device.
Template request
GET /api/v2/system/license HTTP/1.1
Sample response
HTTP/1.1 200 OK Content-Type: application/json { "components": { "hand_eye_calibration": true, "rectification": true, "stereo": true }, "valid": true }
Response Headers: - Content-Type – application/json application/ubjson
Status Codes: - 200 OK – successful operation (returns LicenseInfo)
Referenced Data Models:
-
POST/system/license¶ Update license on device with a license file.
Template request
POST /api/v2/system/license HTTP/1.1 Accept: multipart/form-data
Form Parameters: - file – license file (required)
Request Headers: - Accept – multipart/form-data
Status Codes: - 200 OK – successful operation
- 400 Bad Request – not a valid license
-
GET/system/max_power_test¶ Get last max power test result.
Template request
GET /api/v2/system/max_power_test HTTP/1.1
Response Headers: - Content-Type – application/json
Status Codes: - 200 OK – successful operation
-
POST/system/max_power_test¶ Run max power test. Fully load GPU (and CPU) to consume max power for 10 seconds to test the power supply. WARNING: The system might not return a response due to immediate reboot if the power supply is insufficient.
Template request
POST /api/v2/system/max_power_test?nocpu=<nocpu> HTTP/1.1
Query Parameters: - nocpu (boolean) – Don’t run CPU workers and only load the GPU. (optional)
Response Headers: - Content-Type – application/json
Status Codes: - 200 OK – Test finished. See return_code for result.
- 400 Bad Request – Test already running.
-
GET/system/ui_lock¶ Get UI lock status.
Template request
GET /api/v2/system/ui_lock HTTP/1.1
Sample response
HTTP/1.1 200 OK Content-Type: application/json { "enabled": false }
Response Headers: - Content-Type – application/json application/ubjson
Status Codes: - 200 OK – successful operation (returns UILock)
Referenced Data Models:
-
DELETE/system/ui_lock¶ Remove UI lock.
Template request
DELETE /api/v2/system/ui_lock HTTP/1.1
Sample response
HTTP/1.1 200 OK Content-Type: application/json { "enabled": false, "valid": false }
Response Headers: - Content-Type – application/json application/ubjson
Status Codes: - 200 OK – successful operation
-
POST/system/ui_lock¶ Verify or set UI lock.
Template request
POST /api/v2/system/ui_lock?hash=<hash>&set=<set> HTTP/1.1
Sample response
HTTP/1.1 200 OK Content-Type: application/json { "enabled": true, "valid": true }
Query Parameters: - hash (string) – hash of the UI lock password (required)
- set (boolean) – set new hash instead of veryfing (optional)
Response Headers: - Content-Type – application/json application/ubjson
Status Codes: - 200 OK – successful operation