You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 25 Next »

Objective

As of current implementation in cps core, after the update operation, entire configuration is sent as Kafka Notification. we are proposing to send only changed configuration as delta report in notification. It will help to understand what configuration exactly changed for the anchor. 

Issues & Decisions

#IssueNotesDecision
1Do we need to update existing update notification to send delta notification or delta notification along with existing notification. 
29-Sep-2023: We decided to implement delta notification separately without changing the existing update notification. 
2Using Liquibase v. Yang Model for storing new metadata per anchor in CPS CoreNeeds discussions with architects
3generic text field OK for future refinement, maybe consider json?

Event Schema

proposal for notification schema:

Cloud event Definition


Element

Name

Parent

Type

Mandatory

Description

Format

(example) Value

1Headerid
StringYesrandom id for cloud event header. UUID is suggested

2source
StringYessource of informationfixed valueurn:cps:org.onap.cps
3specversion
StringYescloud event version specfixed value1.0
4type
StringYestype of eventfixed valuedataUpdateEvent
5dataschema
StringYesdata schemafixed valuecps:org.onap.cps:data-updated-event-schema:1.0.0
6Payloaddata
ObjectYesThe actual data payload. Details will be provided below.

7observedTimestampdataStringYesThe timespamp of the event. timestamp2024-01-17 12:34:43
8dataspaceNamedataStringYesThe dataspace name where data is changed.
dataspace01
9schemaSetNamedataStringNoThe schemaset name for which data is changed.
bookstore
10anchorNamedataStringYesThe anchor name for which data is changed.
anchor01
11operationdataStringYesThe operation performed on data. 

CREATE

UPDATE

DELETE


12xpathdataStringYesThe XPath which is changed 
/bookstore


Controlling Notification

 It is important to control the delta notification for better performance. we need to decide on below options to control delta notification.

OptionPros and Cons Decision
Send delta notification for the update operation when update request contains optional query parameter to receive notification. 

Pros:

  1. Dynamically control notification and per request level. 

Cons: 

  1. there could be issue with access control

Configure dataspace/anchor in yaml file to allow delta notification.

Pros:

  1. Only allowed dataspace/anchor's delta update will be sent in notification

Cons:

  1. Not practical because we can't control the notification dynamically.  

while creating dataspace/anchor, configure to send delta notification. 

Pros: 

  1. control the notification dynamically.

Cons:

  1. Need to persist notification information in DB. 
We decided to try this approach. detailed implementation provided below. 


Implementation of controlling delta notification 

Delta notification can be enabled/disabled by an additional admin API for a given anchor name. By default, delta notification will be disabled for all dataspaces. 

New API will be added as below.


API :  PUT https://IP:PORT/cps/api/v2/dataspace/<dataspace-name>/deltanotification/<subscribe or unsubscribe>


To Persist the information about delta notification there are two approached proposed as below for consideration. 


  1. Persist delta notification information in additional field of dataspace table.

Additional field will be added to Anchor table to persist delta notification subscription. newly added field details are as below.  



Updated TableDataspace
new field name notification
typetext
example true (string). change later. 

2.  Add schema for notification subscription and add subscription information in to Fragment table when delta notification is subscribed. delete the fragment when delta notification is unsubscribed.

below actions will be performed when delta notification will be subscribed for the dataspace.  

  • schema set will be added to the dataspace when notification is subscribed.
  • An Anchor will be added to dataspace for notification subscription.
  • Subscription data will be added into fragment as per schema set. 

schema yaml file to be used as below. 

delta-notification.yaml
module notifications {
    yang-version 1.1;
    namespace "org:onap:ccsdk:sample";

    prefix delta-notification;

    revision "2024-01-10" {
        description
        "Sample Model";
    }
	container deltanotification {

        leaf notification-subscription {
            type string;
        }
	}
}

Implementation details of delta notification

  1. For data nodes update operation, generate delta report by comparing previous and current configuration after successful update. 
  2.  Process data update delta event and send notification as described in event schema above. 
  • No labels