Implementing Commands

Commands are communicated to the application via the secure command channel and an application should subscribe to a wildcard under the applications command topic (<command_topic>/*). The commands and command responses are json-based.

The initial command message will be published to <command_topic>/<taskID> where command_topic is passed into the application and the taskID is a unique identifier for the current command or operation created at dispatch time by the edge stack. The application is expected to publish its response to the responseTopic, which is included in the command information passed into the application for the given task. Command response will be in the following format:
{
            "status": "SUCCESS or FAILURE or NOTSUPPORTED",
            "status_message": "status message",
            "status_detailed_message": "detailed status message",
            "output": "UTF-8 encoded output from the command"
}
Each field is UTF-8 encoding.
Note: Output is not sent to Edge Manager for deployments (DeployAnalyticTemplate and DeployDataMap).

The status_detailed_message will appear in the execution logs column in EdgeManager in the Command History page.

Note: Responses should be published with the retained flag. After reading the response, Edge Agent will issue two blank messages to clear out the completed command and response.