This custom node is a simple node that allows to create, read, upsert or delete an NGSIv2 entity.
Details
It allows to create a NGSIv2 entity.
name
: A name for a node instanceContext Broker
: An endpoint of a context brokerServicePath
: FIWARE Service PathAction type
:create
Representation
: normalized or keyValuesEncode / Decode forbidden chars
:off
oron
payload JSON Object
A msg.payload
should contain an entity to create.
{
"id": "E",
"type": "T",
"temperature": {
"type": "Number",
"value": 25,
"metadata": {
"TimeInstant": {
"type": "DateTime",
"value": "2023-02-10T20:33:53.199Z"
}
}
},
"relativeHumidity": {
"type": "Number",
"value": 45,
"metadata": {}
},
"atmosphericPressure": {
"type": "Number",
"value": 1003.5,
"metadata": {}
}
}
statusCode Number
A msg.statusCode
contains a status code.
201
It allows to read a NGSIv2 entity.
name
: A name for a node instanceContext Broker
: An endpoint of a context brokerServicePath
: FIWARE Service PathAction type
:read
Entity id
: id of an entity to be readEntity type
: type of an entity to be readattributes
: list of attributes of an entity to be readRepresentation
: normalized or keyValuesDate Modified
: retrieve attribute and metadata of dateModifiedEncode / Decode forbidden chars
:off
oron
payload string or JSON Object
A msg.payload
should contain an entity Id to read the NGSI v2 entity.
urn:ngsi-ld:Building:store001
A msg.payload
should contain a condition to read the NGSI v2 entity.
{
"id": "urn:ngsi-ld:Building:store001",
"type": "Building",
"attrs": "humidity",
"keyValues": true,
"dateModified": false
}
payload JSON Object
A msg.payload
contains the NGSIv2 entity.
{
"id": "E1",
"type": "T",
"humidity": {
"type": "Number",
"value": 51,
"metadata": {}
},
"temperature": {
"type": "Number",
"value": 25,
"metadata": {}
}
}
statusCode Number
A msg.statusCode
contains a status code.
200
It allows to upsert a NGSIv2 entity.
name
: A name for a node instanceContext Broker
: An endpoint of a context brokerServicePath
: FIWARE Service PathAction type
:upsert
Representation
: normalized or keyValuesEncode / Decode forbidden chars
:off
oron
payload JSON Object
A msg.payload
should contain an entity to upsert.
{
"id": "E",
"type": "T",
"temperature": {
"type": "Number",
"value": 25,
"metadata": {
"TimeInstant": {
"type": "DateTime",
"value": "2023-02-10T20:33:53.199Z"
}
}
},
"relativeHumidity": {
"type": "Number",
"value": 45,
"metadata": {}
},
"atmosphericPressure": {
"type": "Number",
"value": 1003.5,
"metadata": {}
}
}
statusCode Number
A msg.statusCode
contains a status code.
204
It allows to delete a NGSIv2 entity.
name
: A name for a node instanceContext Broker
: An endpoint of a context brokerServicePath
: FIWARE Service PathAction type
:delete
Entity id
: id of an entity to be deletedEntity type
: type of an entity to be deletedEncode / Decode forbidden chars
:off
oron
payload string or JSON Object
A msg.payload
should contain an entity Id to delete the NGSI v2 entity.
urn:ngsi-ld:Building:store001
A msg.payload
should contain a condition to delete the NGSI v2 entity.
{
"id": "urn:ngsi-ld:Building:store001",
"type": "Building",
}
statusCode Number
A msg.statusCode
contains a status code.
204
It allows to create, read, upsert or delete a NGSIv2 entity.
name
: A name for a node instanceContext Broker
: An endpoint of a context brokerServicePath
: FIWARE Service PathAction type
:value of actionType in payload
Entity id
: Id of an entity to be created, read, upserted or deletedEntity type
: Type of an entity to be created, read, upserted or deletedRepresentation
: normalized or keyValuesDate Modified
: retrieve attribute and metadata of dateModifiedEncode / Decode forbidden chars
:off
oron
payload JSON Object
When creating an entity, a msg.payload
should contain a JSON Object with actionType
and entity
.
{
"actionType": "create",
"entity": {
"id": "E",
"type": "T",
"temperature": {
"type": "Number",
"value": 25,
"metadata": {
"TimeInstant": {
"type": "DateTime",
"value": "2023-02-10T20:33:53.199Z"
}
}
},
"relativeHumidity": {
"type": "Number",
"value": 45,
"metadata": {}
},
"atmosphericPressure": {
"type": "Number",
"value": 1003.5,
"metadata": {}
}
}
}
statusCode Number
A msg.statusCode
contains a status code.
201
payload JSON Object
When reading an entity, a msg.payload
should contain a JSON Object with actionType
and related information the entity to be read.
{
"actionType": "read",
"id": "E",
"type": "T"
}
payload JSON Object
A msg.payload
contains an object representing the entity.
{
"type":"Number",
"value":45,
"metadata":{}
}
statusCode Number
A msg.statusCode
contains a status code.
200
payload JSON Object
When upserting an entity, a msg.payload
should contain a JSON Object with actionType
and entity
.
{
"actionType": "upsert",
"entity": {
"id": "E",
"type": "T",
"temperature": {
"type": "Number",
"value": 29,
"metadata": {
"TimeInstant": {
"type": "DateTime",
"value": "2023-02-10T20:33:53.199Z"
}
}
},
"relativeHumidity": {
"type": "Number",
"value": 58,
"metadata": {}
},
"atmosphericPressure": {
"type": "Number",
"value": 1234.5,
"metadata": {}
}
}
}
statusCode Number
A msg.statusCode
contains a status code.
204
payload JSON Object
When deleting an entity, a msg.payload
should contain a JSON Object with actionType
and related information the entity to be deleted.
{
"actionType": "delete",
"id": "E",
"type": "T"
}
statusCode Number
A msg.statusCode
contains a status code.
204