-
Notifications
You must be signed in to change notification settings - Fork 265
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
[Doc] Add geofencing subscription example #4431
Changes from 3 commits
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 | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -3651,7 +3651,7 @@ A `condition` contains the following subfields: | |||||||
| Parameter | Optional | Type | Description | | ||||||||
|--------------|----------|-------|-------------------------------------------------------------------------------------------------------------------------------| | ||||||||
| `attrs` | ✓ | array | Array of attribute names that will trigger the notification. Empty list is not allowed. | | ||||||||
| `expression` | ✓ | object| An expression composed of `q`, `mq`, `georel`, `geometry` and `coords` (see [List Entities](#list-entities-get-v2entities) operation above about this field). `expression` and sub elements (i.e. `q`) must have content, i.e. `{}` or `""` is not allowed | | ||||||||
| `expression` | ✓ | object| An expression composed of `q`, `mq`, `georel`, `geometry` and `coords` (see [List Entities](#list-entities-get-v2entities) operation above about this field). `expression` and sub elements (i.e. `q`) must have content, i.e. `{}` or `""` is not allowed. `georel`, `geometry` and `coords` have to be used together (i.e. "all or nothing"). Check the example using geoquery as expression [below](#create-subscription-post-v2subscriptions).| | ||||||||
| `alterationTypes` | ✓ | array | Specify under which alterations (entity creation, entity modification, etc.) the subscription is triggered (see section [Subscriptions based in alteration type](#subscriptions-based-in-alteration-type)) | | ||||||||
| `notifyOnMetadataChange` | ✓ | boolean | If `true` then metadata is considered part of the value of the attribute in the context of notification, so if the value doesn't change but the metadata changes, then a notification is triggered. If `false` then the metadata is not considered part of the value of the attribute in the context of notification, so if the value doesn't change but the metadata changes, then a notification is not triggered. Default value is `true`. | | ||||||||
|
||||||||
|
@@ -3892,6 +3892,38 @@ Example: | |||||||
} | ||||||||
``` | ||||||||
|
||||||||
Example using geoquery as condition: | ||||||||
|
||||||||
```json | ||||||||
{ | ||||||||
"description": "One subscription to rule them all", | ||||||||
"subject": { | ||||||||
"entities": [ | ||||||||
{ | ||||||||
"idPattern": ".*", | ||||||||
"type": "Room" | ||||||||
} | ||||||||
], | ||||||||
"condition": { | ||||||||
"attrs": [ "temperature" ], | ||||||||
"expression": { | ||||||||
"georel": "near;maxDistance:15000", | ||||||||
"geometry": "point", | ||||||||
"coords": "coords": "37.407804, -6.004552" | ||||||||
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.
Suggested change
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. Done at e56a7be |
||||||||
} | ||||||||
} | ||||||||
}, | ||||||||
"notification": { | ||||||||
"http": { | ||||||||
"url": "http://localhost:1234" | ||||||||
}, | ||||||||
"attrs": ["temperature", "humidity"] | ||||||||
}, | ||||||||
"expires": "2025-04-05T14:00:00.00Z", | ||||||||
"throttling": 5 | ||||||||
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.
Suggested change
Remove also in L3891. 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. Done at e56a7be |
||||||||
} | ||||||||
``` | ||||||||
|
||||||||
_**Response code**_ | ||||||||
|
||||||||
* Successful operation uses 201 Created | ||||||||
|
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.
L3865 should be changed to "Example using attribute filter".
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.
Done at e56a7be