Add delta report in cps notification
Objective
we want to include delta report which gets generated after any update in data nodes in cps notification messages. as of now we have only xpath of the updated node in notification messages.
Notification message schema
Element | Name | Parent | Type | Mandatory | Description | Format | (example) Value | |
---|---|---|---|---|---|---|---|---|
1 | Header | id |
| String | Yes | random id for cloud event header. UUID is suggested |
|
|
2 | source |
| String | Yes | source of information | fixed value | urn:cps:org.onap.cps | |
3 | specversion |
| String | Yes | cloud event version spec | fixed value | 1.0 | |
4 | type |
| String | Yes | type of event | fixed value | dataUpdateEvent | |
5 | dataschema |
| String | Yes | data schema | fixed value | cps:org.onap.cps:data-updated-event-schema:1.0.0 | |
6 | Payload | data |
| Object | Yes | The actual data payload. Details will be provided below. |
|
|
7 | observedTimestamp | data | String | Yes | The timespamp of the event. | timestamp | 2024-01-17 12:34:43 | |
8 | dataspaceName | data | String | Yes | The dataspace name where data is changed. |
| dataspace01 | |
9 | schemaSetName | data | String | No | The schemaset name for which data is changed. |
| bookstore | |
10 | anchorName | data | String | Yes | The anchor name for which data is changed. |
| anchor01 | |
11 | operation | data | String | Yes | The operation performed on data. | CREATE UPDATE DELETE |
| |
12 | xpath | data | String | Yes | The XPath which is changed |
| /bookstore | |
13 |
| updatedData | data | String | No | The changed data in the update operation |
| {
"action": "replace",
"xpath": "/bookstore/categories/[@code=2]",
"source-data": {
"name": "Funny"
},
"target-data": {
"name": "Comic"
}
} |
Enable/Disable delta notification
We want to control the delta in notification using the environment variable in cps core application. a new environment variable will be added in cps-application as below to enable/disable updated delta in cps notification
app.cps.data-updated.delta-notification: ${CPS_DELTA_NOTIFICATION_ENABLEDQ:true}