Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Jira
serverONAP Jira
columnIdsissuekey,summary,issuetype,created,updated,duedate,assignee,reporter,priority,status,resolution
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId425b2b0a-557c-3c0c-b515-579789cceedb
keyCPS-2067

Issues & Decisions

#

Issue

Notes

Decisions

1

Use anchor objects instead of just the anchor names. ( this is to make sure the YANG schema is flexible enough and also same in the REST side)

Requires we agree on the REST endpoint and request body and corresponding YANG schema to store the metadata.


2

Wildcard character to subscribe/unsubscribe all the anchors in a given dataspace.

Need to agree on the wildcard character.

Propose to have a single ["*"] to subscribe or unsubscribe.






Description

We want to implement a granular approach to control cps notifications. it will help in performance improvement by suppressing the unwanted messages in Kafka message stream 

...

Persistence using NEW dedicated YANG schema 

APIsDescription
POST http://<IP:PORT>/cps/v2/notification-subscriptionsubscribe cps notification
DELETE  http://<IP:PORT>/cps/v2/notification-subscriptionunsubscribe cps notification

 Parameters

ParameterInDescription
xpathQueryxpath of the dataspace/anchor to be subscribed or unsubscribed

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.

EntityDescription
Dataspace NameCPS-Admin
Anchor Namecps-notification-subscription
schema setcps-notification-subscription
cps-notification-subscriptions@2024-06-18.yang


Code Block
titleSchema
collapsetrue
module subscriptioncps-notification-subscriptions {
    yang-version 1.1;
    namespace "org:onap:ccsdk:sample";

    prefix cps-notification-subscriptionsubscriptions;

    revision "2024-0708-05" {
        description
            "Sample Model";
    }
    container cps-notificationdataspaces {

      list dataspacesdataspace {
        key "name";

        leaf name {
          type string;
      }

      container anchors }{

        list anchorsanchor {
          key "name";

          leaf name {
            type string;
          }

          container xpaths {

            list xpathsxpath {
              key "xpathpath";
              leaf xpathpath {
                type string;
              }
            }
          }
        }
      }

      leaf-list subscriptionIds {
        type string;
      }
    }
  }
}


Code Block
titleJSON payload
collapsetrue
{
    "cps-notification-subscriptionsubscriptions:dataspaces": {
	    "dataspacesdataspace": [
		    {
			    "name": "dataspace01ds01",
			},	"anchors":{
			{	
				    "nameanchor": "dataspace02",
[
					   "anchors": [
					    {
						    "name" : "anchor01",
					},
			"xpaths": {
		{
					    "namexpath": "anchor02"[
					}
				]    {
			},
			{
			    "namepath": "dataspace03/xpath",
			    "anchors": [
			     {
			         "name": "anchor01",}
				     "xpaths" : [
				         {
]
							.    "xpath": "/bookstore/categories[@code='01']"}
						 },
						 {
					]
				},
			 	"xpathsubscriptionIds": "/bookstore/categories[@code='02']"
			["0","1"]
			 },
					 ]{
				}    "name": "ds02",
				"subscriptionIds": ["0"]
			}	
		]
		
	}
}


When Notification is unsubscribed for above payload, below records will be added in fragment table. 

dataspace01 : all anchors unsubscribed

dataspace02: list of anchors unsubscribed

dataspace03: list of anchors and xpaths unsubscribed 

  

6
idxpathattributesanchor_idparent_idschema_node_id
1/dataspaces{}6

2notification-subscription/dataspaces/dataspace[@name='dataspace01ds02']62{"name": "ds02", "subscriptionIds": ["0"]}61
3/dataspaces/dataspace/notification-subscription/dataspaces[@name='dataspace02']/anchorsds01']{"name": "ds01", "subscriptionIds": ["0", "1"]}61
4/dataspaces/dataspace[@name='anchor01ds01']/anchors

{} 

63
5/notification-subscriptiondataspaces/dataspacesdataspace[@name='dataspace02ds01']/anchors/anchor[@name='anchor02anchor01']

{"name": "anchor01"} 

64
6/notification-subscriptiondataspaces/dataspacesdataspace[@name='dataspace03ds01']/anchors/anchor[@name='anchor01']/xpaths

[.

"/bookstore/categories[@code='01", "/bookstore/categories[@code='02"

]

{}

65
7/dataspaces/dataspace[@name='ds01']/anchors/anchor[@name='anchor01']/xpaths/xpath[@path='/xpath']

{"path": "/xpath"}

66


Notification scenarios 


ScenarioDescription
1day 0 
  1. a new dataspace and anchor will be created using notification yang model.
  2.  Add notification subscription record for all dataspaces 
2enable notification for a dataspace and all of its anchorsxpath '/dataspaces/dataspace[@name='ds-name']' and attributes '{"name": "ds01", "subscriptionIds": ["0"]}' will be added
3when a new dataspace will be creatednotification will be disabled for newly created dataspace. clients need to subscription API to enable notification 
4when a new anchor will be createdfor newly created anchors notification will be disabled. clients need to call subscription API to enable notification for newly created anchor
5Disable notification for whole dataspaceall notifications for the dataspace will be disabled. 
6Disable notification for specific anchorIf notification is subscribed for the anchor than client can disable notifications for the Anchor
7Enable notification for dataspace and disable for few anchorsFirst Anchors should be subscribed than only client can unsubscribe notification for the Anchor. 
8notification subscription for same dataspace or anchor using different subscription ids. subscription ids will be updated in attributes field (future scope) for similar subscriptions. 
9when a new dataspace or anchor addednotification will be disabled for newly created dataspace or anchor. 

Schema v/s non-schema persistence

...