Skip to content

Workstation (Ws) information

Add ws

Description:

Used to add a new ws interface

Request

Request method:

POST

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/add/ws

Request body:

Note: After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

The request body should be sent as form-data and it should contain the device information as illustrated in the section below:

Field name Description Type
ws_name Name of the ws str
ws_type The type of ws str
ws_token [Optional] Token that will be used to update the ws. If not specified, a random token will be generated str
update_period How often the ws will be updated. This time is used to calculate the ws status. If no updates are received withing this period, the device status will be regarded as offline. An email will be sent to the user if notifications are enabled when the status changes. str

JSON format

{
    "ws_name":"Test ws",
    "ws_type":"Raspberry Pi",
    "ws_token":"f5d6dsewwds",
    "update_period":120
}

Request example:

None

Response

{
    "success": {
        "ws_id": 191683571546635,
        "ws_token": "f5d6dsewwds"
    }
}

Field description

The response information contains a success key which indicates that the ws interface has been added successfully

Ws count

Description:

Used to get number of Workstations available

Request

Request method:

GET

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/ws/count

Request body:

None

Note:

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

None

Response

{
    "success": {
        "workstations": 3
    }
}

Field description

The response information contains a success key which indicates that the ws interface has been added successfully

List workstations

Description:

Used to list all the Workstations for the user

Request

Request method:

GET

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/ws/list

Request body:

Note: After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

None

Request example:

None

Response

{
    "success": [
        {
            "ws_id": 371661499764280,
            "ws_name": "Raspberry pi",
            "ws_type": "Custom",
            "ws_status": "Offline",
            "ws_total_ram": 0.0,
            "ws_used_ram": 0.0,
            "ws_ram_used_per": 0,
            "ws_total_proc": 0.0,
            "ws_used_proc": 0.0,
            "ws_proc_used_per": 0,
            "ws_total_disk": 0.0,
            "ws_used_disk": 0.0,
            "ws_disk_used_per": 0,
            "ws_details": {},
            "update_period": 60,
            "last_modified": 1661506964,
            "ws_token": "c4c9caeaf61294045dfcbf2d3a7ca62256f2ac83",
            "notification_enabled": true,
            "alarms": [
                {
                    "alarm_id": 1684354259759,
                    "device_id": 371661499764280,
                    "alarm_name": "Met temp",
                    "alarm_enabled": true,
                    "alarm_threshold_value": 10.0,
                    "alarm_condition": ">=",
                    "alarm_trigger_time": null,
                    "alarm_repeat_delay": 300,
                    "alarm_akn": null,
                    "update_time": 1684354259,
                    "alarm_triggered": false,
                    "condition_parameter": "ram"
                }
            ],
            "whatsapp_enabled": false,
            "sms_enabled": null,
            "ram_units": "",
            "disk_units": "",
            "proc_units": ""
        }
    ]
}

Field description

The response information contains a success key which indicates that the ws interface has been added successfully

Field name Description Type
ws_name Name of the ws str
ws_type The type of ws str
ws_token Token that will be used to update the ws. If not specified, a random token will be generated str
ws_details ws details which will be stored as a json object json
ws_status Device status json
ws_total_ram Total RAM value json
ws_used_ram Used RAM json
ws_ram_used_per Used RAM percentage % json
ws_total_proc Processor value json
ws_used_proc Used processor value json
ws_proc_used_per Used processor percentage % json
ws_total_disk Total disk size json
ws_used_disk Used disk json
ws_disk_used_per Used disk percentage % json
last_modified Indicates the latest update time in epoch json
notification_enabled Indicates if the notifications have been enabled for the interface json
whatsapp_enabled Indicates if whatsapp notifications have been enabled for the interface json
sms_enabled Indicates if sms notifications have been enabled for the interface json
ram_units RAM units json
disk_units Disk units json
proc_units Processor units json
update_period How often the ws will be updated. This time is used to calculate the ws status. If no updates are received withing this period, the device status will be regarded as offline. An email will be sent to the user if notifications are enabled when the status changes. str

Ws Status

Description:

Used to get ws status

Request

Request method:

GET

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/ws/status

Request body:

The request info should be sent as params or json body and it should contain the device information as illustrated in the section below.

Note:

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

Params example

https://spoilerinterface.com/interface/ws/status?ws_id=65698658484984584&ws_token=fds654gf654gdf56gdf654gdf

Json body example

{
    "ws_id": 65698658484984584,
    "ws_token": "fds654gf654gdf56gdf654gdf"
}

Response

{
    "success": {
        "ws_id": 371661499764280,
        "ws_name": "Raspberry pi",
        "ws_type": "Custom",
        "ws_status": "Offline",
        "ws_total_ram": 0.0,
        "ws_used_ram": 0.0,
        "ws_ram_used_per": 0,
        "ws_total_proc": 0.0,
        "ws_used_proc": 0.0,
        "ws_proc_used_per": 0,
        "ws_total_disk": 0.0,
        "ws_used_disk": 0.0,
        "ws_disk_used_per": 0,
        "ws_details": {},
        "last_modified": 1661506964,
        "update_period": 60,
        "notification_enabled": true,
        "whatsapp_enabled": false,
        "sms_enabled": null,
        "ram_units": "",
        "disk_units": "",
        "proc_units": "",
        "alarms": [
            {
                "alarm_id": 1684354259759,
                "device_id": 371661499764280,
                "alarm_name": "Met temp",
                "alarm_enabled": true,
                "alarm_threshold_value": 10.0,
                "alarm_condition": ">=",
                "alarm_trigger_time": null,
                "alarm_repeat_delay": 300,
                "alarm_akn": null,
                "update_time": 1684354259,
                "alarm_triggered": false,
                "condition_parameter": "ram"
            }
        ]
    }
}

Field description

The response information contains a success key which indicates that the ws interface has been added successfully

Field name Description Type
ws_name Name of the ws str
ws_type The type of ws str
ws_token Token that will be used to update the ws. If not specified, a random token will be generated str
ws_details ws details which will be stored as a json object json
ws_status Device status json
ws_total_ram Total RAM value json
ws_used_ram Used RAM json
ws_ram_used_per Used RAM percentage % json
ws_total_proc Processor value json
ws_used_proc Used processor value json
ws_proc_used_per Used processor percentage % json
ws_total_disk Total disk size json
ws_used_disk Used disk json
ws_disk_used_per Used disk percentage % json
last_modified Indicates the latest update time in epoch json
notification_enabled Indicates if the notifications have been enabled for the interface json
whatsapp_enabled Indicates if whatsapp notifications have been enabled for the interface json
sms_enabled Indicates if sms notifications have been enabled for the interface json
ram_units RAM units json
disk_units Disk units json
proc_units Processor units json
update_period How often the ws will be updated. This time is used to calculate the ws status. If no updates are received withing this period, the device status will be regarded as offline. An email will be sent to the user if notifications are enabled when the status changes. str

Ws update

Description:

Used to update ws status

Request

Request method:

POST

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/update/ws

Request body:

The request info should be sent as params or json body and it should contain the device information as illustrated in the section below.

Note:

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

Params example

https://spoilerinterface.com/interface/update/ws?ws_id=191679387165463&ws_token=201679387120404&ws_total_ram=100&ws_used_ram=45&ws_total_proc=1&ws_used_proc=5&ws_total_disk=44&ws_used_disk=100

Json body example

{
    "ws_id":301659085216623,
    "ws_token": "df45ddddsdaewg56df6",
    "ws_details": "{'key': 25}",
    "ws_total_ram": 0.0,
    "ws_used_ram": 0.0,
    "ws_ram_used_per": 0,
    "ws_total_proc": 0.0,
    "ws_used_proc": 0.0,
    "ws_proc_used_per": 0,
    "ws_total_disk": 0.0,
    "ws_used_disk": 0.0,
    "ws_disk_used_per": 0
}

Response

{
    "success": "success"
}

Field description

The response information contains a success key which indicates that the ws interface has been added successfully

Ws history

Description:

Used to get ws history data

Request

Request method:

GET

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/ws/history

Request body:

The request info should be sent as params or json body and it should contain the device information as illustrated in the section below.

Field name Description Type
min_epoch_tm_sec Minimum time for history record str
max_epoch_tm_sec [Optional] Maximum time for history data. This is set to current epoch time if not specified str
ws_id [Optional] ws ID. All ws history will be returned if not specified str

Note:

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

Params example

https://spoilerinterface.com/interface/ws/history?min_epoch_tm_sec=1641502593

Json body example

{
    "min_epoch_tm_sec": 1641502593,
    "max_epoch_tm_sec": 1999999999,
    "ws_id": 65897465466
}

Response

{
    "success": [
        {
            "ws_id": 371661499764280,
            "ws_name": "Raspberry pi",
            "ws_type": "TODO",
            "min_time": 1684355985,
            "max_time": 1684355985,
            "ram_units": "",
            "disk_units": "",
            "proc_units": "",
            "data": [
                {
                    "ws_total_ram": 100.0,
                    "ws_used_ram": 45.0,
                    "ws_ram_used_per": 45,
                    "ws_total_proc": 1.0,
                    "ws_used_proc": 5.0,
                    "ws_proc_used_per": 500,
                    "ws_total_disk": 44.0,
                    "ws_used_disk": 100.0,
                    "ws_disk_used_per": 227,
                    "ws_details": "{}",
                    "update_time": "1970-01-01T02:01:00"
                }
            ]
        }
    ]
}

Field description

The response information contains a success key which indicates that the ws interface has been added successfully

Field name Description Type
ws_id ws ID str
ws_name Name of the ws str
ws_type The type of ws str
ram_units RAM units json
disk_units Disk units json
proc_units Processor units json
min_time Minimum history time available str
max_time Maximum history time int
data Array containing ws history data. json

Ws edit

Description:

Used to edit ws information

Request

Request method:

POST

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/edit/ws

Request body:

The request info should be sent as params or json body and it should contain the device information as illustrated in the section below.

Field name Description Type
ws_name Name of the ws str
ws_type The type of ws str
ws_token [Optional] Token that will be used to update the ws. If not specified, a random token will be generated str
ram_units RAM units json
disk_units Disk units json
proc_units Processor units json
update_period How often the ws will be updated. This time is used to calculate the ws status. If no updates are received withing this period, the device status will be regarded as offline. An email will be sent to the user if notifications are enabled when the status changes. str

Note:

Only the ws owner can edit the interface information.

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

Params example

https://spoilerinterface.com/interface/edit/ws?ws_id=545467565849421245489&ws_token=5fgd94dgfd6fsd8d986gd6dg&ws_name=ws&update_period=300

Json body example

{
    "ws_id": "{{ws_id}}",
    "ws_token": "{{ws_token}}",
    "ws_name": "ws",
    "update_period": 300,
    "ram_units": "",
    "disk_units": "",
    "proc_units": ""
}

Response

{
    "success": "success"
}

Field description

The response information contains a success key which indicates that the ws interface has been added successfully

Delete ws

Description:

Used to delete ws

Request

Request method:

POST

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/delete/ws

Request body:

The request info should be sent as params or json body and it should contain the device information as illustrated in the section below.

Note:

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

Params example

https://spoilerinterface.com/interface/delete/ws?ws_state=true&ws_token=df45ddddsdaewg56df6&ws_id=301659085216623

Json body example

{
    "ws_id":301659085216623,
    "ws_token": "df45ddddsdaewg56df6",
}

Response

{
    "success": "success"
}

Field description

The response information contains a success key which indicates that the ws interface has been added successfully

Enable alerts

Description:

Used to enable interface alerts

Request

Request method:

POST

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/ws/enable/alerts

Request body:

None

Note:

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

Params example

https://spoilerinterface.com/interface/ws/enable/alerts?ws_token=df45ddddsdaewg56df6&ws_id=301659085216623

Json body example

{
    "ws_id":301659085216623,
    "ws_token": "df45ddddsdaewg56df6",
}

Response

{
    "success": "success"
}

Field description

The response information contains a success key which indicates that the ws interface has been added successfully

Disable alerts

Description:

Used to disable interface alerts

Request

Request method:

POST

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/ws/disable/alerts

Request body:

None

Note:

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

Params example

https://spoilerinterface.com/interface/ws/disable/alerts?ws_token=df45ddddsdaewg56df6&ws_id=301659085216623

Json body example

{
    "ws_id":301659085216623,
    "ws_token": "df45ddddsdaewg56df6",
}

Response

{
    "success": "success"
}

Field description

The response information contains a success key which indicates that the ws interface has been added successfully

Enable whatsapp

Description:

Used to enable interface whatsapp alerts

Request

Request method:

POST

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/ws/enable/whatsapp

Request body:

None

Note:

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

Params example

https://spoilerinterface.com/interface/ws/enable/alerts?ws_token=df45ddddsdaewg56df6&ws_id=301659085216623

Json body example

{
    "ws_id":301659085216623,
    "ws_token": "df45ddddsdaewg56df6",
}

Response

{
    "success": "success"
}

Field description

The response information contains a success key which indicates that the ws interface has been added successfully

Disable whatsapp alerts

Description:

Used to disable interface whatsapp alerts

Request

Request method:

POST

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/ws/disable/whatsapp

Request body:

None

Note:

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

Params example

https://spoilerinterface.com/interface/ws/enable/alerts?ws_token=df45ddddsdaewg56df6&ws_id=301659085216623

Json body example

{
    "ws_id":301659085216623,
    "ws_token": "df45ddddsdaewg56df6",
}

Response

{
    "success": "success"
}

Field description

The response information contains a success key which indicates that the ws interface has been added successfully

Enable sms alerts

Description:

Used to enable interface sms alerts

Request

Request method:

POST

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/ws/enable/sms

Request body:

None

Response

{
    "success": "success"
}

Field description

The response information contains a success key which indicates that the ws interface has been added successfully

Note:

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

Params example

https://spoilerinterface.com/interface/ws/enable/alerts?ws_token=df45ddddsdaewg56df6&ws_id=301659085216623

Json body example

{
    "ws_id":301659085216623,
    "ws_token": "df45ddddsdaewg56df6",
}

Disable sms alerts

Description:

Used to disable interface sms alerts

Request

Request method:

POST

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/ws/disable/sms

Request body:

None

Note:

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

Params example

https://spoilerinterface.com/interface/ws/enable/alerts?ws_token=df45ddddsdaewg56df6&ws_id=301659085216623

Json body example

{
    "ws_id":301659085216623,
    "ws_token": "df45ddddsdaewg56df6",
}

Response

{
    "success": "success"
}

Field description

The response information contains a success key which indicates that the ws interface has been added successfully