/ctrl/call

This resource is used to issue control calls and to check on the status of a previously issued calls.

Issue control call

Issue a control call to a device identified by a set of device attributes.

SecurityApiKey
Request
Request Body schema: application/json
object (DeviceAttributesWithIndexObject)

The device attributes that identify the device on which to initiate the control action.

In addition to the usual device attributes, index may be specified as the first attribute. This attribute is used when the other attributes match multiple devices. Specifically, if the value of index is n, then the call would be issued on the device with index n (with the first device having an index of 0). The default value for this attribute is 0.

For example, if there are three devices supporting the relay interface then {"index":1,"interface":"relay"} would result in a call to the second device.

method
string

The name of the control action to issue on the device. This may be either a bare method name, such as close_mask, or a fully qualified name such as relay.close_mask. In the former case, the method is invoked on the first interface registered for that device that implements a method by that name. In the latter case, the method is invoked only on the specified interface (relay).

args
Array of any <json>

The list of arguments to pass to the method. This list must have values that are compatible with the arguments expected by the method.

Responses
200

Control call response.

401

unauthorized response.

post/ctrl/call
Request samples
application/json
{
  • "attrs": {
    },
  • "method": "relay.close_mask",
  • "args": [
    ]
}
Response samples
application/json
{
  • "result": {
    }
}

Get call result

Get the result of a control call on return an error message, e.g., if the result is not yet available.

SecurityApiKey
Request
path Parameters
tid
required
integer <int54> >= 0

The transaction id of the call.

Example: 4294967360
Responses
200

Control result response.

401

Unauthorized response.

get/ctrl/call/{tid}
Request samples
Response samples
application/json
{
  • "error": "EAGAIN: Call is pending."
}