You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This flag is overwritten by `useCBflowControl` flag in group or device. This flag is disabled by default.
454
454
455
+
#### `cmdMode`
456
+
457
+
Set command mode for the IoTAgent instance (it can be overriden by the `cmdMode` at group or device level). Possible values are:
458
+
459
+
*`legacy` (used as default if this setting is not defined): IoTAgent commands will use Context Broker registers
460
+
mechanims.
461
+
*`notification`: IoTAgent commands will use subscriptions to be notified for Context Broker commands.
462
+
*`advancedNotification`: IoTAgent commands will use subscriptions to be notified for Context Broker commands (but in a different way as in `notification` mode)
463
+
464
+
Have a look to [this document](devel/northboundinteractions.md) for more detail on how this modes work.
465
+
455
466
### Configuration using environment variables
456
467
457
468
Some of the configuration parameters can be overriden with environment variables, to ease the use of those parameters
Copy file name to clipboardExpand all lines: doc/api.md
+33-3Lines changed: 33 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,7 @@
12
12
-[Special measures and attributes names](#special-measures-and-attributes-names)
13
13
-[Device to NGSI Mapping](#device-to-ngsi-mapping)
14
14
-[Device autoprovision and entity creation](#device-autoprovision-and-entity-creation)
15
+
-[Entity creation when `cmdMode` is `notification`](#entity-creation-when-cmdmode-is-notification)
15
16
-[Entity Name expression support](#entity-name-expression-support)
16
17
-[Multientity support](#multientity-support)
17
18
-[Metadata support](#metadata-support)
@@ -257,9 +258,9 @@ Additionally for commands (which are attributes of type `command`) the following
257
258
particular IOTAs documentation for allowed values of this field in each case.
258
259
-**contentType**: `content-type` header used when send command by HTTP transport (ignored in other kinds of
259
260
transports)
260
-
-**headers**: extra customer headers used when send command by HTTP transport (ignored in other kinds of
261
-
transports)
262
-
Check full detail of these fields in[comand-transformations](https://github.com/telefonicaid/iotagent-json/blob/master/docs/usermanual.md#commands-transformations)
261
+
-**headers**: extra customer headers used when send command by HTTP transport (ignored in other kinds of transports)
## Entity creation when `cmdMode` is `notification`
281
+
282
+
Even when an entity should not be created (see [above section](#device-autoprovision-and-entity-creation)), when the device uses `cmdMode` set to `notification` an entity is created. In particular:
283
+
284
+
* An entity is created at device provision time
285
+
* That entity is created with an attribute corresponding to each commands. The value of that attribute at creation time is `null` (specifying in some way that the command has not been triggered yet). Note that if the attribute doesn't have any command, the entity is not created (even if `cmdMode` is `notification`).
286
+
287
+
For instance, if device has commands `ping` and `switch` the entity corresponding to that device will be created at provising time with the following attributes:
288
+
289
+
```
290
+
...
291
+
{
292
+
"ping": {
293
+
"type": "command",
294
+
"value": null
295
+
},
296
+
"switch": {
297
+
"type": "command",
298
+
"value": null
299
+
},
300
+
}
301
+
```
302
+
303
+
**NOTE:**`command` is the usual type for attributes associated to commands, but the one used at provisioning time (`"command": [ ...]` field) will be actually used.
304
+
279
305
## Entity Name expression support
280
306
281
307
By default, the entity name used to persist the device measures in the Context Broker can be defined in the device
@@ -1323,6 +1349,8 @@ as `command` in the [config group](#config-group-datamodel) or in the [device pr
1323
1349
attributes are created using `command` as attribute type. Also, you can define the protocol you want the commands to be
1324
1350
sent (HTTP/MQTT) with the `transport` parameter at the provisioning process.
1325
1351
1352
+
**NOTE**: in `advancedNotification` mode the command is not triggered updating an attribute, but creating a command execution entity. However, this mode has not been implemented yet so details are to be clarified.
1353
+
1326
1354
For a given device provisioned with a `ping` command defined, any update on this attribute "ping" at the NGSI entity in
1327
1355
the Context Broker will send a command to your device. For instance, to send the `ping` command with value
1328
1356
`Ping request` you could use the following operation in the Context Broker API:
@@ -1784,6 +1812,7 @@ Config group is represented by a JSON object with the following fields:
1784
1812
|`endpoint`| ✓ |`string`|| Endpoint where the group of device is going to receive commands, if any. |
1785
1813
|`storeLastMeasure`| ✓ |`boolean`|| Store in device last measure received. See more info [in this section](admin.md#storelastmeasure). False by default |
1786
1814
|`useCBflowControl`| ✓ |`boolean`|| Use Context Broker flow control. See more info [in this section](admin.md#useCBflowControl). False by default |
1815
+
|`cmdMode`| ✓ |`string`|| Command mode that will use iotagent with CB: **legacy**, **notification** and **advancedNotification**. **Legacy** is based on registers. **notification** based on simplified schema of subscriptions. **Legacy** by default. More information on how the different modes work can be found in [the northbound interactions documents](devel/northboundinteractions.md). |
1787
1816
1788
1817
### Config group operations
1789
1818
@@ -2007,6 +2036,7 @@ the API resource fields and the same fields in the database model.
2007
2036
|`storeLastMeasure`| ✓ |`boolean`|| Store in device last measure received. Useful just for debugging purpose. See more info [in this section](admin.md#storelastmeasure). False by default. |
2008
2037
|`lastMeasure`| ✓ |`object`|| last measure stored on device when `storeLastMeasure` is enabled. See more info [in this section](admin.md#storelastmeasure). This field can be cleared using `{}` in a device update request. In that case, `lastMeasure` is removed from device (until a next measure is received and `lastMesuare` gets created again). |
2009
2038
|`useCBflowControl`| ✓ |`boolean`|| Use Context Broker flow control. See more info [in this section](admin.md#useCBflowControl). False by default. |
2039
+
|`cmdMode`| ✓ |`string`|| Command mode that will use iotagent with CB: **legacy**, **notification** and **advancedNotification**. **Legacy** is based on registers. **notification** based on simplified schema of subscriptions. **Legacy** by default. More information on how the different modes work can be found in [the northbound interactions documents](devel/northboundinteractions.md). |
0 commit comments