|
1 | 1 | ## Advanced Topics |
2 | 2 |
|
3 | | -* [Secured access to the Context Broker](#secured-access-to-the-context-broker) |
4 | | -* [GeoJSON support this only applies for NGSI-LD, not for NGSI-v1 and NGSI-v2](#geojson-support-this-only-applies-for-ngsi-ld-not-for-ngsi-v1-and-ngsi-v2) |
5 | | -* [Metadata support](#metadata-support) |
6 | | - * [NGSI LD data and metadata considerations](#ngsi-ld-data-and-metadata-considerations) |
7 | | -* [NGSI-LD Linked Data support](#ngsi-ld-linked-data-support) |
8 | | -* [Autoprovision configuration (autoprovision)](#autoprovision-configuration-autoprovision) |
9 | | -* [Explicitly defined attributes (explicitAttrs)](#explicitly-defined-attributes-explicitattrs) |
10 | | -* [Configuring operation to persist the data in Context Broker (appendMode)](#configuring-operation-to-persist-the-data-in-context-broker-appendmode) |
11 | | -* [Data mapping plugins](#data-mapping-plugins) |
12 | | - * [Development](#development) |
13 | | - * [Provided plugins](#provided-plugins) |
14 | | - * [Timestamp Compression plugin (compressTimestamp)](#timestamp-compression-plugin-compresstimestamp) |
15 | | - * [Attribute Alias plugin (attributeAlias)](#attribute-alias-plugin-attributealias) |
16 | | - * [Event plugin (addEvents)](#event-plugin-addevents) |
17 | | - * [Timestamp Processing Plugin (timestampProcess)](#timestamp-processing-plugin-timestampprocess) |
18 | | - * [Expression Translation plugin (expressionTransformation)](#expression-translation-plugin-expressiontransformation) |
19 | | - * [Multientity plugin (multiEntity)](#multientity-plugin-multientity) |
20 | | - * [Bidirectionality plugin (bidirectional)](#bidirectionality-plugin-bidirectional) |
21 | | - * [Autoprovision configuration (autoprovision)](#autoprovision-configuration-autoprovision) |
22 | | - * [Explicitly defined attributes (explicitAttrs)](#explicitly-defined-attributes-explicitattrs) |
23 | | - * [Configuring operation to persist the data in Context Broker (appendMode)](#configuring-operation-to-persist-the-data-in-context-broker-appendmode) |
24 | | -* [Old IoTAgent data migration](#old-iotagent-data-migration) |
25 | | - |
| 3 | +- [Secured access to the Context Broker](#secured-access-to-the-context-broker) |
| 4 | +- [GeoJSON support NGSI-LD only](#geojson-support-ngsi-ld-only) |
| 5 | +- [Metadata support](#metadata-support) |
| 6 | + - [NGSI LD data and metadata considerations](#ngsi-ld-data-and-metadata-considerations) |
| 7 | +- [NGSI-LD Linked Data support](#ngsi-ld-linked-data-support) |
| 8 | +- [Autoprovision configuration (autoprovision)](#autoprovision-configuration-autoprovision) |
| 9 | +- [Explicitly defined attributes (explicitAttrs)](#explicitly-defined-attributes-explicitattrs) |
| 10 | +- [Configuring operation to persist the data in Context Broker (appendMode)](#configuring-operation-to-persist-the-data-in-context-broker-appendmode) |
| 11 | +- [Data mapping plugins](#data-mapping-plugins) |
| 12 | + - [Development](#development) |
| 13 | + - [Provided plugins](#provided-plugins) |
| 14 | + - [Timestamp Compression plugin (compressTimestamp)](#timestamp-compression-plugin-compresstimestamp) |
| 15 | + - [Attribute Alias plugin (attributeAlias)](#attribute-alias-plugin-attributealias) |
| 16 | + - [Event plugin (addEvents)](#event-plugin-addevents) |
| 17 | + - [Timestamp Processing Plugin (timestampProcess)](#timestamp-processing-plugin-timestampprocess) |
| 18 | + - [Expression Translation plugin (expressionTransformation)](#expression-translation-plugin-expressiontransformation) |
| 19 | + - [Multientity plugin (multiEntity)](#multientity-plugin-multientity) |
| 20 | + - [Bidirectionality plugin (bidirectional)](#bidirectionality-plugin-bidirectional) |
| 21 | + - [Autoprovision configuration (autoprovision)](#autoprovision-configuration-autoprovision) |
| 22 | + - [Explicitly defined attributes (explicitAttrs)](#explicitly-defined-attributes-explicitattrs) |
| 23 | + - [Configuring operation to persist the data in Context Broker (appendMode)](#configuring-operation-to-persist-the-data-in-context-broker-appendmode) |
| 24 | +- [Old IoTAgent data migration](#old-iotagent-data-migration) |
26 | 25 |
|
27 | 26 | ### Secured access to the Context Broker |
28 | 27 |
|
29 | 28 | For access to instances of the Context Broker secured with a |
30 | 29 | [PEP Proxy](https://github.com/telefonicaid/fiware-orion-pep), an authentication mechanism based in Keystone Trust |
31 | | -tokens is provided. A Trust token is a long-term token that can be issued by any user to give another user permissions |
32 | | -to impersonate him with a given role in a given project. Such impersonation itself is in turn based on a short-term |
33 | | -access token. |
| 30 | +tokens is provided. A trust token is a way of Keystone to allow an user delegates a role to another user for a |
| 31 | +subservice. It is a long-term token that can be issued by any user to give another user permissions to impersonate him |
| 32 | +with a given role in a given project (subservice). Such impersonation itself is in turn based on a short-term access |
| 33 | +token. |
34 | 34 |
|
35 | 35 | For the authentication mechanisms to work, the `authentication` attribute in the configuration has to be fully |
36 | 36 | configured, and the `authentication.enabled` subattribute should have the value `true`. |
@@ -70,7 +70,12 @@ curl http://${KEYSTONE_HOST}/v3/OS-TRUST/trusts \ |
70 | 70 | Apart from the generation of the trust, the use of secured Context Brokers should be transparent to the user of the IoT |
71 | 71 | Agent. |
72 | 72 |
|
73 | | -### GeoJSON support (this only applies for NGSI-LD, not for NGSI-v1 and NGSI-v2) |
| 73 | +Complete info on Keystone trust tokens could be found at: |
| 74 | + |
| 75 | +- [Trusts concept](https://docs.openstack.org/keystone/stein/user/trusts) |
| 76 | +- [Trusts API](https://docs.openstack.org/keystone/stein/api_curl_examples.html#post-v3-os-trust-trusts) |
| 77 | + |
| 78 | +### GeoJSON support NGSI-LD only |
74 | 79 |
|
75 | 80 | The defined `type` of any GeoJSON attribute can be any set to any of the standard NGSI-v2 GeoJSON types - (e.g. |
76 | 81 | `geo:json`, `geo:point`). NGSI-LD formats such as `GeoProperty`, `Point` and `LineString` are also accepted `type` |
@@ -263,26 +268,28 @@ updated as shown: |
263 | 268 |
|
264 | 269 | ### Autoprovision configuration (autoprovision) |
265 | 270 |
|
266 | | -By default, when a measure arrives to the IoTAgent, if the `device_id` does not match with an existing one, then, the IoTA |
267 | | -creates a new device and a new entity according to the group config. Defining the field `autoprovision` to `false` |
268 | | -when provisioning the device group, the IoTA to reject the measure at the southbound, allowing only to persist the |
269 | | -data to devices that are already provisioned. It makes no sense to use this field in device provisioning since it is |
270 | | -intended to avoid provisioning devices (and for it to be effective, it would have to be provisional). |
| 271 | +By default, when a measure arrives to the IoTAgent, if the `device_id` does not match with an existing one, then, the |
| 272 | +IoTA creates a new device and a new entity according to the group config. Defining the field `autoprovision` to `false` |
| 273 | +when provisioning the device group, the IoTA to reject the measure at the southbound, allowing only to persist the data |
| 274 | +to devices that are already provisioned. It makes no sense to use this field in device provisioning since it is intended |
| 275 | +to avoid provisioning devices (and for it to be effective, it would have to be provisional). |
271 | 276 |
|
272 | 277 | ### Explicitly defined attributes (explicitAttrs) |
273 | 278 |
|
274 | | -If a given measure element (object_id) is not defined in the mappings of the device or group provision, the measure is stored |
275 | | -in the Context Broker by adding a new attribute to the entity with the same name of the undefined measure element. By adding the |
276 | | -field `explicitAttrs` with `true` value to device or group provision, the IoTAgent rejects the measure elements that are not defined |
277 | | -in the mappings of device or group provision, persisting only the one defined in the mappings of the provision. If `explicitAttrs` |
278 | | -is provided both at device and group level, the device level takes precedence. |
| 279 | +If a given measure element (object_id) is not defined in the mappings of the device or group provision, the measure is |
| 280 | +stored in the Context Broker by adding a new attribute to the entity with the same name of the undefined measure |
| 281 | +element. By adding the field `explicitAttrs` with `true` value to device or group provision, the IoTAgent rejects the |
| 282 | +measure elements that are not defined in the mappings of device or group provision, persisting only the one defined in |
| 283 | +the mappings of the provision. If `explicitAttrs` is provided both at device and group level, the device level takes |
| 284 | +precedence. |
279 | 285 |
|
280 | 286 | ### Configuring operation to persist the data in Context Broker (appendMode) |
281 | 287 |
|
282 | | -This is a flag that can be enabled by activating the parameter `appendMode` in the configuration file or by using the `IOTA_APPEND_MODE` |
283 | | -environment variable (more info [here](https://github.com/telefonicaid/iotagent-node-lib/blob/master/doc/installationguide.md)). |
284 | | -If this flag is activated, the update requests to the Context Broker will be performed always with APPEND type, instead of the |
285 | | -default UPDATE. This have implications in the use of attributes with Context Providers, so this flag should be used with care. |
| 288 | +This is a flag that can be enabled by activating the parameter `appendMode` in the configuration file or by using the |
| 289 | +`IOTA_APPEND_MODE` environment variable (more info |
| 290 | +[here](https://github.com/telefonicaid/iotagent-node-lib/blob/master/doc/installationguide.md)). If this flag is |
| 291 | +activated, the update requests to the Context Broker will be performed always with APPEND type, instead of the default |
| 292 | +UPDATE. This have implications in the use of attributes with Context Providers, so this flag should be used with care. |
286 | 293 |
|
287 | 294 | ### Data mapping plugins |
288 | 295 |
|
@@ -367,8 +374,8 @@ events in the IoT Agent with the configured type name will be marked as events. |
367 | 374 |
|
368 | 375 | ##### Timestamp Processing Plugin (timestampProcess) |
369 | 376 |
|
370 | | -This plugin processes the entity attributes looking for a `TimeInstant` attribute. If one is found, for NGSI-v1/NGSIv2, |
371 | | -the plugin adds a `TimeInstant` attribute as metadata for every other attribute in the same request. With NGSI-LD, the |
| 377 | +This plugin processes the entity attributes looking for a `TimeInstant` attribute. If one is found, for NGSIv2, the |
| 378 | +plugin adds a `TimeInstant` attribute as metadata for every other attribute in the same request. With NGSI-LD, the |
372 | 379 | Standard `observedAt` property-of-a-property is used instead. |
373 | 380 |
|
374 | 381 | ##### Expression Translation plugin (expressionTransformation) |
@@ -432,7 +439,8 @@ When a device is provisioned with bidirectional attributes, the IoTAgent subscri |
432 | 439 | change notification for that attribute arrives to the IoTA, it applies the transformation defined in the device |
433 | 440 | provisioning payload to the notification, and calls the underlying notification handler with the transformed entity. |
434 | 441 |
|
435 | | -The following `attributes` section shows an example of the plugin configuration (using IOTA_AUTOCAST=false to avoid translation from geo:point to geo:json) |
| 442 | +The following `attributes` section shows an example of the plugin configuration (using IOTA_AUTOCAST=false to avoid |
| 443 | +translation from geo:point to geo:json) |
436 | 444 |
|
437 | 445 | ```json |
438 | 446 | "attributes": [ |
|
0 commit comments