Table of Contents
References
...
Jira server ONAP Jira columnIds issuekey,summary,issuetype,created,updated,duedate,assignee,reporter,priority,status,resolution columns key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution serverId 425b2b0a-557c-3c0c-b515-579789cceedb key CPS-1616
CM Data Notification Subscription LCM (incl. merge)
Impl. Proposal CM Event Subscription LCM: Create
Jira | ||||||
---|---|---|---|---|---|---|
|
Jira | ||||||
---|---|---|---|---|---|---|
|
Out-of-scope
- Working with wildcards and subscription update which will be taken care by a separate epic.
- Subscription create ( done as part of a different story )
- Merging of the ongoing subscriptions.
Assumptions
# | Issue | Notes | Decisions |
---|---|---|---|
1 | The whole subscription event is deletedDelete use case works for a valid ongoing subscription only. | ||
2 | Works only for the passthrough datastores. |
Issues & Decisions
# | Issue | Notes | Decisions |
---|---|---|---|
1 | Delete the subscription from the database? | We plan to do it when we receive response from the DMI plugins and the underlying subscriptions from the devices are deleted. | kieran mccarthy Agree |
2 | What do we need to send to the DMI Plugin so that they are able to decide that how to delete the ongoing subscription. | We are sending cmHandle information and predicates information ( datastore , xpaths and cmHandle ) and private cmHandle properties. | kieran mccarthy Agree |
3 | Who should be able to retry and make sure the subscriptions are deleted from the respective DMIs managing the devices. | kieran mccarthy The agenda for the next meeting. We can decide then. More on the "DELETING" stage ( if we want to have it ) | kieran mccarthy As discussed on , The DME should be able to maintain Subscription State and make decision when to retry based on the response outcome we provide to it for create and/or delete use cases. |
4 |
|
Overview
DME to NCMP Event to have targets and datastore-xpath-filter information for the subscription delete use case ? | DME to only send the subscription id inorder to delete the request. NCMP will figure out the details corresponding to the provided subscription id and figure out what to request to DMI Plugin for deletion. | kieran mccarthy As per the discussion today we agreed to use targets , datastore-xpath-filters and datastores for the subscription delete use case. Revised approach is mentioned in the Notes section. | |
5 | Do we send additional properties from NCMP to DMI | We are sending additional/private properties as of now. | kieran mccarthy Agree |
6 | Can the DMI Plugin REJECT the Cm Subscription Delete Request ? | kieran mccarthy Wanted to check if this is the VALID use case we have ? | kieran mccarthy Yes it may be rejected or indicate partial failure. If one or more of the underlying data producers (node/ems) is disconnected for some reason then the request cannot be fulfilled. The client should be notified of the failure.
|
Algorithm for CM Subscription Delete
PlantUML Macro | ||
---|---|---|
| ||
@startuml
'https://plantuml.com/activity-diagram-beta
start
: DME to send Cm Subscription Delete Request;
: NCMP to extract out subscriptionId;
: using subscriptionId , Query all the ONGOING ACTIVE Cm Subscriptions;
: Populate details in Cm Notification Subscription Cache;
if (all the Subscription predicates are part of other ongoing Subscriptions ) then (YES)
: directly delete the subscriptionId from the ongoing subscribers list from DB;
: mark the subscription delete request as ACCEPTED in the cache;
: respond back to the client with ACCEPTED ;
else (NO)
: for all the 'last lights out' predicate information call the DMI Plugin;
if (DMI Plugin accepts the delete request) then (YES)
: using the information present in cmNotificationSubscriptionCache, delete the records from DB;
: mark the subscription delete request as ACCEPTED in the cache;
: respond back to the client with ACCEPTED;
else (NO)
: dont delete any records from DB;
: mark the subscription delete request as REJECTED in the cache;
: respond back to the client with REJECTED;
endif
endif
: cleanup the cache;
stop
@enduml
|
- Capture Incoming subscriptionId from the client.
- Query the existing subscriptions we are tracking using the subscriptionId we got from the Cm Subscription Delete request.
- Populate the cmSubscriptionCache with the relevant details ( this will be later used to send the response and manage the subscription ) using the above query we did.
- Now check if the details we have are ALL the last subscribers or not.
- if all are NOT the last subscribers then we can right away delete it from the DB and send back the response to the client without sending any request to the DMI.
- if we have mixed records then we need to make a call to the DMI for the "last lights out" to get Acceptance from DMI
- if DMI accepts it , then whatever we have in the cache can be used to DELETE the rows from the DB ( similar to what we did for create )
- Once the rows are deleted then we can send back the response to the client and clear up the cache ( for ACCEPTED/REJECTED )
Subscription Delete Sequence Diagram
PlantUML Macro | ||||
---|---|---|---|---|
| ||||
@startuml
autonumber
participant DME
participant NCMP
participant "CPS-DB"
participant "DMI-PLUGIN"
DME --> NCMP : 'Request to delete the CmSubscription using subscriptionId'
NCMP --> NCMP : 'Check if the CmSubscription is fully shared or exclusive per DMI'
NCMP --> "DMI-PLUGIN" : 'for exclusive CmSubscription(part of the subscription) notify the "DMI-PLUGIN"s to ACCEPT/REJECT the subscription'
"DMI-PLUGIN" --> NCMP : 'Request ACCEPTED by "DMI-PLUGIN"'
NCMP --> "CPS-DB" : 'Delete the CmSubscription from the database and update the cache with ACCEPTED'
NCMP --> DME : 'Respond with the status as ACCEPTED'
@enduml |
PlantUML Macro | ||||
---|---|---|---|---|
| ||||
@startuml
autonumber
participant DME
participant NCMP
participant "CPS-DB"
DME --> NCMP : 'Request to Delete the CmSubscription using subscriptionId' | ||||
PlantUML Macro | ||||
| ||||
@startuml "Subsciption Delete" participant CLIENT participant NCMP participant DMI_PLUGIN CLIENT -> NCMP: 1. Incoming subscriptionDelete event NCMP -> DMI_PLUGIN: 2. ncmp to forward event to dmi plugin DMI_PLUGIN -> DMI_PLUGIN: 3. Apply the requested event and respond with the status DMI_PLUGIN --> NCMP: 4. Status of the subscriptionDelete request whether accepted/rejected/pending NCMP --> NCMP : 5. If all accepted then only remove the subcription data from DB 'Check if the CmSubscription is fully SHARED or EXCLUSIVE per DMI' NCMP --> NCMP : 'for SHARED CmSubscription dont notify the "DMI-PLUGIN"s' NCMP --> "CPS-DB" CLIENT: 'Delete 6.the RespondCmSubscription withfrom the statusdatabase thatand weupdate receivedthe fromcache dmiwith plugin ACCEPTED' NCMP --> DME : 'Respond with the status as ACCEPTED' @enduml |
Schema Definitions
...
DME to NCMP
...
Subscription Delete Event (Schema 1)
...
Cm Subscription Delete Request
Name
Parent
Type
Example
Mandatory ? Notes
1 id header String Y 2 version header String 1.0 Y 3 source
header String DME Y 4 type
header String subscriptionDeleteRequest Y 5 dataschema
header URI
org.onap.ncmp.cm.subscription:1.0.0 Y 6 data
Object Y
...
7
...
subscriptionId
...
data
...
String
cm-subscription-001
...
}
"javaType"
:
"org.onap.cps.ncmp.events.avcsubscription1_0_0.client_to_ncmp"
// Show input and output schema
// Any logic if we want to discuss and make decision
NCMP to DMI-Plugins
Input Schema (Schema 3) - Produced by NCMP and Consumed by DMI Plugins
...
Y 8 predicates
data Object N
ExampleCode Block title DME to NCMP Cm Subscription Delete Request linenumbers true collapse true id : random-UUID version : "1.0" source : "DME" type : "subscriptionDeleteRequest", dataschema : org.onap.ncmp.cm.subscription:1.0.0 { "data": { "subscriptionId": "unique subscription id" // mandatory }
NCMP to DMI-Plugin Subscription Request
Name
Parent
Type
Example
Mandatory ? Notes
1 id header String Y 2 version header String 1.0 Y 3 source
header String NCMP Y 4 type
header String subscriptionDeleteRequest Y 5 dataschema
header URI
DMI-Plugins to NCMP
...
org.onap.ncmp.dmi.cm.subscription:1.0.0 Y 6 correlationid
header String subscriptionId#dmiPluginName Y Concatenation of subscriptionId and dmi plugin name 7 data
Object Y 8 cmHandles
data
...
Array Y 9 cmhandleId
cmHandles String Y 10 privateProperties
cmHandles Map N 11 predicates
data Array N 12 targetFilter
predicates Array of String Y list of cm handle ids 13 scopeFilter
predicates Object N 14 datastore
scopeFilter String Y ncmp-datastore:passthrough-operational OR ncmp-datastore:passthrough-running 15 xpathFilter
scopeFilter Array of String Y
ExampleCode Block title NCMP to DMI-Plugin Subscription Request linenumbers true collapse true id : random UUID version : 1.0 source : "NCMP" type : "subscriptionDeleteRequest" dataschema : org.onap.ncmp.dmi.cm.subscription:1.0.0 correlationId ( concatenation of subscriptionId and dmi-plugin-name with a separator) { "data": { "cmhandles" : [ // mandatory { "cmHandleId": "cmhandle1", "private-properties": {...} }, { "cmHandleId": "cmhandle2", "private-properties": {...} }, { "cmHandleId": "cmhandle3", "private-properties": {...} } ] "predicates": [ { “targetFilter” : [“cmHandle1”, “cmHandle2”, "cmhandle3"], // mandatory "scopeFilter" : { "datastore": “ncmp-datastore:passthrough-operational or ncmp-datastore:passthrough-running", // optional. default is passthrough-operational "xpath-filter": list of valid xpaths // mandatory } }, { “targetFilter” : [“cmHandle1”, “cmHandle2”, "cmhandle3"], "scopeFilter" : { "datastore": “ncmp-datastore:passthrough-operational or ncmp-datastore:passthrough-running", // optional. default is passthrough-operational "xpath-filter": list of valid xpaths * } } ] }
DMI-Plugin to NCMP Cm Subscription Delete Response
Name
Parent
Type
Example
Mandatory ? Notes
1 id header String Y 2 version header String 1.0 Y 3 source
header String DME Y 4 type
header String subscriptionDeleteResponse Y 5 dataschema
header URI
...
org.onap.ncmp.dmi.cm.subscription:1.0.0 Y 6 correlationid
header String subscriptionId#dmiPluginName Y Concatenation of subscriptionId and dmi plugin name 7 data
...
Notes
- dmiName in Output Schema is populated from application.yml of DMI-plugin.
- DMI-plugin subscribes to the topic to consume Input Schema given in application.yml of DMI-plugin.
...
dmi:
service:
name: ${DMI_SERVICE_NAME:ncmp-dmi-plugin}
app:
dmi:
avc:
subscription-topic: ${DMI_CM_AVC_SUBSCRIPTION:ncmp-dmi-cm-avc-subscription-${dmi.service.name}}
NCMP to Client-Apps
Proposed outcome (Schema 5)
...
Object Y 8 statusCode
data String Y 1 - Accept the subscription request
104 - Reject the subscription request9 statusMessage
data String Y ACCEPTED
REJECTED
ExampleCode Block title DMI-Plugin to NCMP Cm Subscription Delete Response linenumbers true collapse true id : random UUID version : "1.0" source : <dmi-plugin-name> type : "subcriptionDeleteResponse" dataschema : org.onap.ncmp.dmi.cm.subscription:1.0.0 correlationid : ( concatenation of subscriptionId and dmi-plugin-name with a separator) { "data" : { "statusCode": "1/104", // mandatory "statusMessage" : "ACCEPTED/REJECTED" // mandatory } }
NCMP to DME Cm Subscription Delete Response
Name
Parent
Type
Example
Mandatory ? Notes
1 id header String Y 2 version header String 1.0 Y 3 source
header String DME Y 4 type
header String subscriptionDeleteResponse Y 5 dataschema
header URI
org.onap.ncmp.cm.subscription:1.0.0 Y 6 correlationid
header String subscriptionId Y 7 data
Object Y
...
8
...
subscriptionId
...
data String Y 9 acceptedTargets
data Array of String N 10 rejectedTargets
data Array of String N 11 pendingTargets
data Array of String N
ExampleCode Block title NCMP to DME Cm Subscription Delete Response linenumbers true collapse true id : random UUID version : "1.0" source : "NCMP" type : "subcriptionDeleteResponse", dataschema : org.onap.ncmp.cm.subscription:1.0.0, correlationid : <subscriptionId> { "data": { "subscriptionId": "sample-subscription-id", // mandatory "acceptedTargets" : ["ch-1", ...], // optional "rejectedTargets" : ["ch-1", ...], // optional "pendingTargets" : ["ch-1", ...], // optional } }