Agent API
This REST API enables connecting embedded RTOS, windows CE or any other edge-device to Upswift platform.
Register Device
POST
https://api.upswift.io/v1/agent/register_device
This is the first call you would have to implement on your edge-device. This call will register your device to Upswift platform.
Request Body
Name | Type | Description |
---|---|---|
user_token | string | This is your account token. You can find it under the Settings category on the dashboard. |
device_identifier | array | This is the identifier of your device. This parameter is a |
project_name | string | This is the name of the project you would like to register this device to. |
device_os | string | This is a string that represents your device operating system. The default value is |
upswift_version | string | This is a string that represents the Upswift Agent. Since it is your own customization, the value of this MUST begin with: |
device_name | string | This is the name of your device that will be displayed on the dashboard. |
device_group | string | This is the group that you would like to register your device to. This group MUST exist at the dashboard under your project. The default value is |
software_version | string | This is the software version that is running on your device. This value will be displayed on the dashboard. |
If you receive status code 350
, it means the device has been deleted from the dashboard. You must STOP sending Device Registration
and Device Status
calls.
Example
Project Parameters
GET
https://api.upswift.io/v1/agent/project_parameters
This is the second call you would have to implement on your edge-device. This call will provide you the timeout value which represents the timeout between Device Status
calls.
Request Body
Name | Type | Description |
---|---|---|
device_token | string | This is your device token. You have received this value in the response payload of the |
Example
Device Status
POST
https://api.upswift.io/v1/agent/device_status
This is the third call you would have to implement on your edge-device. This call should be sent every X seconds (depends on the status_timeout
value you have received at the Project Parameters
API call). This call represents a keep-alive message to Upswift servers, this way the server knows your device is online.
Request Body
Name | Type | Description |
---|---|---|
device_token | string | This is your device token. You have received this value in the response payload of the |
ram | integer | This is your current device RAM usage (percentage). For example: a value of 30, will represent 30% RAM usage. |
cpu | integer | This is your current device CPU usage (percentage). For example: a value of 88, will represent 88% CPU usage. |
disk_usage_total | integer | This is your total space of disk (MB). For example: a value of 400, will represent a total disk of 400MB. |
disk_usage_current | integer | This is your current usage of disk (MB). For example: a value of 182, will represent a current disk usage of 182MB. |
process_monitor | array | This is a dictionary object representing the processes you monitor. The dict syntax should be as follows: |
If you receive status code 301
, it means that the Project Parameters
have been changed. You have to call the Project Parameters
call as soon as possible.
Example
Last updated