This custom node is a simple node that allows to create, update or delete an NGSIv2 subscription.
Details
This operation allows to create a new subscription.
name
: A name for a node instanceContext Broker
: An endpoint of a context brokerServicePath
: FIWARE Service PathAction type
:create
Entity type
: Type of the affected entityID pattern
: Id pattern of the affected entityWatched Attrs
: list of attribute names that will trigger the notificationQuery
: A query expression, composed of a list of statements separated by;
Notification Endpoint
: URL referencing the service to be invoked when a notification is generatedAttrs
: List of attributes to be included in notification messagesAttrs format
: Specify how the entities are represented in notifications
payload JSON Object
A msg.payload
should contain a NGSIv2 subscription data.
{
"type": "T",
"idPattern": ".*",
"watchedAttrs": "temperature,humidity",
"q": "temperature>10",
"url": "http://context-consumer",
"attrs": "humidity",
"description": "subscription for node-red",
"expires": "2030-04-05T14:00:00.00Z",
"throttling": 5
}
{
"description": "subscription for node-red",
"notification": {
"attrs": [
"humidity"
],
"http": {
"url": "http://context-consumer"
}
},
"subject": {
"condition": {
"attrs": [
"temperature",
"humidity"
],
"expression": {
"q": "temperature>10"
}
},
"entities": [
{
"idPattern": ".*",
"type": "T"
}
]
},
"expires": "2030-04-05T14:00:00.00Z",
"throttling": 5
}
payload String
A msg.payload
contains a subscription id.
5fa7988a627088ba9b91b1c1
statusCode Number
A msg.statusCode
contains a status code.
201
This operation allows to update a existing subscription.
name
: A name for a node instanceContext Broker
: An endpoint of a context brokerServicePath
: FIWARE Service PathAction type
:update
Entity type
: Type of the affected entityID pattern
: Id pattern of the affected entityWatched Attrs
: list of attribute names that will trigger the notificationQuery
: A query expression, composed of a list of statements separated by;
Notification Endpoint
: URL referencing the service to be invoked when a notification is generatedAttrs
: List of attributes to be included in notification messagesAttrs format
: Specify how the entities are represented in notifications
payload JSON Object
A msg.payload
should contain a NGSIv2 subscription fragment with a subscription id.
{
"id": "5fa7988a627088ba9b91b1c1",
"expires": "2030-04-05T14:00:00.00Z"
}
statusCode Number
A msg.statusCode
contains a status code.
204
This operation allows to delete a existing subscription.
name
: A name for a node instanceContext Broker
: An endpoint of a context brokerServicePath
: FIWARE Service PathAction type
:delete
payload String
A msg.payload
should contain a subscription id.
5fa7988a627088ba9b91b1c1
statusCode Number
A msg.statusCode
contains a status code.
204
This operation allows to create, update or delete a subscription.
name
: A name for a node instanceContext Broker
: An endpoint of a context brokerServicePath
: FIWARE Service PathAction type
:value of actionType in payload
payload JSON Object
When creating a new subscription, a msg.payload
should contain a JSON Object with actionType and subscription data.
{
"actionType": "create",
"subscription": {
"type": "T",
"idPattern": ".*",
"watchedAttrs": "temperature,humidity",
"q": "temperature>10",
"url": "http://context-consumer",
"attrs": "humidity",
"description": "subscription for node-red",
"expires": "2030-04-05T14:00:00.00Z",
"throttling": 5
}
}
payload String
A msg.payload
contains a subscription id.
5fa7988a627088ba9b91b1c1
statusCode Number
A msg.statusCode
contains a status code.
201
payload JSON Object
When updating a existing subscription, a msg.payload
should contain a JSON Object with actionType, subscription id and subscription data.
{
"actionType": "update",
"id": "63ea11e4a0cec98fc6017aae",
"subscription": {
"expires": "2030-04-05T14:00:00.00Z"
}
}
statusCode Number
A msg.statusCode
contains a status code.
204
payload JSON Object
When deleting a existing subscription, a msg.payload
should contain a JSON Object with actionType and subscription id.
{
"actionType": "delete",
"id": "63ea11e4a0cec98fc6017aae"
}
statusCode Number
A msg.statusCode
contains a status code.
204