...
URL : PUT http://<IP:PORT>/cps/v2/dataspaces/{dataspace-name}/notification-subscription/{subscription}
Query Parameters:
Parameter | Description |
---|---|
dataspace-name | dataspace name |
subscription | subscribe or unsubscribe |
...
Information about the subscription of notification will be persisted in Fragment table. For Example, if the notification is subscribed unsubscribed by anchor_id 28, fragment table will have below entry
...
The above entry from fragment table will be deleted when anchor is unsubscribed from subscribed to notification.
Attributes field is empty because we don't need any further granular control of notification. In future if we need to implement further granular control of notification, we can use attributes fields
Persistence using NEW dedicated YANG schema
APIs | Description |
---|---|
POST http://<IP:PORT>/cps/v2/notification-subscription | subscribe cps notification |
DELETE http://<IP:PORT>/cps/v2/notification-subscription | unsubscribe cps notification |
We can create different dataspace and anchor specially for cps notification to persist notification subscription information. We propose to create below dataspace, schema and anchor for notification subscription.
Entity | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Dataspace Name | CPS-Admin | ||||||||||||||
Anchor Name | cps-notification-subscription | ||||||||||||||
schema set | cps-notification-subscription | ||||||||||||||
cps-notification-subscriptions@2024-06-18.yang |
|
When Notification is subscribed unsubscribed for above payload, below records will be added in fragment table.
dataspace01 : all anchors subscribedunsubscribed
dataspace02: list of anchors subscribedunsubscribed
dataspace03: list of anchors and xpaths subscribed unsubscribed
id | xpath | attributes | anchor_id | parent_id | schema_node_id |
---|---|---|---|---|---|
1 | /notification-subscription/dataspaces[@name='dataspace01'] | 6 | |||
2 | /notification-subscription/dataspaces[@name='dataspace02']/anchors[@name='anchor01'] | 6 | |||
3 | /notification-subscription/dataspaces[@name='dataspace02']/anchors[@name='anchor02'] | 6 | |||
4 | /notification-subscription/dataspaces[@name='dataspace03']/anchors[@name='anchor01'] | [. "/bookstore/categories[@code='01", "/bookstore/categories[@code='02" ] | 6 |
...
Using Schema | Without Schema |
---|---|
Pros:
Cons:
| Pros:
Cons:
|
...