Versions Compared

Key

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

Table of Contents

References

Jira Legacy
serverSystem Jira
columnIdsissuekey,summary,issuetype,created,updated,duedate,assignee,reporter,priority,status,resolution
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId4733707d-2057-3a0f-ae5e-4fd8aff50176
keyCPS-1616

...

Jira Legacy
serverSystem Jira
serverId4733707d-2057-3a0f-ae5e-4fd8aff50176
keyCPS-1776

Jira Legacy
serverSystem Jira
serverId4733707d-2057-3a0f-ae5e-4fd8aff50176
keyCPS-2251

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

1Delete use case works for a valid ongoing subscription only.

2Works only for the passthrough datastores.


Issues & Decisions

topic subscription
 
id generated by client
source "SCO-9989752"
specversion  "1.0"
type subscriptionDeleted
time
dataschema When do we actually delete the subscription from CPS DB ? We

#

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

2What do we need to send to the DMI Plugin so that they are able to decide that how to delete the ongoing subscription.
  1. subscription name + client id
  2. + cmhandle ids?
  3. + cmhandle properties?
  4. + datastore?
3The subscription delete request

  We are sending cmHandle information and predicates information ( datastore , xpaths and cmHandle ) and private cmHandle properties.

 kieran mccarthy  Agree

3Who 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.


4DME 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.

5Do we send additional properties from NCMP to DMIAre additional properties needed to delete the subscription

Overview

  1. We receive an event of type : subscriptionDeleted from the client ( DME ) containing the subscription clientId and subscription name along with datastore and dataCategory details ( DMEtoNCMP )
  2. We check in NCMP that we have an ongoing subscription using clientId and subscriptionName.
  3. If we have ongoing subscription , we forward the event to dmi-plugins so that the changes are applied in the devices managed by dmi-plugin as well. ( Impl. Proposal CM Event Subscription LCM: Delete )
  4. Now if the dmi-plugins have applied the request then we get an event back from dmi-plugin and NCMP will process that event and based on that it will delete the ongoing subscription request from the database itself. If the response from DMI plugins is accepted ( i.e it can delete the subscriptions from the underlying devices and no subscription delete request are in PENDING or REJECTED state )Then we delete the subscriptions from the DB as well. ( Impl. Proposal CM Event Subscription LCM: Delete )
  5. After processing the received event from DMI , NCMP will send the final event to the client (DME). (  Impl. Proposal CM Event Subscription LCM: Delete )

Subscription Delete Sequence Diagram

DME to NCMP

Subscription Delete Event

  We are sending additional/private properties as of now.

 kieran mccarthy  Agree

6Can 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




  1. Capture Incoming subscriptionId from the client.
  2. Query the existing subscriptions we are tracking using the subscriptionId we got from the Cm Subscription Delete request.
  3. 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.
  4. Now check if the details we have are ALL the last subscribers or not.
    1. 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.
    2. 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 
  5. 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 )
  6. 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





Schema Definitions

  1. DME to NCMP Cm Subscription Delete Request


    Name

    Parent

    Type

    Example

    Mandatory ?

    Notes

    1idheaderString
    Y
    2versionheaderString 1.0Y
    3

    source

    headerStringDMEY
    4

    type

    headerStringsubscriptionDeleteRequestY
    5

    dataschema

    headerURIorg.onap.ncmp.cm.subscription:1.0.0Y

...


  1. 6

...

  1. data


    Object
    Y
    7

    subscriptionId

    dataStringcm-subscription-001

...

            }

}
 
"javaType": "org.onap.cps.ncmp.events.avcsubscription1_0_0.client_to_ncmp"

NCMP to DMI-Plugins

...

  1. Y
    8

    predicates

    dataObject
    N


    Example

    Code Block
    titleDME to NCMP Cm Subscription Delete Request
    linenumberstrue
    collapsetrue
    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
    }



  2. NCMP to DMI-Plugin Subscription Request


    Name

    Parent

    Type

    Example

    Mandatory ?

    Notes

    1idheaderString
    Y
    2versionheaderString 1.0Y
    3

    source

    headerStringNCMPY
    4

    type

    headerStringsubscriptionDeleteRequestY
    5

    dataschema

    headerURIorg.onap.ncmp.dmi.cm.subscription:1.0.0Y
    6

    correlationid

    headerStringsubscriptionId#dmiPluginNameYConcatenation of subscriptionId and dmi plugin name
    7

    data


    Object
    Y
    8

    cmHandles

    dataArray
    Y
    9

    cmhandleId

    cmHandlesString
    Y
    10

    privateProperties

    cmHandlesMap
    N
    11

    predicates

    dataArray
    N
    12

    targetFilter

    predicatesArray of String
    Ylist of cm handle ids
    13

    scopeFilter

    predicatesObject
    N
    14

    datastore

    scopeFilterString
    Yncmp-datastore:passthrough-operational OR ncmp-datastore:passthrough-running 
    15

    xpathFilter

    scopeFilterArray of String
    Y


    Example

    Code Block
    titleNCMP to DMI-Plugin Subscription Request
    linenumberstrue
    collapsetrue
    id : random UUID
    version : 1.0
    source : "NCMP"
    type : "subscriptionDeleteRequest"
    dataschema : org.onap.ncmp.dmi.cm.subscription:1.0.0

...

  1. 
    correlationId ( concatenation of subscriptionId and dmi-plugin-name with a separator)
     
    {
      "data":

...

DMI-Plugins to NCMP

...

  1.  {
        "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  *
          }
        }
      ]
    }



  2. DMI-Plugin to NCMP Cm Subscription Delete Response


    Name

    Parent

    Type

    Example

    Mandatory ?

    Notes

    1idheaderString
    Y
    2versionheaderString 1.0Y
    3

    source

    headerStringDMEY
    4

    type

    headerStringsubscriptionDeleteResponseY
    5

    dataschema

    headerURIorg.onap.ncmp.dmi.cm.subscription:1.0.0

...

  1. Y

...

Notes

  1. dmiName in Output Schema is populated from application.yml of DMI-plugin.
  2. 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 DME

Produced by NCMP to send it to the Client-Apps

...


  1. 6

    correlationid

    headerStringsubscriptionId#dmiPluginNameYConcatenation of subscriptionId and dmi plugin name
    7

    data


    Object
    Y
    8

    statusCode

    dataString
    Y1 - Accept the subscription request
    104 - Reject the subscription request
    9

    statusMessage

    dataString
    Y

    ACCEPTED

    REJECTED


    Example

    Code Block
    titleDMI-Plugin to NCMP Cm Subscription Delete Response
    linenumberstrue
    collapsetrue
    id : random UUID
    version : "1.0"
    source : <dmi-plugin-name>
    type : "subcriptionDeleteResponse"
    dataschema : org.onap.ncmp.dmi.cm.subscription:1.0.0

...

  1. 
    correlationid : ( concatenation of subscriptionId and dmi-plugin-name with a separator)
    {
    "data" :

...

DB Logic for subscription delete handling forwarding

  1. NCMP receives a subscription delete request
  2. IF subscription exists
    1. Set last operation enum to delete

CMHANDLE1:

CMHandle2:

CMHandle3:

DB Logic for subscription delete handling

  1. NCMP receives subscription delete response from DMI Plugins
  2. NCMP checks the existing create subscription object in db
    1. If cmhandle is accepted, delete cmhandle is pending
    2. If cmhandle is rejected, delete cmhandle is rejected with message like "create subscription was rejected originally"
    3. If cmhandle is pending, delete cmhandle is rejected with message like "create subscription for cmhandle is pending" 
  3. NCMP persists subscription delete in db
  4. NCMP forwards subscription delete to the pending delete operation cmhandle's dmi plugins.
  5. NCMP listens for DMI responses and updates subscription delete in db
    1. If all respond then send NCMP to ClientApp response
    2. If not all respond then send response after 30 seconds
  6. Check if subscription create and subscription delete match states for all cmhandles then the subscriptions can be deleted from the db
  7. If Delete is requested again by client apps

    Create StateDelete StateNCMP action1AcceptedAcceptedNothing2AcceptedRejectedDelete for that cmhandle once3AcceptedPendingDelete for that cmhandle once4RejectedRejectedNothing5PendingRejectedNothing
    See step 5.
     {
       "statusCode": "1/104",  // mandatory
       "statusMessage" : "ACCEPTED/REJECTED" // mandatory
     }
    }



  8. NCMP to DME Cm Subscription Delete Response


    Name

    Parent

    Type

    Example

    Mandatory ?

    Notes

    1idheaderString
    Y
    2versionheaderString 1.0Y
    3

    source

    headerStringDMEY
    4

    type

    headerStringsubscriptionDeleteResponseY
    5

    dataschema

    headerURIorg.onap.ncmp.cm.subscription:1.0.0Y
    6

    correlationid

    headerStringsubscriptionIdY
    7

    data


    Object
    Y
    8

    subscriptionId

    dataString
    Y
    9

    acceptedTargets

    dataArray of String
    N
    10

    rejectedTargets

    dataArray of String
    N
    11

    pendingTargets

    dataArray of String
    N


    Example

    Code Block
    titleNCMP to DME Cm Subscription Delete Response
    linenumberstrue
    collapsetrue
    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
      }
    }