...
Algorithm for CM Subscription Delete ( TBD )
- 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.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 )
...
DME to NCMP 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 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 DME Y 4 type
header String subscriptionDeleteRequest 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
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
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 } }
...