SFA API

SCADA Final Aggregator API is used to manage EVA ICS cloud and aggregated resources.

This document describes API methods for direct and JSON RPC calls. For RESTful API look SFA RESTful API.

API basics

Standard API (direct method calling)

SFA API functions are called through URL request

http://<ip_address:8828>/sfa-api/function

If SSL is allowed in the controller configuration file, you can also use https calls.

Standard API responses

Good for backward compatibility with any devices, as all API functions can be called using GET and POST. When POST is used, the parameters can be passed to functions either as multipart/form-data or as JSON.

API key can be sent in request parameters, session (if enabled and user is logged in) or in HTTP X-Auth-Key header.

Standard responses in status/body:

  • 200 OK { “result”: “OK” } API call completed successfully.

Standard error responses in status:

  • 400 Bad Request Invalid request params
  • 403 Forbidden the API key has no access to this function or resource
  • 404 Not Found method or resource/object doesn’t exist
  • 405 Method Not Allowed API function/method not found or HTTP method is not either GET or POST
  • 409 Conflict resource/object already exists or is locked
  • 500 API Error API function execution has been failed. Check input parameters and server logs.

In case API function has been failed, response body will contain JSON data with _error field, which contains error message.

{
    "_error": "unable to add object, already present",
    "result": "ERROR"
}

JSON RPC

Additionally, API supports JSON RPC 2.0 protocol. Note that default JSON RPC result is { “ok”: true } (instead of { “result”: “OK” }). There’s no error result, as JSON RPC sends errors in “error” field.

If JSON RPC request is called without ID and server should not return a result, it will return http response with a code 202 Accepted.

Note

JSON RPC is recommended way to use EVA ICS API, unless direct method calling or RESTful is really required.

JSON RPC API URL:

http://<ip_address:8828>/jrpc

JSON RPC error responses

JSON RPC calls return error codes equal to the codes of EVA API Client:

  • 1 the item or resource is not found
  • 2 access is denied with the set API key
  • 6 Attempt to call undefined API method/function
  • 10 API function failed (all errors not listed here fall within this category)
  • 11 API function is called with invalid params
  • 12 API function attempted to create resource which already exists and can’t be recreated until deleted/removed
  • 13 the resource is busy (in use) and can not be accessed/recreated or deleted at this moment

Response field “message” may contain additional information about error.

Contents

General functions

test - test API/key and get system info

Test can be executed with any valid API key of the controller the function is called to.

http

POST /sfa-api/test HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey" }

curl

curl -i -X POST http://localhost:8828/sfa-api/test -H 'Content-Type: application/json' --data-raw '{"k": "mykey"}'

wget

wget -S -O- http://localhost:8828/sfa-api/test --header='Content-Type: application/json' --post-data='{"k": "mykey"}'

httpie

echo '{
  "k": "mykey"
}' | http POST http://localhost:8828/sfa-api/test Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/test', headers={
    'Content-Type': 'application/json',
}, json={
    'k': 'mykey',
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

{
    "acl": {
        "key_id": "masterkey",
        "master": true
    },
    "cloud_manager": true,
    "db_update": 1,
    "debug": true,
    "file_management": true,
    "polldelay": 0.01,
    "product_build": 2019032301,
    "product_code": "sfa",
    "product_name": "EVA SCADA Final Aggregator",
    "result": "OK",
    "setup_mode": false,
    "system": "mws1-v1",
    "time": 1553393178.4677293,
    "uptime": 2,
    "version": "3.2.0"
}

Parameters:

  • k any valid API key

Returns:

JSON dict with system info and current API key permissions (for masterkey only { “master”: true } is returned)

login - log in and get authentication token

Obtains authentication token which can be used in API calls instead of API key.

If both k and u args are absent, but API method is called with HTTP request, which contain HTTP header for basic authorization, the function will try to parse it and log in user with credentials provided.

http

POST /sfa-api/login HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "u": "admin", "p": "123" }

curl

curl -i -X POST http://localhost:8828/sfa-api/login -H 'Content-Type: application/json' --data-raw '{"p": "123", "u": "admin"}'

wget

wget -S -O- http://localhost:8828/sfa-api/login --header='Content-Type: application/json' --post-data='{"p": "123", "u": "admin"}'

httpie

echo '{
  "p": "123",
  "u": "admin"
}' | http POST http://localhost:8828/sfa-api/login Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/login', headers={
    'Content-Type': 'application/json',
}, json={
    'p': '123',
    'u': 'admin',
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

{
    "key": "masterkey",
    "token": "token:1c166529bc3b06dac6e0fbaefee38ebe77c455480e11ff4431de2b10a5508899"
}

Parameters:

  • k valid API key or
  • u user login
  • p user password

Returns:

A dict, containing API key ID and authentication token

logout - log out and purge authentication token

Purges authentication token

If API key is used as parameter value, the function purges all tokens assigned to it.

http

POST /sys-api/unlock HTTP/1.1
Host: localhost:8812
Content-Type: application/json

{ "k": "token:c063c19fb54dd6b773b4f236f26ea7e5fbaa96f48b103221ae1107420096aef7" }

curl

curl -i -X POST http://localhost:8812/sys-api/unlock -H 'Content-Type: application/json' --data-raw '{"k": "token:c063c19fb54dd6b773b4f236f26ea7e5fbaa96f48b103221ae1107420096aef7"}'

wget

wget -S -O- http://localhost:8812/sys-api/unlock --header='Content-Type: application/json' --post-data='{"k": "token:c063c19fb54dd6b773b4f236f26ea7e5fbaa96f48b103221ae1107420096aef7"}'

httpie

echo '{
  "k": "token:c063c19fb54dd6b773b4f236f26ea7e5fbaa96f48b103221ae1107420096aef7"
}' | http POST http://localhost:8812/sys-api/unlock Content-Type:application/json

python-requests

requests.post('http://localhost:8812/sys-api/unlock', headers={
    'Content-Type': 'application/json',
}, json={
    'k': 'token:c063c19fb54dd6b773b4f236f26ea7e5fbaa96f48b103221ae1107420096aef7',
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

{
    "result": "OK"
}

Parameters:

  • k valid API key or token

Item functions

action - create unit control action

The call is considered successful when action is put into the action queue of selected unit.

http

POST /sfa-api/action HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey", "i": "unit:tests/unit1", "s": 1 }

curl

curl -i -X POST http://localhost:8828/sfa-api/action -H 'Content-Type: application/json' --data-raw '{"i": "unit:tests/unit1", "k": "mykey", "s": 1}'

wget

wget -S -O- http://localhost:8828/sfa-api/action --header='Content-Type: application/json' --post-data='{"i": "unit:tests/unit1", "k": "mykey", "s": 1}'

httpie

echo '{
  "i": "unit:tests/unit1",
  "k": "mykey",
  "s": 1
}' | http POST http://localhost:8828/sfa-api/action Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/action', headers={
    'Content-Type': 'application/json',
}, json={
    'i': 'unit:tests/unit1',
    'k': 'mykey',
    's': 1,
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

{
    "err": "",
    "exitcode": null,
    "item_group": "tests",
    "item_id": "unit1",
    "item_oid": "unit:tests/unit1",
    "item_type": "unit",
    "nstatus": 1,
    "nvalue": null,
    "out": "",
    "priority": 100,
    "status": "running",
    "time": {
        "created": 1553393178.7079775,
        "pending": 1553393178.7081232,
        "queued": 1553393178.708571,
        "running": 1553393178.7089026
    },
    "uuid": "28a51359-3b72-48dd-8197-dcee7fb0aa21"
}

Parameters:

  • k
  • i unit id
  • s desired unit status

Optionally:

  • v desired unit value
  • w wait for the completion for the specified number of seconds
  • u action UUID (will be auto generated if none specified)
  • p queue priority (default is 100, lower is better)
  • q global queue timeout, if expires, action is marked as “dead”

Returns:

Serialized action object. If action is marked as dead, an error is returned (exception raised)

action_toggle - toggle unit status

Create unit control action to toggle its status (1->0, 0->1)

http

POST /sfa-api/action_toggle HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey", "i": "unit:tests/unit1" }

curl

curl -i -X POST http://localhost:8828/sfa-api/action_toggle -H 'Content-Type: application/json' --data-raw '{"i": "unit:tests/unit1", "k": "mykey"}'

wget

wget -S -O- http://localhost:8828/sfa-api/action_toggle --header='Content-Type: application/json' --post-data='{"i": "unit:tests/unit1", "k": "mykey"}'

httpie

echo '{
  "i": "unit:tests/unit1",
  "k": "mykey"
}' | http POST http://localhost:8828/sfa-api/action_toggle Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/action_toggle', headers={
    'Content-Type': 'application/json',
}, json={
    'i': 'unit:tests/unit1',
    'k': 'mykey',
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

{
    "err": "",
    "exitcode": null,
    "item_group": "tests",
    "item_id": "unit1",
    "item_oid": "unit:tests/unit1",
    "item_type": "unit",
    "nstatus": 0,
    "nvalue": "",
    "out": "",
    "priority": 100,
    "status": "running",
    "time": {
        "created": 1553393178.8043418,
        "pending": 1553393178.805966,
        "queued": 1553393178.8063474,
        "running": 1553393178.8067617
    },
    "uuid": "4b457c1d-bccb-450b-bf63-f26fa6b69029"
}

Parameters:

  • k
  • i unit id

Optionally:

  • w wait for the completion for the specified number of seconds
  • u action UUID (will be auto generated if none specified)
  • p queue priority (default is 100, lower is better)
  • q global queue timeout, if expires, action is marked as “dead”

Returns:

Serialized action object. If action is marked as dead, an error is returned (exception raised)

disable_actions - disable unit actions

Disables unit to run and queue new actions.

http

POST /sfa-api/disable_actions HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey", "i": "unit:tests/unit1" }

curl

curl -i -X POST http://localhost:8828/sfa-api/disable_actions -H 'Content-Type: application/json' --data-raw '{"i": "unit:tests/unit1", "k": "mykey"}'

wget

wget -S -O- http://localhost:8828/sfa-api/disable_actions --header='Content-Type: application/json' --post-data='{"i": "unit:tests/unit1", "k": "mykey"}'

httpie

echo '{
  "i": "unit:tests/unit1",
  "k": "mykey"
}' | http POST http://localhost:8828/sfa-api/disable_actions Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/disable_actions', headers={
    'Content-Type': 'application/json',
}, json={
    'i': 'unit:tests/unit1',
    'k': 'mykey',
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

{
    "result": "OK"
}

Parameters:

  • k
  • i unit id

enable_actions - enable unit actions

Enables unit to run and queue new actions.

http

POST /sfa-api/enable_actions HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey", "i": "unit:tests/unit1" }

curl

curl -i -X POST http://localhost:8828/sfa-api/enable_actions -H 'Content-Type: application/json' --data-raw '{"i": "unit:tests/unit1", "k": "mykey"}'

wget

wget -S -O- http://localhost:8828/sfa-api/enable_actions --header='Content-Type: application/json' --post-data='{"i": "unit:tests/unit1", "k": "mykey"}'

httpie

echo '{
  "i": "unit:tests/unit1",
  "k": "mykey"
}' | http POST http://localhost:8828/sfa-api/enable_actions Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/enable_actions', headers={
    'Content-Type': 'application/json',
}, json={
    'i': 'unit:tests/unit1',
    'k': 'mykey',
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

{
    "result": "OK"
}

Parameters:

  • k
  • i unit id

groups - get item group list

Get the list of item groups. Useful e.g. for custom interfaces.

http

POST /sfa-api/groups HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey", "p": "unit" }

curl

curl -i -X POST http://localhost:8828/sfa-api/groups -H 'Content-Type: application/json' --data-raw '{"k": "mykey", "p": "unit"}'

wget

wget -S -O- http://localhost:8828/sfa-api/groups --header='Content-Type: application/json' --post-data='{"k": "mykey", "p": "unit"}'

httpie

echo '{
  "k": "mykey",
  "p": "unit"
}' | http POST http://localhost:8828/sfa-api/groups Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/groups', headers={
    'Content-Type': 'application/json',
}, json={
    'k': 'mykey',
    'p': 'unit',
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

[
    "mb",
    "room1",
    "tests"
]

Parameters:

  • k
  • p item type (unit [U], sensor [S] or lvar [LV])

kill - kill unit actions

Apart from canceling all queued commands, this function also terminates the current running action.

http

POST /sfa-api/kill HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey", "i": "unit:tests/unit1" }

curl

curl -i -X POST http://localhost:8828/sfa-api/kill -H 'Content-Type: application/json' --data-raw '{"i": "unit:tests/unit1", "k": "mykey"}'

wget

wget -S -O- http://localhost:8828/sfa-api/kill --header='Content-Type: application/json' --post-data='{"i": "unit:tests/unit1", "k": "mykey"}'

httpie

echo '{
  "i": "unit:tests/unit1",
  "k": "mykey"
}' | http POST http://localhost:8828/sfa-api/kill Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/kill', headers={
    'Content-Type': 'application/json',
}, json={
    'i': 'unit:tests/unit1',
    'k': 'mykey',
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

{
    "pt": "denied",
    "result": "OK"
}

Parameters:

  • k
  • i unit id

Returns:

If the current action of the unit cannot be terminated by configuration, the notice “pt” = “denied” will be returned additionally (even if there’s no action running)

q_clean - clean action queue of unit

Cancels all queued actions, keeps the current action running.

http

POST /sfa-api/q_clean HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey", "i": "unit:tests/unit1" }

curl

curl -i -X POST http://localhost:8828/sfa-api/q_clean -H 'Content-Type: application/json' --data-raw '{"i": "unit:tests/unit1", "k": "mykey"}'

wget

wget -S -O- http://localhost:8828/sfa-api/q_clean --header='Content-Type: application/json' --post-data='{"i": "unit:tests/unit1", "k": "mykey"}'

httpie

echo '{
  "i": "unit:tests/unit1",
  "k": "mykey"
}' | http POST http://localhost:8828/sfa-api/q_clean Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/q_clean', headers={
    'Content-Type': 'application/json',
}, json={
    'i': 'unit:tests/unit1',
    'k': 'mykey',
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

{
    "result": "OK"
}

Parameters:

  • k
  • i unit id

result - get action status or macro run result

Checks the result of the action by its UUID or returns the actions for the specified unit or execution result of the specified macro.

http

POST /sfa-api/result HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey", "i": "unit:tests/unit1" }

curl

curl -i -X POST http://localhost:8828/sfa-api/result -H 'Content-Type: application/json' --data-raw '{"i": "unit:tests/unit1", "k": "mykey"}'

wget

wget -S -O- http://localhost:8828/sfa-api/result --header='Content-Type: application/json' --post-data='{"i": "unit:tests/unit1", "k": "mykey"}'

httpie

echo '{
  "i": "unit:tests/unit1",
  "k": "mykey"
}' | http POST http://localhost:8828/sfa-api/result Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/result', headers={
    'Content-Type': 'application/json',
}, json={
    'i': 'unit:tests/unit1',
    'k': 'mykey',
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

[
    {
        "err": "",
        "exitcode": null,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": null,
        "out": "",
        "priority": 100,
        "status": "refused",
        "time": {
            "created": 1553390700.351254,
            "pending": 1553390700.3515577,
            "refused": 1553390700.3521607
        },
        "uuid": "43fc6cf8-868c-41e6-973a-3bd0651a7a58"
    },
    {
        "err": "",
        "exitcode": null,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": null,
        "out": "",
        "priority": 100,
        "status": "refused",
        "time": {
            "created": 1553390734.4005053,
            "pending": 1553390734.4006555,
            "refused": 1553390734.401113
        },
        "uuid": "fe463243-789d-4f63-ac7d-ec1d4d81c30b"
    },
    {
        "err": "",
        "exitcode": null,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": "",
        "out": "",
        "priority": 100,
        "status": "refused",
        "time": {
            "created": 1553390734.435894,
            "pending": 1553390734.436055,
            "refused": 1553390734.436442
        },
        "uuid": "286766d8-bae7-448e-aefd-6569ee20afd4"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": null,
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553390791.9406643,
            "created": 1553390791.8918064,
            "pending": 1553390791.8919713,
            "queued": 1553390791.892503,
            "running": 1553390791.8927374
        },
        "uuid": "30fc1a6f-7cd7-461d-9e7b-f178c92ebf51"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 0,
        "nvalue": "",
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553390792.056265,
            "created": 1553390792.004011,
            "pending": 1553390792.0045638,
            "queued": 1553390792.0059109,
            "running": 1553390792.0063531
        },
        "uuid": "60170a9f-6ec4-4d33-88d1-4e2f897349d5"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": null,
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553390994.5137296,
            "created": 1553390994.4994535,
            "pending": 1553390994.4996035,
            "queued": 1553390994.5000372,
            "running": 1553390994.5004632
        },
        "uuid": "97782cc1-7e33-4574-a79a-7c861df9b62e"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 0,
        "nvalue": "",
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553390994.597264,
            "created": 1553390994.5627725,
            "pending": 1553390994.5629196,
            "queued": 1553390994.5633478,
            "running": 1553390994.5636835
        },
        "uuid": "03ab4681-9176-4303-8716-d61d90f98785"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": null,
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553391005.6136637,
            "created": 1553391005.5657215,
            "pending": 1553391005.5658827,
            "queued": 1553391005.566252,
            "running": 1553391005.5670414
        },
        "uuid": "aec4323b-aa75-4659-beba-ebc23026e11c"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 0,
        "nvalue": "",
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553391005.7069201,
            "created": 1553391005.68087,
            "pending": 1553391005.6812887,
            "queued": 1553391005.6818678,
            "running": 1553391005.6824036
        },
        "uuid": "ffee1ff6-42aa-458d-9ac5-fcee93672f9d"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": null,
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553391071.2040575,
            "created": 1553391071.178182,
            "pending": 1553391071.178331,
            "queued": 1553391071.1787035,
            "running": 1553391071.1791801
        },
        "uuid": "a5267836-5473-4d31-b98a-1e3c7a88f3ce"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 0,
        "nvalue": "",
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553391071.274677,
            "created": 1553391071.255028,
            "pending": 1553391071.2556129,
            "queued": 1553391071.2565198,
            "running": 1553391071.2574027
        },
        "uuid": "37d490b3-bf2c-4049-9bbb-3eab5fec0d43"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": null,
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553391094.7102778,
            "created": 1553391094.6943586,
            "pending": 1553391094.6945853,
            "queued": 1553391094.6950178,
            "running": 1553391094.6954172
        },
        "uuid": "e9454a4b-2838-4b09-a2d4-60be4d7eed79"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 0,
        "nvalue": "",
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553391094.84298,
            "created": 1553391094.776577,
            "pending": 1553391094.7770581,
            "queued": 1553391094.7789402,
            "running": 1553391094.780707
        },
        "uuid": "95f7cca2-716d-4c3a-90c2-92aee791a75c"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": null,
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553391170.1063616,
            "created": 1553391170.0888066,
            "pending": 1553391170.089105,
            "queued": 1553391170.0896847,
            "running": 1553391170.090564
        },
        "uuid": "13d4aeb1-ff21-4e57-8a1f-d756ef07ee80"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 0,
        "nvalue": "",
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553391170.230939,
            "created": 1553391170.1770897,
            "pending": 1553391170.1774087,
            "queued": 1553391170.1779833,
            "running": 1553391170.1788597
        },
        "uuid": "9a775581-cd06-45cd-8dc1-f420dc21770e"
    },
    {
        "err": "",
        "exitcode": null,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": null,
        "out": "",
        "priority": 100,
        "status": "refused",
        "time": {
            "created": 1553391190.1601083,
            "pending": 1553391190.1602557,
            "refused": 1553391190.1606746
        },
        "uuid": "fdaa9659-b973-4912-8e10-59a3b9ad794a"
    },
    {
        "err": "",
        "exitcode": null,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": "",
        "out": "",
        "priority": 100,
        "status": "refused",
        "time": {
            "created": 1553391190.2166178,
            "pending": 1553391190.216803,
            "refused": 1553391190.2172205
        },
        "uuid": "86af0faa-e660-40fa-863b-5f88adbc7c21"
    },
    {
        "err": "",
        "exitcode": null,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": null,
        "out": "",
        "priority": 100,
        "status": "refused",
        "time": {
            "created": 1553391192.322588,
            "pending": 1553391192.3227346,
            "refused": 1553391192.3231575
        },
        "uuid": "526fc63a-0fae-4f7d-8d62-196d310d7787"
    },
    {
        "err": "",
        "exitcode": null,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": "",
        "out": "",
        "priority": 100,
        "status": "refused",
        "time": {
            "created": 1553391192.3585339,
            "pending": 1553391192.358684,
            "refused": 1553391192.359172
        },
        "uuid": "468a4986-d55d-4dc2-a284-dad7251b0d14"
    },
    {
        "err": "",
        "exitcode": null,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": null,
        "out": "",
        "priority": 100,
        "status": "refused",
        "time": {
            "created": 1553391216.891489,
            "pending": 1553391216.891638,
            "refused": 1553391216.8920965
        },
        "uuid": "3cee8089-7870-471b-bce8-423286858ed3"
    },
    {
        "err": "",
        "exitcode": null,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": "",
        "out": "",
        "priority": 100,
        "status": "refused",
        "time": {
            "created": 1553391216.9281282,
            "pending": 1553391216.9282804,
            "refused": 1553391216.9286792
        },
        "uuid": "e5cde1c2-a5ac-4d24-8a33-cfb83c1130a3"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": null,
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553391240.2827082,
            "created": 1553391240.2586007,
            "pending": 1553391240.2587464,
            "queued": 1553391240.2591696,
            "running": 1553391240.2596138
        },
        "uuid": "7616069b-50fa-4940-904c-e8c330ab36c1"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 0,
        "nvalue": "",
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553391240.4224195,
            "created": 1553391240.353269,
            "pending": 1553391240.3541028,
            "queued": 1553391240.3547862,
            "running": 1553391240.355448
        },
        "uuid": "367ad3d1-d47a-40fc-b4bb-48644772812b"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": null,
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553391624.476399,
            "created": 1553391624.450409,
            "pending": 1553391624.4507012,
            "queued": 1553391624.451114,
            "running": 1553391624.4515395
        },
        "uuid": "55c146a4-9a89-40a8-a8f2-7d23f1aa0de3"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 0,
        "nvalue": "",
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553391624.608322,
            "created": 1553391624.5476205,
            "pending": 1553391624.547973,
            "queued": 1553391624.5486646,
            "running": 1553391624.5515835
        },
        "uuid": "dd34ad80-5812-4ee6-9783-826f7ab7237f"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": null,
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553391857.1470582,
            "created": 1553391857.0968075,
            "pending": 1553391857.0969636,
            "queued": 1553391857.0975106,
            "running": 1553391857.0979838
        },
        "uuid": "7b2d6eea-ed49-4091-8a57-54ac7de0e13a"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 0,
        "nvalue": "",
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553391857.261049,
            "created": 1553391857.2098596,
            "pending": 1553391857.2101595,
            "queued": 1553391857.2107654,
            "running": 1553391857.2127101
        },
        "uuid": "52ea1f53-f30a-43c1-9673-9c463dba36d1"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": null,
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553391915.8110273,
            "created": 1553391915.7677264,
            "pending": 1553391915.767888,
            "queued": 1553391915.7683253,
            "running": 1553391915.768658
        },
        "uuid": "1a354dee-59ec-425b-ba46-1c8539fa6379"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 0,
        "nvalue": "",
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553391915.8938022,
            "created": 1553391915.8773186,
            "pending": 1553391915.8776157,
            "queued": 1553391915.8782036,
            "running": 1553391915.87872
        },
        "uuid": "3e54e307-0f08-44ab-9385-3de6ce1335b0"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": null,
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553391952.3316872,
            "created": 1553391952.3158872,
            "pending": 1553391952.3160324,
            "queued": 1553391952.3163886,
            "running": 1553391952.3168874
        },
        "uuid": "59b800d5-89e6-451a-8322-5a9129eb0ed8"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 0,
        "nvalue": "",
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553391952.4644141,
            "created": 1553391952.402349,
            "pending": 1553391952.402651,
            "queued": 1553391952.4032464,
            "running": 1553391952.405453
        },
        "uuid": "456e5bef-b7d1-471b-838a-a2e8f910099a"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": null,
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553391969.7291133,
            "created": 1553391969.7018714,
            "pending": 1553391969.7021127,
            "queued": 1553391969.702466,
            "running": 1553391969.7028034
        },
        "uuid": "7c996a35-31e0-4abd-a542-02ddcdb72895"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 0,
        "nvalue": "",
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553391969.8300147,
            "created": 1553391969.7710555,
            "pending": 1553391969.771407,
            "queued": 1553391969.7723377,
            "running": 1553391969.7735636
        },
        "uuid": "85f7f8fd-8223-40a6-b5bb-04db2217761a"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": null,
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553392083.2938838,
            "created": 1553392083.2683978,
            "pending": 1553392083.2685823,
            "queued": 1553392083.269043,
            "running": 1553392083.2693973
        },
        "uuid": "4d70cbf6-82e3-4114-a468-19cf132e1092"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 0,
        "nvalue": "",
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553392083.3686593,
            "created": 1553392083.347601,
            "pending": 1553392083.3480158,
            "queued": 1553392083.3487203,
            "running": 1553392083.351162
        },
        "uuid": "57ecb481-15a3-44b9-9494-1ddeddb27027"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": null,
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553392159.9963274,
            "created": 1553392159.9809895,
            "pending": 1553392159.9812481,
            "queued": 1553392159.9817739,
            "running": 1553392159.9822776
        },
        "uuid": "235bf6ae-74f9-4682-875c-80b98514fa40"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 0,
        "nvalue": "",
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553392160.083633,
            "created": 1553392160.0640118,
            "pending": 1553392160.0654118,
            "queued": 1553392160.0661607,
            "running": 1553392160.0668242
        },
        "uuid": "9276a5df-1634-49ef-9398-6c4733175065"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": null,
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553392177.6285393,
            "created": 1553392177.5780632,
            "pending": 1553392177.5782082,
            "queued": 1553392177.5786529,
            "running": 1553392177.5790448
        },
        "uuid": "756258d8-7930-4f7e-ae4a-3aa2ef147fad"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 0,
        "nvalue": "",
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553392177.7383323,
            "created": 1553392177.6891239,
            "pending": 1553392177.6893206,
            "queued": 1553392177.6897924,
            "running": 1553392177.690508
        },
        "uuid": "9e6c4384-646e-4c44-80c1-4bb6808bb0ec"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": null,
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553392187.329728,
            "created": 1553392187.311532,
            "pending": 1553392187.3116755,
            "queued": 1553392187.3120625,
            "running": 1553392187.312601
        },
        "uuid": "0fe7f3ba-5b26-4b9b-b462-4774adafc82a"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 0,
        "nvalue": "",
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553392187.46354,
            "created": 1553392187.401479,
            "pending": 1553392187.4018347,
            "queued": 1553392187.402678,
            "running": 1553392187.4062843
        },
        "uuid": "fff321d0-b8c2-4e1d-802f-2e2088a49a4b"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": null,
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553392211.7390597,
            "created": 1553392211.7218893,
            "pending": 1553392211.7222095,
            "queued": 1553392211.7228503,
            "running": 1553392211.723347
        },
        "uuid": "a1a70118-296f-4e23-832c-aa2db05f9c9f"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 0,
        "nvalue": "",
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553392211.8265252,
            "created": 1553392211.7979362,
            "pending": 1553392211.7985547,
            "queued": 1553392211.7995627,
            "running": 1553392211.80057
        },
        "uuid": "93e422f5-f151-473f-a9c8-d3907fe941a1"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": null,
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553392305.9312897,
            "created": 1553392305.8987072,
            "pending": 1553392305.898893,
            "queued": 1553392305.899624,
            "running": 1553392305.900234
        },
        "uuid": "25e14624-0d4b-43f7-b2d5-c8acc11e2b35"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 0,
        "nvalue": "",
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553392306.0411968,
            "created": 1553392306.0000386,
            "pending": 1553392306.0004368,
            "queued": 1553392306.0014431,
            "running": 1553392306.0020347
        },
        "uuid": "f5ac9329-f6bc-4637-975b-66e457495474"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": null,
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553392325.3734295,
            "created": 1553392325.3258038,
            "pending": 1553392325.3259518,
            "queued": 1553392325.3264194,
            "running": 1553392325.3267689
        },
        "uuid": "c11b0153-1637-4230-b0ab-83e5621c1875"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 0,
        "nvalue": "",
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553392325.4807303,
            "created": 1553392325.43762,
            "pending": 1553392325.4380405,
            "queued": 1553392325.4386501,
            "running": 1553392325.4392624
        },
        "uuid": "b77582b2-d160-4b87-b762-11881b4f722a"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": null,
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553392337.7544837,
            "created": 1553392337.7089267,
            "pending": 1553392337.7090757,
            "queued": 1553392337.709521,
            "running": 1553392337.7098317
        },
        "uuid": "e2044089-6704-487a-bf67-30b8dd9ad10f"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 0,
        "nvalue": "",
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553392337.8640482,
            "created": 1553392337.8271286,
            "pending": 1553392337.827911,
            "queued": 1553392337.8284936,
            "running": 1553392337.8292396
        },
        "uuid": "dc2e255b-66e5-4ac3-b919-d58237747129"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": null,
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553392367.7592354,
            "created": 1553392367.7443917,
            "pending": 1553392367.7445354,
            "queued": 1553392367.7448668,
            "running": 1553392367.7451932
        },
        "uuid": "eb100626-3664-4c1a-8d01-09bb60799da9"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 0,
        "nvalue": "",
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553392367.8788865,
            "created": 1553392367.8382714,
            "pending": 1553392367.838464,
            "queued": 1553392367.838939,
            "running": 1553392367.8391356
        },
        "uuid": "2ab15d21-e791-4320-8172-a56b221fcb67"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": null,
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553392497.33678,
            "created": 1553392497.2912,
            "pending": 1553392497.2913494,
            "queued": 1553392497.291787,
            "running": 1553392497.2921233
        },
        "uuid": "e459abf6-6497-47d2-897a-181640a7ea0e"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 0,
        "nvalue": "",
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553392497.4351342,
            "created": 1553392497.3932066,
            "pending": 1553392497.3937035,
            "queued": 1553392497.394811,
            "running": 1553392497.3955467
        },
        "uuid": "13c9921f-df34-4f28-b79d-e019c48e3233"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": null,
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553392521.0308783,
            "created": 1553392521.015974,
            "pending": 1553392521.0161548,
            "queued": 1553392521.0165317,
            "running": 1553392521.0170023
        },
        "uuid": "999a57e7-0d41-4f74-ac11-8fb528bda5d0"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 0,
        "nvalue": "",
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553392521.1689057,
            "created": 1553392521.106444,
            "pending": 1553392521.1071177,
            "queued": 1553392521.1079059,
            "running": 1553392521.1085515
        },
        "uuid": "3fde56e0-677a-44fb-aec5-0399466ca02c"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": null,
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553392582.9754581,
            "created": 1553392582.9612007,
            "pending": 1553392582.9614587,
            "queued": 1553392582.9621854,
            "running": 1553392582.962758
        },
        "uuid": "220937a3-7450-4155-a620-448534db70a0"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 0,
        "nvalue": "",
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553392583.087126,
            "created": 1553392583.0408537,
            "pending": 1553392583.0412834,
            "queued": 1553392583.0419614,
            "running": 1553392583.0426102
        },
        "uuid": "d61da601-7ffb-4e1c-b4ea-00f1677b0564"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": null,
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553392599.59678,
            "created": 1553392599.5814157,
            "pending": 1553392599.5816066,
            "queued": 1553392599.5823586,
            "running": 1553392599.5830822
        },
        "uuid": "05c9a799-ed54-47cf-ab78-4a6c77e20e83"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 0,
        "nvalue": "",
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553392599.644819,
            "created": 1553392599.6262333,
            "pending": 1553392599.6266198,
            "queued": 1553392599.6272027,
            "running": 1553392599.627941
        },
        "uuid": "4ace3707-9f91-4096-bde8-359329d2e6c3"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": null,
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553392603.9753695,
            "created": 1553392603.9269505,
            "pending": 1553392603.9271028,
            "queued": 1553392603.9275641,
            "running": 1553392603.9280574
        },
        "uuid": "295ecf5a-dde3-418b-b19b-558460500c03"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 0,
        "nvalue": "",
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553392604.098791,
            "created": 1553392604.0488374,
            "pending": 1553392604.049184,
            "queued": 1553392604.0497143,
            "running": 1553392604.0517912
        },
        "uuid": "9c32e77e-13df-448c-9077-49b09e11f2db"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": null,
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553393027.40325,
            "created": 1553393027.3772223,
            "pending": 1553393027.3774633,
            "queued": 1553393027.3779314,
            "running": 1553393027.3782878
        },
        "uuid": "47887545-df1c-4e24-b698-f2a1182cae59"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 0,
        "nvalue": "",
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553393027.4913282,
            "created": 1553393027.4688585,
            "pending": 1553393027.4692152,
            "queued": 1553393027.469715,
            "running": 1553393027.470426
        },
        "uuid": "f0f493d0-d38a-4437-9c24-0522d6368b3b"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": null,
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553393043.3207283,
            "created": 1553393043.2938066,
            "pending": 1553393043.293956,
            "queued": 1553393043.2944562,
            "running": 1553393043.29486
        },
        "uuid": "a658912a-f46d-4061-9b67-e19494413a20"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 0,
        "nvalue": "",
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553393043.448017,
            "created": 1553393043.3841853,
            "pending": 1553393043.3844686,
            "queued": 1553393043.3850503,
            "running": 1553393043.3856683
        },
        "uuid": "deb27ee9-3942-4b30-a148-a1625c34d5db"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": null,
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553393168.8310494,
            "created": 1553393168.7747464,
            "pending": 1553393168.7748902,
            "queued": 1553393168.775248,
            "running": 1553393168.7756588
        },
        "uuid": "9975de6c-8fe9-4b26-ac92-eb05fc0f9b52"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 0,
        "nvalue": "",
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553393168.939331,
            "created": 1553393168.8993685,
            "pending": 1553393168.8996406,
            "queued": 1553393168.9000542,
            "running": 1553393168.9004931
        },
        "uuid": "021cd5bb-27cc-41f3-a2a6-b7cacbb8fb5e"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 1,
        "nvalue": null,
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553393178.7220194,
            "created": 1553393178.7079775,
            "pending": 1553393178.7081232,
            "queued": 1553393178.708571,
            "running": 1553393178.7089026
        },
        "uuid": "28a51359-3b72-48dd-8197-dcee7fb0aa21"
    },
    {
        "err": "",
        "exitcode": 0,
        "item_group": "tests",
        "item_id": "unit1",
        "item_oid": "unit:tests/unit1",
        "item_type": "unit",
        "nstatus": 0,
        "nvalue": "",
        "out": "",
        "priority": 100,
        "status": "completed",
        "time": {
            "completed": 1553393178.8452694,
            "created": 1553393178.8043418,
            "pending": 1553393178.805966,
            "queued": 1553393178.8063474,
            "running": 1553393178.8067617
        },
        "uuid": "4b457c1d-bccb-450b-bf63-f26fa6b69029"
    }
]

Parameters:

  • k

Optionally:

  • u action uuid or
  • i unit/macro oid (either uuid or oid must be specified)
  • g filter by unit group
  • s filter by action status: Q for queued, R for running, F for finished

Returns:

list or single serialized action object

state - get item state

State of the item or all items of the specified type can be obtained using state command.

http

POST /sfa-api/state HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey", "p": "sensor" }

curl

curl -i -X POST http://localhost:8828/sfa-api/state -H 'Content-Type: application/json' --data-raw '{"k": "mykey", "p": "sensor"}'

wget

wget -S -O- http://localhost:8828/sfa-api/state --header='Content-Type: application/json' --post-data='{"k": "mykey", "p": "sensor"}'

httpie

echo '{
  "k": "mykey",
  "p": "sensor"
}' | http POST http://localhost:8828/sfa-api/state Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/state', headers={
    'Content-Type': 'application/json',
}, json={
    'k': 'mykey',
    'p': 'sensor',
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

[
    {
        "controller_id": "uc/mws1-v1",
        "full_id": "env/temp_test",
        "group": "env",
        "id": "temp_test",
        "oid": "sensor:env/temp_test",
        "status": 1,
        "type": "sensor",
        "value": "191"
    },
    {
        "controller_id": "uc/mws1-v1",
        "full_id": "room1/lamps",
        "group": "room1",
        "id": "lamps",
        "oid": "sensor:room1/lamps",
        "status": 0,
        "type": "sensor",
        "value": "null"
    },
    {
        "controller_id": "uc/mws1-v1",
        "full_id": "room2/h",
        "group": "room2",
        "id": "h",
        "oid": "sensor:room2/h",
        "status": 0,
        "type": "sensor",
        "value": "null"
    },
    {
        "controller_id": "uc/mws1-v1",
        "full_id": "room2/lamps",
        "group": "room2",
        "id": "lamps",
        "oid": "sensor:room2/lamps",
        "status": 0,
        "type": "sensor",
        "value": "null"
    }
]

Parameters:

  • k
  • p item type (unit [U], sensor [S] or lvar [LV])

Optionally:

  • i item id
  • g item group
  • full return full state

state_history - get item state history

State history of one item or several items of the specified type can be obtained using state_history command.

http

POST /sfa-api/state_history HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey", "i": "sensor:env/temp_test" }

curl

curl -i -X POST http://localhost:8828/sfa-api/state_history -H 'Content-Type: application/json' --data-raw '{"i": "sensor:env/temp_test", "k": "mykey"}'

wget

wget -S -O- http://localhost:8828/sfa-api/state_history --header='Content-Type: application/json' --post-data='{"i": "sensor:env/temp_test", "k": "mykey"}'

httpie

echo '{
  "i": "sensor:env/temp_test",
  "k": "mykey"
}' | http POST http://localhost:8828/sfa-api/state_history Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/state_history', headers={
    'Content-Type': 'application/json',
}, json={
    'i': 'sensor:env/temp_test',
    'k': 'mykey',
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

{
    "status": [
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1
    ],
    "t": [
        1553390125.8643427,
        1553390140.929797,
        1553390334.862889,
        1553390589.4016967,
        1553390732.9677052,
        1553391169.14625,
        1553391188.7430675,
        1553391215.390878,
        1553391623.3912942,
        1553391746.352703,
        1553391851.0065582,
        1553391951.145705,
        1553391968.589165,
        1553392069.766155,
        1553392157.956836,
        1553392366.729588,
        1553392495.9142005,
        1553392581.9080076,
        1553393041.2446685,
        1553393176.3235447
    ],
    "value": [
        19.0,
        191.0,
        191.0,
        191.0,
        191.0,
        191.0,
        191.0,
        191.0,
        191.0,
        191.0,
        191.0,
        191.0,
        191.0,
        191.0,
        191.0,
        191.0,
        191.0,
        191.0,
        191.0,
        191.0
    ]
}

Parameters:

  • k
  • a history notifier id (default: db_1)
  • i item oids or full ids, list or comma separated

Optionally:

  • s start time (timestamp or ISO)
  • e end time (timestamp or ISO)
  • l records limit (doesn’t work with “w”)
  • x state prop (“status” or “value”)
  • t time format(“iso” or “raw” for unix timestamp, default is “raw”)
  • w fill frame with the interval (e.g. “1T” - 1 min, “2H” - 2 hours etc.), start time is required
  • g output format (“list” or “dict”, default is “list”)

terminate - terminate action execution

Terminates or cancel the action if it is still queued

http

POST /sfa-api/terminate HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey", "i": "unit:tests/unit1" }

curl

curl -i -X POST http://localhost:8828/sfa-api/terminate -H 'Content-Type: application/json' --data-raw '{"i": "unit:tests/unit1", "k": "mykey"}'

wget

wget -S -O- http://localhost:8828/sfa-api/terminate --header='Content-Type: application/json' --post-data='{"i": "unit:tests/unit1", "k": "mykey"}'

httpie

echo '{
  "i": "unit:tests/unit1",
  "k": "mykey"
}' | http POST http://localhost:8828/sfa-api/terminate Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/terminate', headers={
    'Content-Type': 'application/json',
}, json={
    'i': 'unit:tests/unit1',
    'k': 'mykey',
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

{
    "result": "OK"
}

Parameters:

  • k
  • u action uuid or
  • i unit id

Returns:

An error result will be returned eitner if action is terminated (Resource not found) or if termination process is failed or denied by unit configuration (Function failed)

clear - clear lvar state

set status (if expires lvar param > 0) or value (if expires isn’t set) of a logic variable to 0. Useful when lvar is used as a timer to stop it, or as a flag to set it False.

http

POST /sfa-api/clear HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey", "i": "tests/lvar1" }

curl

curl -i -X POST http://localhost:8828/sfa-api/clear -H 'Content-Type: application/json' --data-raw '{"i": "tests/lvar1", "k": "mykey"}'

wget

wget -S -O- http://localhost:8828/sfa-api/clear --header='Content-Type: application/json' --post-data='{"i": "tests/lvar1", "k": "mykey"}'

httpie

echo '{
  "i": "tests/lvar1",
  "k": "mykey"
}' | http POST http://localhost:8828/sfa-api/clear Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/clear', headers={
    'Content-Type': 'application/json',
}, json={
    'i': 'tests/lvar1',
    'k': 'mykey',
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

{
    "result": "OK"
}

Parameters:

  • k
  • i lvar id

reset - reset lvar state

Set status and value of a logic variable to 1. Useful when lvar is being used as a timer to reset it, or as a flag to set it True.

http

POST /sfa-api/reset HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey", "i": "tests/lvar1" }

curl

curl -i -X POST http://localhost:8828/sfa-api/reset -H 'Content-Type: application/json' --data-raw '{"i": "tests/lvar1", "k": "mykey"}'

wget

wget -S -O- http://localhost:8828/sfa-api/reset --header='Content-Type: application/json' --post-data='{"i": "tests/lvar1", "k": "mykey"}'

httpie

echo '{
  "i": "tests/lvar1",
  "k": "mykey"
}' | http POST http://localhost:8828/sfa-api/reset Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/reset', headers={
    'Content-Type': 'application/json',
}, json={
    'i': 'tests/lvar1',
    'k': 'mykey',
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

{
    "result": "OK"
}

Parameters:

  • k
  • i lvar id

set - set lvar state

Set status and value of a logic variable.

http

POST /sfa-api/set HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey", "i": "lvar:tests/lvar1", "s": 1, "v": 29.445 }

curl

curl -i -X POST http://localhost:8828/sfa-api/set -H 'Content-Type: application/json' --data-raw '{"i": "lvar:tests/lvar1", "k": "mykey", "s": 1, "v": 29.445}'

wget

wget -S -O- http://localhost:8828/sfa-api/set --header='Content-Type: application/json' --post-data='{"i": "lvar:tests/lvar1", "k": "mykey", "s": 1, "v": 29.445}'

httpie

echo '{
  "i": "lvar:tests/lvar1",
  "k": "mykey",
  "s": 1,
  "v": 29.445
}' | http POST http://localhost:8828/sfa-api/set Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/set', headers={
    'Content-Type': 'application/json',
}, json={
    'i': 'lvar:tests/lvar1',
    'k': 'mykey',
    's': 1,
    'v': 29.445,
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

{
    "result": "OK"
}

Parameters:

  • k
  • i lvar id

Optionally:

  • s lvar status
  • v lvar value

toggle - clear lvar state

set status (if expires lvar param > 0) or value (if expires isn’t set) of a logic variable to 0. Useful when lvar is used as a timer to stop it, or as a flag to set it False.

http

POST /sfa-api/toggle HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey", "i": "tests/lvar1" }

curl

curl -i -X POST http://localhost:8828/sfa-api/toggle -H 'Content-Type: application/json' --data-raw '{"i": "tests/lvar1", "k": "mykey"}'

wget

wget -S -O- http://localhost:8828/sfa-api/toggle --header='Content-Type: application/json' --post-data='{"i": "tests/lvar1", "k": "mykey"}'

httpie

echo '{
  "i": "tests/lvar1",
  "k": "mykey"
}' | http POST http://localhost:8828/sfa-api/toggle Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/toggle', headers={
    'Content-Type': 'application/json',
}, json={
    'i': 'tests/lvar1',
    'k': 'mykey',
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

{
    "result": "OK"
}

Parameters:

  • k
  • i lvar id

Logic control macros

groups_macro - get macro groups list

Get the list of macros. Useful e.g. for custom interfaces.

http

POST /sfa-api/groups_macro HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey" }

curl

curl -i -X POST http://localhost:8828/sfa-api/groups_macro -H 'Content-Type: application/json' --data-raw '{"k": "mykey"}'

wget

wget -S -O- http://localhost:8828/sfa-api/groups_macro --header='Content-Type: application/json' --post-data='{"k": "mykey"}'

httpie

echo '{
  "k": "mykey"
}' | http POST http://localhost:8828/sfa-api/groups_macro Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/groups_macro', headers={
    'Content-Type': 'application/json',
}, json={
    'k': 'mykey',
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

[
    "nogroup",
    "tests"
]

Parameters:

  • k

list_macros - get macro list

Get the list of all available macros.

http

POST /sfa-api/list_macros HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey" }

curl

curl -i -X POST http://localhost:8828/sfa-api/list_macros -H 'Content-Type: application/json' --data-raw '{"k": "mykey"}'

wget

wget -S -O- http://localhost:8828/sfa-api/list_macros --header='Content-Type: application/json' --post-data='{"k": "mykey"}'

httpie

echo '{
  "k": "mykey"
}' | http POST http://localhost:8828/sfa-api/list_macros Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/list_macros', headers={
    'Content-Type': 'application/json',
}, json={
    'k': 'mykey',
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

[
    {
        "action_enabled": true,
        "controller_id": "lm/mws1-v1",
        "description": "",
        "full_id": "nogroup/lr",
        "group": "nogroup",
        "id": "lr",
        "oid": "lmacro:nogroup/lr",
        "type": "lmacro"
    },
    {
        "action_enabled": true,
        "controller_id": "lm/mws1-v1",
        "description": "test macro",
        "full_id": "tests/test",
        "group": "tests",
        "id": "test",
        "oid": "lmacro:tests/test",
        "type": "lmacro"
    },
    {
        "action_enabled": true,
        "controller_id": "lm/mws1-v1",
        "description": "",
        "full_id": "tests/test1",
        "group": "tests",
        "id": "test1",
        "oid": "lmacro:tests/test1",
        "type": "lmacro"
    },
    {
        "action_enabled": true,
        "controller_id": "lm/mws1-v1",
        "description": "",
        "full_id": "tests/test2",
        "group": "tests",
        "id": "test2",
        "oid": "lmacro:tests/test2",
        "type": "lmacro"
    }
]

Parameters:

  • k

Optionally:

  • g filter by group
  • i filter by controller

run - execute macro

Execute a macro with the specified arguments.

http

POST /sfa-api/run HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey", "i": "tests/test1" }

curl

curl -i -X POST http://localhost:8828/sfa-api/run -H 'Content-Type: application/json' --data-raw '{"i": "tests/test1", "k": "mykey"}'

wget

wget -S -O- http://localhost:8828/sfa-api/run --header='Content-Type: application/json' --post-data='{"i": "tests/test1", "k": "mykey"}'

httpie

echo '{
  "i": "tests/test1",
  "k": "mykey"
}' | http POST http://localhost:8828/sfa-api/run Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/run', headers={
    'Content-Type': 'application/json',
}, json={
    'i': 'tests/test1',
    'k': 'mykey',
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

{
    "args": [],
    "err": "",
    "exitcode": 0,
    "item_group": "tests",
    "item_id": "test1",
    "item_oid": "lmacro:tests/test1",
    "item_type": "lmacro",
    "kwargs": {},
    "out": "i am macro 1",
    "priority": 100,
    "status": "completed",
    "time": {
        "completed": 1553393179.5617268,
        "created": 1553393179.5584521,
        "pending": 1553393179.558769,
        "queued": 1553393179.5597007,
        "running": 1553393179.5601742
    },
    "uuid": "58b39005-e1d4-4e62-9700-74a06a36ed98"
}

Parameters:

  • k
  • i macro id

Optionally:

  • a macro arguments, array or space separated
  • kw macro keyword arguments, name=value, comma separated or dict
  • w wait for the completion for the specified number of seconds
  • u action UUID (will be auto generated if none specified)
  • p queue priority (default is 100, lower is better)
  • q global queue timeout, if expires, action is marked as “dead”

Logic cycles

get_cycle - get cycle information

http

POST /sfa-api/get_cycle HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey", "i": "tests/cycle1" }

curl

curl -i -X POST http://localhost:8828/sfa-api/get_cycle -H 'Content-Type: application/json' --data-raw '{"i": "tests/cycle1", "k": "mykey"}'

wget

wget -S -O- http://localhost:8828/sfa-api/get_cycle --header='Content-Type: application/json' --post-data='{"i": "tests/cycle1", "k": "mykey"}'

httpie

echo '{
  "i": "tests/cycle1",
  "k": "mykey"
}' | http POST http://localhost:8828/sfa-api/get_cycle Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/get_cycle', headers={
    'Content-Type': 'application/json',
}, json={
    'i': 'tests/cycle1',
    'k': 'mykey',
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

{
    "controller_id": "lm/mws1-v1",
    "description": "",
    "full_id": "tests/cycle1",
    "group": "tests",
    "id": "cycle1",
    "interval": 0.01,
    "oid": "lcycle:tests/cycle1",
    "type": "lcycle"
}

Parameters:

  • k
  • i cycle id

Returns:

field “value” contains real average cycle interval

groups_cycle - get cycle groups list

Get the list of cycles. Useful e.g. for custom interfaces.

http

POST /sfa-api/groups_cycle HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey" }

curl

curl -i -X POST http://localhost:8828/sfa-api/groups_cycle -H 'Content-Type: application/json' --data-raw '{"k": "mykey"}'

wget

wget -S -O- http://localhost:8828/sfa-api/groups_cycle --header='Content-Type: application/json' --post-data='{"k": "mykey"}'

httpie

echo '{
  "k": "mykey"
}' | http POST http://localhost:8828/sfa-api/groups_cycle Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/groups_cycle', headers={
    'Content-Type': 'application/json',
}, json={
    'k': 'mykey',
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

[
    "tests"
]

Parameters:

  • k

list_cycles - get cycle list

Get the list of all available cycles.

http

POST /sfa-api/list_cycles HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey" }

curl

curl -i -X POST http://localhost:8828/sfa-api/list_cycles -H 'Content-Type: application/json' --data-raw '{"k": "mykey"}'

wget

wget -S -O- http://localhost:8828/sfa-api/list_cycles --header='Content-Type: application/json' --post-data='{"k": "mykey"}'

httpie

echo '{
  "k": "mykey"
}' | http POST http://localhost:8828/sfa-api/list_cycles Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/list_cycles', headers={
    'Content-Type': 'application/json',
}, json={
    'k': 'mykey',
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

[
    {
        "controller_id": "lm/mws1-v1",
        "description": "",
        "full_id": "tests/cycle1",
        "group": "tests",
        "id": "cycle1",
        "interval": 0.01,
        "oid": "lcycle:tests/cycle1",
        "status": 0,
        "type": "lcycle",
        "value": "0,0.0100,"
    },
    {
        "controller_id": "lm/mws1-v1",
        "description": "test 2Hz cycle",
        "full_id": "tests/test1",
        "group": "tests",
        "id": "test1",
        "interval": 0.5,
        "oid": "lcycle:tests/test1",
        "status": 0,
        "type": "lcycle",
        "value": "0,0.5000,"
    }
]

Parameters:

  • k

Optionally:

  • g filter by group
  • i filter by controller

Remote controllers

append_controller - connect remote controller via HTTP

Connects remote controller to the local.

http

POST /sfa-api/append_controller HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey", "u": "localhost", "a": "secretkey", "g": "uc", "save": true }

curl

curl -i -X POST http://localhost:8828/sfa-api/append_controller -H 'Content-Type: application/json' --data-raw '{"a": "secretkey", "g": "uc", "k": "mykey", "save": true, "u": "localhost"}'

wget

wget -S -O- http://localhost:8828/sfa-api/append_controller --header='Content-Type: application/json' --post-data='{"a": "secretkey", "g": "uc", "k": "mykey", "save": true, "u": "localhost"}'

httpie

echo '{
  "a": "secretkey",
  "g": "uc",
  "k": "mykey",
  "save": true,
  "u": "localhost"
}' | http POST http://localhost:8828/sfa-api/append_controller Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/append_controller', headers={
    'Content-Type': 'application/json',
}, json={
    'a': 'secretkey',
    'g': 'uc',
    'k': 'mykey',
    'save': True,
    'u': 'localhost',
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

{
    "build": "2019031405",
    "connected": true,
    "description": "",
    "enabled": true,
    "full_id": "uc/ws1-v1",
    "group": "uc",
    "id": "ws1-v1",
    "managed": false,
    "mqtt_update": null,
    "oid": "remote_uc:uc/ws1-v1",
    "proto": "http",
    "static": true,
    "type": "remote_uc",
    "version": "3.2.0"
}

Parameters:

  • k API key with master permissions
  • u Controller API uri (proto://host:port, port not required if default)
  • a remote controller API key ($key to use local key)

Optionally:

  • m ref:MQTT notifier<mqtt_> to exchange item states in real time (default: eva_1)
  • s verify remote SSL certificate or pass invalid
  • t timeout (seconds) for the remote controller API calls
  • g controller type (“uc” or “lm”), autodetected if none
  • save save connected controller configuration on the disk immediately after creation

disable_controller - disable connected controller

http

POST /sfa-api/disable_controller HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey", "i": "uc/ws1-v1", "save": true }

curl

curl -i -X POST http://localhost:8828/sfa-api/disable_controller -H 'Content-Type: application/json' --data-raw '{"i": "uc/ws1-v1", "k": "mykey", "save": true}'

wget

wget -S -O- http://localhost:8828/sfa-api/disable_controller --header='Content-Type: application/json' --post-data='{"i": "uc/ws1-v1", "k": "mykey", "save": true}'

httpie

echo '{
  "i": "uc/ws1-v1",
  "k": "mykey",
  "save": true
}' | http POST http://localhost:8828/sfa-api/disable_controller Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/disable_controller', headers={
    'Content-Type': 'application/json',
}, json={
    'i': 'uc/ws1-v1',
    'k': 'mykey',
    'save': True,
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

{
    "result": "OK"
}

Parameters:

  • k API key with master permissions
  • i controller id

Optionally:

  • save save configuration after successful call

enable_controller - enable connected controller

http

POST /sfa-api/enable_controller HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey", "i": "uc/ws1-v1", "save": true }

curl

curl -i -X POST http://localhost:8828/sfa-api/enable_controller -H 'Content-Type: application/json' --data-raw '{"i": "uc/ws1-v1", "k": "mykey", "save": true}'

wget

wget -S -O- http://localhost:8828/sfa-api/enable_controller --header='Content-Type: application/json' --post-data='{"i": "uc/ws1-v1", "k": "mykey", "save": true}'

httpie

echo '{
  "i": "uc/ws1-v1",
  "k": "mykey",
  "save": true
}' | http POST http://localhost:8828/sfa-api/enable_controller Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/enable_controller', headers={
    'Content-Type': 'application/json',
}, json={
    'i': 'uc/ws1-v1',
    'k': 'mykey',
    'save': True,
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

{
    "result": "OK"
}

Parameters:

  • k API key with master permissions
  • i controller id

Optionally:

  • save save configuration after successful call

get_controller - get connected controller information

http

POST /sfa-api/get_controller HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey", "i": "uc/ws1-v1" }

curl

curl -i -X POST http://localhost:8828/sfa-api/get_controller -H 'Content-Type: application/json' --data-raw '{"i": "uc/ws1-v1", "k": "mykey"}'

wget

wget -S -O- http://localhost:8828/sfa-api/get_controller --header='Content-Type: application/json' --post-data='{"i": "uc/ws1-v1", "k": "mykey"}'

httpie

echo '{
  "i": "uc/ws1-v1",
  "k": "mykey"
}' | http POST http://localhost:8828/sfa-api/get_controller Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/get_controller', headers={
    'Content-Type': 'application/json',
}, json={
    'i': 'uc/ws1-v1',
    'k': 'mykey',
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

{
    "build": "2019031405",
    "connected": true,
    "description": "",
    "enabled": true,
    "full_id": "uc/ws1-v1",
    "group": "uc",
    "id": "ws1-v1",
    "managed": false,
    "mqtt_update": null,
    "oid": "remote_uc:uc/ws1-v1",
    "proto": "http",
    "static": true,
    "type": "remote_uc",
    "version": "3.2.0"
}

Parameters:

  • k API key with master permissions
  • i controller id

list_controller_props - get controller connection parameters

http

POST /sfa-api/list_controller_props HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey", "i": "uc/ws1-v1" }

curl

curl -i -X POST http://localhost:8828/sfa-api/list_controller_props -H 'Content-Type: application/json' --data-raw '{"i": "uc/ws1-v1", "k": "mykey"}'

wget

wget -S -O- http://localhost:8828/sfa-api/list_controller_props --header='Content-Type: application/json' --post-data='{"i": "uc/ws1-v1", "k": "mykey"}'

httpie

echo '{
  "i": "uc/ws1-v1",
  "k": "mykey"
}' | http POST http://localhost:8828/sfa-api/list_controller_props Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/list_controller_props', headers={
    'Content-Type': 'application/json',
}, json={
    'i': 'uc/ws1-v1',
    'k': 'mykey',
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

{
    "description": "",
    "enabled": true,
    "key": "secretkey",
    "mqtt_update": null,
    "reload_interval": 300,
    "retries": 2,
    "ssl_verify": true,
    "static": true,
    "timeout": 5.0,
    "uri": "http://localhost:8812"
}

Parameters:

  • k API key with master permissions
  • i controller id

list_controllers - get controllers list

Get the list of all connected controllers.

http

POST /sfa-api/list_controllers HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey" }

curl

curl -i -X POST http://localhost:8828/sfa-api/list_controllers -H 'Content-Type: application/json' --data-raw '{"k": "mykey"}'

wget

wget -S -O- http://localhost:8828/sfa-api/list_controllers --header='Content-Type: application/json' --post-data='{"k": "mykey"}'

httpie

echo '{
  "k": "mykey"
}' | http POST http://localhost:8828/sfa-api/list_controllers Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/list_controllers', headers={
    'Content-Type': 'application/json',
}, json={
    'k': 'mykey',
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

[
    {
        "build": "2019032301",
        "connected": true,
        "description": "",
        "enabled": true,
        "full_id": "lm/mws1-v1",
        "group": "lm",
        "id": "mws1-v1",
        "managed": false,
        "mqtt_update": "eva_1",
        "oid": "remote_lm:lm/mws1-v1",
        "proto": "http",
        "static": true,
        "type": "remote_lm",
        "version": "3.2.0"
    },
    {
        "build": "2019032301",
        "connected": true,
        "description": "",
        "enabled": true,
        "full_id": "uc/mws1-v1",
        "group": "uc",
        "id": "mws1-v1",
        "managed": false,
        "mqtt_update": "eva_1",
        "oid": "remote_uc:uc/mws1-v1",
        "proto": "http",
        "static": true,
        "type": "remote_uc",
        "version": "3.2.0"
    }
]

Parameters:

  • k API key with master permissions
  • g filter by group (“uc” or “lm”)

list_remote - get a list of items from connected controllers

Get a list of the items loaded from the connected controllers. Useful to debug the controller connections.

http

POST /sfa-api/list_remote HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey", "i": "uc/ws1-v1" }

curl

curl -i -X POST http://localhost:8828/sfa-api/list_remote -H 'Content-Type: application/json' --data-raw '{"i": "uc/ws1-v1", "k": "mykey"}'

wget

wget -S -O- http://localhost:8828/sfa-api/list_remote --header='Content-Type: application/json' --post-data='{"i": "uc/ws1-v1", "k": "mykey"}'

httpie

echo '{
  "i": "uc/ws1-v1",
  "k": "mykey"
}' | http POST http://localhost:8828/sfa-api/list_remote Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/list_remote', headers={
    'Content-Type': 'application/json',
}, json={
    'i': 'uc/ws1-v1',
    'k': 'mykey',
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

[
    {
        "controller_id": "uc/ws1-v1",
        "description": "",
        "full_id": "env/temp_test",
        "group": "env",
        "id": "temp_test",
        "loc_x": null,
        "loc_y": null,
        "loc_z": null,
        "location": "",
        "oid": "sensor:env/temp_test",
        "status": 0,
        "type": "sensor",
        "value": "null"
    },
    {
        "action_enabled": true,
        "controller_id": "uc/ws1-v1",
        "description": "",
        "full_id": "nogroup/test2",
        "group": "nogroup",
        "id": "test2",
        "loc_x": null,
        "loc_y": null,
        "loc_z": null,
        "location": "",
        "nstatus": -1,
        "nvalue": "null",
        "oid": "unit:nogroup/test2",
        "status": -1,
        "status_labels": [
            {
                "label": "OFF",
                "status": 0
            },
            {
                "label": "ON",
                "status": 1
            }
        ],
        "type": "unit",
        "value": "null"
    }
]

Parameters:

  • k API key with master permissions

Optionally:

  • i controller id
  • g filter by item group
  • p filter by item type

matest_controller - test management API connection to remote controller

http

POST /sfa-api/matest_controller HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey", "i": "uc/ws1-v1" }

curl

curl -i -X POST http://localhost:8828/sfa-api/matest_controller -H 'Content-Type: application/json' --data-raw '{"i": "uc/ws1-v1", "k": "mykey"}'

wget

wget -S -O- http://localhost:8828/sfa-api/matest_controller --header='Content-Type: application/json' --post-data='{"i": "uc/ws1-v1", "k": "mykey"}'

httpie

echo '{
  "i": "uc/ws1-v1",
  "k": "mykey"
}' | http POST http://localhost:8828/sfa-api/matest_controller Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/matest_controller', headers={
    'Content-Type': 'application/json',
}, json={
    'i': 'uc/ws1-v1',
    'k': 'mykey',
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

{
    "result": "OK"
}

Parameters:

  • k API key with master permissions
  • i controller id

reload_controller - reload controller

Reloads items from connected controller. If controller ID “ALL” is specified, all connected controllers are reloaded.

http

POST /sfa-api/reload_controller HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey", "i": "uc/ws1-v1" }

curl

curl -i -X POST http://localhost:8828/sfa-api/reload_controller -H 'Content-Type: application/json' --data-raw '{"i": "uc/ws1-v1", "k": "mykey"}'

wget

wget -S -O- http://localhost:8828/sfa-api/reload_controller --header='Content-Type: application/json' --post-data='{"i": "uc/ws1-v1", "k": "mykey"}'

httpie

echo '{
  "i": "uc/ws1-v1",
  "k": "mykey"
}' | http POST http://localhost:8828/sfa-api/reload_controller Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/reload_controller', headers={
    'Content-Type': 'application/json',
}, json={
    'i': 'uc/ws1-v1',
    'k': 'mykey',
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

{
    "result": "OK"
}

Parameters:

  • k API key with master permissions
  • i controller id

remove_controller - disconnect controller

http

POST /sfa-api/remove_controller HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey", "i": "uc/ws1-v1" }

curl

curl -i -X POST http://localhost:8828/sfa-api/remove_controller -H 'Content-Type: application/json' --data-raw '{"i": "uc/ws1-v1", "k": "mykey"}'

wget

wget -S -O- http://localhost:8828/sfa-api/remove_controller --header='Content-Type: application/json' --post-data='{"i": "uc/ws1-v1", "k": "mykey"}'

httpie

echo '{
  "i": "uc/ws1-v1",
  "k": "mykey"
}' | http POST http://localhost:8828/sfa-api/remove_controller Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/remove_controller', headers={
    'Content-Type': 'application/json',
}, json={
    'i': 'uc/ws1-v1',
    'k': 'mykey',
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

{
    "result": "OK"
}

Parameters:

  • k API key with master permissions
  • i controller id

set_controller_prop - set controller connection parameters

http

POST /sfa-api/set_controller_prop HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey", "i": "uc/ws1-v1", "p": "reload_interval", "v": 60, "save": true }

curl

curl -i -X POST http://localhost:8828/sfa-api/set_controller_prop -H 'Content-Type: application/json' --data-raw '{"i": "uc/ws1-v1", "k": "mykey", "p": "reload_interval", "save": true, "v": 60}'

wget

wget -S -O- http://localhost:8828/sfa-api/set_controller_prop --header='Content-Type: application/json' --post-data='{"i": "uc/ws1-v1", "k": "mykey", "p": "reload_interval", "save": true, "v": 60}'

httpie

echo '{
  "i": "uc/ws1-v1",
  "k": "mykey",
  "p": "reload_interval",
  "save": true,
  "v": 60
}' | http POST http://localhost:8828/sfa-api/set_controller_prop Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/set_controller_prop', headers={
    'Content-Type': 'application/json',
}, json={
    'i': 'uc/ws1-v1',
    'k': 'mykey',
    'p': 'reload_interval',
    'save': True,
    'v': 60,
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

{
    "result": "OK"
}

Parameters:

  • k API key with master permissions
  • i controller id
  • p property name (or empty for batch set)

Optionally:

  • v propery value (or dict for batch set)
  • save save configuration after successful call

test_controller - test connection to remote controller

http

POST /sfa-api/test_controller HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey", "i": "uc/ws1-v1" }

curl

curl -i -X POST http://localhost:8828/sfa-api/test_controller -H 'Content-Type: application/json' --data-raw '{"i": "uc/ws1-v1", "k": "mykey"}'

wget

wget -S -O- http://localhost:8828/sfa-api/test_controller --header='Content-Type: application/json' --post-data='{"i": "uc/ws1-v1", "k": "mykey"}'

httpie

echo '{
  "i": "uc/ws1-v1",
  "k": "mykey"
}' | http POST http://localhost:8828/sfa-api/test_controller Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/test_controller', headers={
    'Content-Type': 'application/json',
}, json={
    'i': 'uc/ws1-v1',
    'k': 'mykey',
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

{
    "result": "OK"
}

Parameters:

  • k API key with master permissions
  • i controller id

Connected clients

notify_restart - notify connected clients about server restart

Sends a server restart event to all connected clients asking them to prepare for server restart.

All the connected clients receive the event with subject=”server” and data=”restart”. If the clients use SFA Framework, they can define eva_sfa_server_restart_handler function.

Server restart notification is sent automatically to all connected clients when the server is restarting. This API function allows to send server restart notification without actual server restart, which may be useful e.g. for testing, handling frontend restart etc.

http

POST /sfa-api/notify_restart HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey" }

curl

curl -i -X POST http://localhost:8828/sfa-api/notify_restart -H 'Content-Type: application/json' --data-raw '{"k": "mykey"}'

wget

wget -S -O- http://localhost:8828/sfa-api/notify_restart --header='Content-Type: application/json' --post-data='{"k": "mykey"}'

httpie

echo '{
  "k": "mykey"
}' | http POST http://localhost:8828/sfa-api/notify_restart Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/notify_restart', headers={
    'Content-Type': 'application/json',
}, json={
    'k': 'mykey',
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

{
    "result": "OK"
}

Parameters:

  • k API key with master permissions

reload_clients - ask connected clients to reload

Sends reload event to all connected clients asking them to reload the interface.

All the connected clients receive the event with subject=”reload” and data=”asap”. If the clients use SFA Framework, they can define eva_sfa_reload_handler function.

http

POST /sfa-api/reload_clients HTTP/1.1
Host: localhost:8828
Content-Type: application/json

{ "k": "mykey" }

curl

curl -i -X POST http://localhost:8828/sfa-api/reload_clients -H 'Content-Type: application/json' --data-raw '{"k": "mykey"}'

wget

wget -S -O- http://localhost:8828/sfa-api/reload_clients --header='Content-Type: application/json' --post-data='{"k": "mykey"}'

httpie

echo '{
  "k": "mykey"
}' | http POST http://localhost:8828/sfa-api/reload_clients Content-Type:application/json

python-requests

requests.post('http://localhost:8828/sfa-api/reload_clients', headers={
    'Content-Type': 'application/json',
}, json={
    'k': 'mykey',
})

response

HTTP/1.1 200 OK
Allow: GET, HEAD, POST
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json
Expires: 0
Pragma: no-cache

{
    "result": "OK"
}

Parameters:

  • k API key with master permissions