This section details an essential part of the provided functionalities – remote Management via control commands. Actions can be performed on a given device either by invoking one of its Instant Actions or creating a Management Rule. Supported Control Unit actions are explicitly defined in the Control Unit metadata with an ID and optional input/output arguments.


The REST is NOT a bidirectional protocol. It uses the request-response model – a message for an instant action can not be initiated from the backend to the device, instead the device must request all its pending actions.

In order for a device to request all its pending actions, they should be in the form of persistent Tasks.

Our GUI has the option to interpret all Instant Actions as persistent Tasks. This can be achieved by including the following field in the attribute section of the Action in the Control Unit Metadata:


<objectclass>
<attribute modifier="in">
<key name="action.invocation" value="mprm.operation.async"/>
<key name="mprm.operation.persistent" value="true"/>
<key name="action.invocation.async.explicit" value="mprm.async.type.task"/>
</attribute>
</objectclass>



If an Action is invoked by a Management Rule, the following structure is required – <target>.persistant.<action>

Invoked actions can be pulled as Management Instructions by the device with a GETrequest on the following URI: …/{deviceType}/{deviceId}/instructions. The request delivers the following Management Instructions result:

Management Instructions


Field

Type

Resolution

Description

instructionType

enum Instruction

Mandatory

SYNC, SYNC_TYPE, SYNC_CU, INVOKE_ACTION.

instructionId

String

Mandatory

The ID of the Instruction.

cuType

String

Optional

The type of the Control Unit the action is being performed on.

cuId

String

Optional

The ID of the Control Unit the action is being performed on.

action

String

Optional

The Identifier of the action -for INVOKE_ACTION.

args

Object[]

Optional

Arguments of the action.


Confirmation for the execution of a given Instruction can be send via PUTrequest on the following URI: …/{deviceType}/{deviceId}/instructions with the following Instruction Result body:

Instruction Result


Field

Type

Resolution

Description

instructionId

String

Mandatory

The id of the instruction, received with the GET request.

resultValue

Object

Optional

The result of the performed operation.

error

String

Optional

Error message of the execution.