-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Do not merge] New config groups API endpoint #1637
Changes from 27 commits
4aa64c5
1016def
ab1d728
0b0973d
1ea983f
5c686c0
5899a2b
a4db57a
4fad7ea
a07215c
207cbb5
5174f01
92340d4
2abd610
06bcc74
7483358
c0100be
8f91d13
1178705
7320d9a
407c156
bc1a1d4
e53d004
aa64573
d69f338
9e25475
0b38688
e2ea6c2
d48cc4b
e1f4e47
5a423a8
611b45f
ceafc78
c9b95e5
cdb791c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,9 +136,9 @@ For every config group, the pair (resource, apikey) _must_ be unique (as it is u | |
which device). Those operations of the API targeting specific resources will need the use of the `resource` and `apikey` | ||
parameters to select the appropriate instance. | ||
|
||
Config groups can be created with preconfigured sets of attributes, service and subservice information, security information and other | ||
parameters. The specific parameters that can be configured for a given config group are described in the | ||
[Config group datamodel](#config-group-datamodel) section. | ||
Config groups can be created with preconfigured sets of attributes, service and subservice information, security | ||
information and other parameters. The specific parameters that can be configured for a given config group are described | ||
in the [Config group datamodel](#config-group-datamodel) section. | ||
|
||
### Devices | ||
|
||
|
@@ -218,7 +218,7 @@ device preprovisioning). Device measures can have four different behaviors: | |
an attribute in the device's entity, for which the IoT Agent will be regitered as Context Provider. The IoT Agent | ||
will return an immediate response to the Context Broker, and will be held responsible of contacting the device to | ||
perform the command itself using the device specific protocol. Special `status` and `info` attributes should be | ||
update. For each command, its `name` and `type` must be provided. For further information, please refer to | ||
update. For each command, its `name` and `type` must be provided. For further information, please refer to | ||
[Command execution](#command-execution) section. | ||
|
||
All of them have the same syntax, a list of objects with the following attributes: | ||
|
@@ -565,17 +565,18 @@ expression. In all cases the following data is available to all expressions: | |
- `id`: device ID | ||
- `entity_name`: NGSI entity Name (principal) | ||
- `type`: NGSI entity type (principal) | ||
- `service`: device service (`Fiware-Service`) | ||
- `service`: device service (`Fiware-Service`) | ||
- `subservice`: device subservice (`Fiware-ServicePath`) | ||
- `staticAttributes`: static attributes defined in the device or config group | ||
|
||
Additionally, for attribute expressions (`expression`, `entity_name`), `entityNameExp` and metadata expressions | ||
(`expression`) the following is available in the **context** used to evalute: | ||
|
||
- measures, as `<AttributeName>` | ||
- metadata (both for attribute measurement in the case of NGSI-v2 measurements and static attribute) are available in the **context** under the following convention: | ||
`metadata.<AttributeName>.<MetadataName>` or `metadata.<StaticAttributeName>.<MetadataName>` in a similar way of defined | ||
for [Context Broker](https://github.com/telefonicaid/fiware-orion/blob/master/doc/manuals/orion-api.md#metadata-support) | ||
- measures, as `<AttributeName>` | ||
- metadata (both for attribute measurement in the case of NGSI-v2 measurements and static attribute) are available in | ||
the **context** under the following convention: `metadata.<AttributeName>.<MetadataName>` or | ||
`metadata.<StaticAttributeName>.<MetadataName>` in a similar way of defined for | ||
[Context Broker](https://github.com/telefonicaid/fiware-orion/blob/master/doc/manuals/orion-api.md#metadata-support) | ||
|
||
### Examples of JEXL expressions | ||
|
||
|
@@ -736,7 +737,8 @@ e.g.: | |
} | ||
``` | ||
|
||
Note that there is no order into metadata structure and there is no warranty about which metadata attribute expression will be evaluated first. | ||
Note that there is no order into metadata structure and there is no warranty about which metadata attribute expression | ||
will be evaluated first. | ||
|
||
## Measurement transformation | ||
|
||
|
@@ -1070,21 +1072,21 @@ As part of the device to entity mapping process, the IoT Agent creates and updat | |
attribute called `TimeInstant`. This timestamp is represented as two different properties of the mapped entity: | ||
|
||
- An attribute `TimeInstant` is added to updated entities in the case of NGSI-v2, which captures as an ISO8601 | ||
timestamp when the associated measurement was observed. With NGSI-LD, the Standard | ||
`observedAt` property is used instead | ||
timestamp when the associated measurement was observed. With NGSI-LD, the Standard `observedAt` property is used | ||
instead | ||
|
||
- With NGSI-v2, an attribute metadata named `TimeInstant` per active or lazy attribute mapped, which captures as an ISO8601 | ||
timestamp when the associated measurement (represented as attribute value) was observed. With NGSI-LD, the Standard | ||
`observedAt` property-of-a-property is used instead. | ||
- With NGSI-v2, an attribute metadata named `TimeInstant` per active or lazy attribute mapped, which captures as an | ||
ISO8601 timestamp when the associated measurement (represented as attribute value) was observed. With NGSI-LD, the | ||
Standard `observedAt` property-of-a-property is used instead. | ||
|
||
If timestamp is not explicily defined when sending the measures through the IoT Agent (for further details on how to | ||
attach timestamp information to the measures, please refer to the particular IoT Agent implementation documentation), | ||
the arrival time on the server when receiving the measurement will be used to generate a `TimeInstant` for both the | ||
entity attribute and the attribute metadata. | ||
|
||
This functionality can be turned on and off globaly through the use of the `timestamp` configuration flag or `IOTA_TIMESTAMP` | ||
variable as well as `timestamp` flag in device or group provision (in this case, the device or group level flag takes | ||
precedence over the global one). The default value is `true`. | ||
This functionality can be turned on and off globaly through the use of the `timestamp` configuration flag or | ||
`IOTA_TIMESTAMP` variable as well as `timestamp` flag in device or group provision (in this case, the device or group | ||
level flag takes precedence over the global one). The default value is `true`. | ||
|
||
The `timestamp` configuration value used, according to the priority: | ||
|
||
|
@@ -1104,6 +1106,7 @@ the IoTA behaviour is described in the following table: | |
| false | No | TimeInstant and metadata updated with server timestamp | | ||
| Not defined | Yes | TimeInstant and metadata updated with measure value | | ||
| Not defined | No | TimeInstant and metadata updated with server timestamp | | ||
|
||
Some additional considerations to take into account: | ||
|
||
- If there is an attribute which maps a measure to `TimeInstant` attribute (after | ||
|
@@ -1724,7 +1727,7 @@ Config group is represented by a JSON object with the following fields: | |
|
||
The following actions are available under the config group endpoint: | ||
|
||
#### Retrieve config groups `GET /iot/services` | ||
#### Retrieve config groups GET `/iot/configGroups` or `GET /iot/services` | ||
|
||
List all the config groups for the given `fiware-service` and `fiware-servicepath`. The config groups that match the | ||
`fiware-servicepath` are returned in any other case. | ||
|
@@ -1748,14 +1751,14 @@ Successful operations return `Content-Type` header with `application/json` value | |
|
||
_**Response payload**_ | ||
|
||
A JSON object with a services field that contains an array of services that match the request. See the | ||
A JSON object with a configGroups or services field that contains an array of services that match the request. See the | ||
[config group datamodel](#service-group-datamodel) for more information. | ||
|
||
Example: | ||
|
||
```json | ||
{ | ||
"services": [ | ||
"configGroups": [ | ||
{ | ||
"resource": "/deviceTest", | ||
"apikey": "801230BJKL23Y9090DSFL123HJK09H324HV8732", | ||
|
@@ -1792,7 +1795,7 @@ Example: | |
} | ||
``` | ||
|
||
#### Create config group `POST /iot/services` | ||
#### Create config group `POST /iot/configGroups` or `POST /iot/services` | ||
|
||
Creates a set of config groups for the given service and service path. The service and subservice information will taken | ||
from the headers, overwritting any preexisting values. | ||
|
@@ -1806,14 +1809,14 @@ _**Request headers**_ | |
|
||
_**Request payload**_ | ||
|
||
A JSON object with a `services` field. The value is an array of config groups objects to create. See the | ||
[config group datamodel](#service-group-datamodel) for more information. | ||
A JSON object with a `configGroups` or `services` field. The value is an array of config groups objects to create. See | ||
the [config group datamodel](#service-group-datamodel) for more information. | ||
|
||
Example: | ||
|
||
```json | ||
{ | ||
"services": [ | ||
"configGroups": [ | ||
{ | ||
"resource": "/deviceTest", | ||
"apikey": "801230BJKL23Y9090DSFL123HJK09H324HV8732", | ||
|
@@ -1847,11 +1850,11 @@ _**Response headers**_ | |
|
||
Successful operations return `Content-Type` header with `application/json` value. | ||
|
||
#### Modify config group `PUT /iot/services` | ||
#### Modify config group `PUT /iot/configGroups` or `PUT /iot/services` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd suggest to remove references to
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pending to choose the final term for |
||
|
||
Modifies the information of a config group, identified by the `resource` and `apikey` query parameters. Takes a service | ||
group body as the payload. The body does not have to be complete: for incomplete bodies, just the attributes included in | ||
the JSON body will be updated. The rest of the attributes will remain unchanged. | ||
Modifies the information of a config group, identified by the `resource` and `apikey` query parameters. Takes a | ||
configuration/service group body as the payload. The body does not have to be complete: for incomplete bodies, just the | ||
attributes included in the JSON body will be updated. The rest of the attributes will remain unchanged. | ||
|
||
_**Request query parameters**_ | ||
|
||
|
@@ -1887,7 +1890,7 @@ _**Response code**_ | |
- 400 MISSING_HEADERS if any of the mandatory headers is not present. | ||
- 500 SERVER ERROR if there was any error not contemplated above.: | ||
|
||
#### Remove config group `DELETE /iot/services` | ||
#### Remove config group `DELETE /iot/configGroups` or `DELETE /iot/services` | ||
|
||
Removes a config group, identified by the `resource` and `apikey` query parameters. | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added here:e1f4e47
This commit also includes an entry in deprecated.md file