Device

Get OS Info

Gets the OS information of the device.

Command: GET
http://localhost/api/v1/host/os
Curl example
curl --unix-socket /var/run/edge-core/edge-core.sock \
     http://localhost/api/v1/host/os
Table 1. Success 200
Field Type Description
os_name String OS name
os_version String OS version
os_arch String OS architecture
Success response example
{
    "os_name": "Edge OS",
    "os_version": "2.0.0-beta.8",
    "os_arch": "x86_64"
}

Get Update State

Gets the state of an update.

State is kept for the most recent update attempt, so querying with an older update_identifier will return “NO UPGRADE OCCURRED”. Note: update_identifier is required because there is a brief lag between the start of an update and the actual upgrade process running. So if a client starts an update and then immediately tries to get the ‘state’ before the upgrade process has started, without the id they would get the state of the previous update, an incorrect result.

Command: GET
http://localhost/api/v1/host/state?update_identifier=<identifier>
Table 2. Parameter
Field Type Description
update_identifier String Identifier of the update
Curl example
curl --unix-socket /var/run/edge-core/edge-core.sock \
    http://localhost/api/v1/host/state?update_identifier=<identifier>
Table 3. Success 200
Field Type Description
last_os_upgrade String State of the update associated with the identifier: "PASS", "FAIL", INPROGRESS" or "NO UPGRADE OCCURRED"
Success response example
{
    "last_os_upgrade": "PASS"
}

Reboot

Reboots the device.

Command: POST
http://localhost/api/v1/host/reboot
Curl example
curl --unix-socket /var/run/edge-core/edge-core.sock \
     -X POST http://localhost/api/v1/host/reboot

Upon successful completion of the operation, the box will reboot.

Update

Updates the Edge OS and Edge Agent.

Command: POST
http://localhost/api/v1/host/update
Table 4. Parameters
Field Type Description
update_identifier String An identifier associated with the update. Can be any string, as long as it is unique.
file_name String Name of the Edge OS/Edge Agent update image file.
Curl example
curl --unix-socket /var/run/edge-core/edge-core.sock \
     -X POST -H "update_identifier: <identifier>" -F "file=@<file_name>" \
     http://localhost/api/v1/host/update

If the update is successfully applied, the device will reboot to complete the update.

Table 5. Error 4xx
Field Type Description
error_message String A description of the error encountered
status_code Number The status code for the HTTP request
Error response example
{
    "error_message": "<errorMessage>",
    "status_code": 500
}