Skip to content

Core Command

Introduction

The Core Command (often called the command and control microservice) allows issuing commands or actions to devices on behalf of:

  • other microservices within Edge Xpert (for example, an edge analytics or rules engine microservice)
  • other applications that may reside on the same system as Edge Xpert (for example, a management agent that needs to turn off a sensor)
  • To any external system that needs to control these devices (e.g for example, a cloud-based application that determines the need to adjust settings on a collection of devices)

The Core Command represents commands in a common, normalized form to simplify communication with devices. There are two types of commands that can be sent to a device.

  • a GET command requests data from the device. This command is often used to request the latest sensor value from the device.
  • SET commands request an action or the operation of the device or the setting of a configuration of the device.

In most cases, GET commands are simple requests for the latest sensor reading from the device. Therefore, the request is often parameterless (with no parameters or body in the request). SET Commands require a request body containing a key/value pair array of values to be used as parameters in the request (i.e. {"additionalProp1": "string", "additionalProp2": "string"}).

Note

v2.1 supports a new value type, Object, to represent the structural value instead of encoding it as a string for the SET and GET commands, e.g. the parameter of the SET command could be {"Location": {"Latitude": 39.678725466667, "Longitude": -104.977106466667}}.

The Core Command gets its information about the devices from the Core Metadata. The Core Command always forwards commands (GET or SET) to the devices through the Device service. The Core Command never communicates directly with a device. Therefore, the Core Command is a proxy service for command or action requests from the north side of Edge Xpert (such as analysis or Application Services) to the protocol-specific Device Service and the associated device.

Although the Core Command is not currently part of its responsibilities, it could provide a layer of protection around the device. Additional security could be put in place to prevent unauthorized interaction with the devices (via the Device Service). The Core Command could also regulate the number of requests to a device so as not to overwhelm it - perhaps even caching responses so as not to wake up a device when not necessary.

Data Model

image

Note

While the general concepts of Core Command's GET/PUT requests are the same, the Core Command request/response models has changed significantly in Edge Xpert 2.0. Consult the API documentation for details.

Data Dictionary

Property Description
Id uniquely identifies the device, a UUID for example
Description
Name Name for identifying a device
Manufacturer Manufacturer of the device
Model Model of the device
Labels Labels used to search for groups of profiles
DeviceResources deviceResource collection
DeviceCommands collect of deviceCommand
Property Description
DeviceName reference to a device by name
ProfileName reference to a device profile by name
CoreCommands array of core commands
Property Description
Name
Get bool indicating a get command
Set bool indicating a set command
Path
Url
Parameters array of core command parameters
Property Description
ResourceName
ValueType

Configuration Properties

Please refer to the general Common Configuration documentation for configuration properties common to all services. Core Command no longer has any additional settings.

V2 Configuration Migration Guide

Refer to the Common Configuration Migration Guide for details on migrating the common configuration sections such as Service.