NGSI Source
This custom node is a simple node that allows to obtain NGSIv2 entities.
Properties
name
: a name for a node instanceContext Broker
: an endpoint of a context brokerServicePath
: FIWARE Service PathRepresentation
: normalized or keyValuesEntity type
: affected entity typeID pattern
: entity ID pattern of affected entitiesAttrs
: list of attributes to retrieveQuery
: query conditions using Simple Query LanguageBuffering
: whether to output all retrieved entities at onceDecode forbidden chars
:off
oron
Input
payload JSON Object
A msg.payload
should contain a query condition to retrieves NGSIv2 entitites.
{
"idPattern": ".*",
"type": "T",
"attrs": [
"humidity"
],
"q": "temperature>29",
"keyValues": true
}
Output
payload JSON Array
A msg.payload
contains NGSIv2 entities.
statusCode Number
A msg.statusCode
contains a status code.
200
Examples
Input 1
{
"idPattern": ".*"
}
Output 1
[
{
"id": "E1",
"type": "T",
"humidity": {
"type": "Number",
"value": 51,
"metadata": {}
},
"temperature": {
"type": "Number",
"value": 25,
"metadata": {}
}
},
{
"id": "E2",
"type": "T",
"humidity": {
"type": "Number",
"value": 50,
"metadata": {}
},
"temperature": {
"type": "Number",
"value": 30,
"metadata": {}
}
}
]
Input 2
{
"type": "T",
"attrs": [
"humidity"
]
}
Output 2
[
{
"id": "E1",
"type": "T",
"humidity": {
"type": "Number",
"value": 51,
"metadata": {}
}
},
{
"id": "E2",
"type": "T",
"humidity": {
"type": "Number",
"value": 50,
"metadata": {}
}
}
]
Input 3
{
"type": "T",
"q": "temperature>29"
}
Output 3
[
{
"id": "E2",
"type": "T",
"humidity": {
"type": "Number",
"value": 50,
"metadata": {}
},
"temperature": {
"type": "Number",
"value": 30,
"metadata": {}
}
}
]
Input 4
{
"type": "T",
"q": "temperature>29",
"keyValues": true
}
Output 4
[
{
"id": "E2",
"type": "T",
"humidity": 50,
"temperature": 30
}
]