Skip to content
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

allow receive command notifications from CB #800

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

AlvaroVega
Copy link
Member

@AlvaroVega AlvaroVega commented Jan 25, 2024

This PR does not modify current commands based on CB registrations. It's backward compatible and adds a new way of receive command through a CB notification.
related and needs telefonicaid/iotagent-node-lib#1560

@AlvaroVega
Copy link
Member Author

AlvaroVega commented Jan 25, 2024

Example of NGSIv2 Notification command:

curl -i -X POST http://localhost:4052/notify -d '{
    "subscriptionId": "60b0cedd497e8b681d40b58e",
    "data": [{
   	 "id": "123456abcdefg",
   	 "type": "switchOnOffExecution",
   	 "targetEntityId": {
   		 "type": "Text",
   		 "value": "ENT-LUM-001",
   		 "metadata": {}
   	 },
   	 "targetEntityType": {
   		 "type": "Text",
   		 "value": "StreetLight",
   		 "metadata": {}
   	 },
   	 "execTs": {
   		 "type": "DateTime",
   		 "value": "2020-05-27T00:00:00.000Z",
   		 "metadata": {}
   	 },
   	 "cmd": {
   		 "type": "Text",
   		 "value": "switchOnOff",
   		 "metadata": {}
   	 },
   	 "params": {
   		 "type": "Text",
   		 "value": "on",
   		 "metadata": {}
   	 },
   	 "status": {
   		 "type": "Text",
   		 "value": "FORWARDED",
   		 "metadata": {}
   	 },
   	 "info": {
   		 "type": "Text",
   		 "value": null,
   		 "metadata": {}
   	 },
   	 "onDelivered": {
   		 "type": "Request"
     	 },
   	 "onOk": {
   		 "type": "Request"
   	 },
   	 "onError": {
   		 "type": "Request"
   	 },
   	 "onInfo": {
   		 "type": "Request"
   	 },
   	 "cmdExecution": {
   		 "type": "value",
   		 "value": true,
   		 "metadata": {}
   	 },
   	 "dateExpiration": {
   		 "type": "DateTime",
   		 "value": "2020-05-27T20:00:00.000Z",
   		 "metadata": {}
   	 }
    }]
}' -H 'content-type: application/json' -H 'fiware-service: smartcity' -H 'fiware-servicepath: /'

@AlvaroVega AlvaroVega changed the title [WIP] fix default notificationHandler [WIP] allow receive command notifications from CB Jan 31, 2024
@AlvaroVega AlvaroVega marked this pull request as ready for review February 5, 2024 15:49
@AlvaroVega AlvaroVega changed the title [WIP] allow receive command notifications from CB allow receive command notifications from CB Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant