Versions Compared

Key

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

...

RFC 8641 : Subscription to YANG Notifications for Datastore Updates

Extract from RFC 8641 :

3.5.2 On-Change Subscriptions
A publisher indicates the type of change to a datastore node using the different YANG Patch operations: the "create" operation is used for newly created objects (except entries in a user-ordered list), the "delete" operation is used for deleted objects (including in user-ordered lists), the "replace" operation is used when only the object value changes, the "insert" operation is used when a new entry is inserted in a list, and the "move" operation is used when an existing entry in a user-ordered list is moved. However, a patch must be able to do more than just describe the delta from the previous state to the current state. As per Section 3.3, it must also be able to identify whether transient changes have occurred on an object during a dampening period. To support this, it is valid to encode a YANG Patch operation so that its application would result in no change between the previous state and the current state. This indicates that some churn has occurred on the object. An example of this would be a patch that indicates a "create" operation for a datastore node where the receiver believes one already exists or a "replace" operation that replaces a previous value with the same value. Note that this means that the "create" and "delete" errors as described in [RFC8072], Section 2.5 are not errors in the case of YANG-Push (i.e., they are considered valid operations for YANG-Push).

module: ietf-yang-push

     rpcs:
       +---x resync-subscription {on-change}?
          +---w input
             +---w id    sn:subscription-id

     yang-data (for placement into RPC error responses):
       +-- resync-subscription-error
       |  +--ro reason?                   identityref
       |  +--ro period-hint?              centiseconds
       |  +--ro filter-failure-hint?      string
       |  +--ro object-count-estimate?    uint32
       |  +--ro object-count-limit?       uint32
       |  +--ro kilobytes-estimate?       uint32
       |  +--ro kilobytes-limit?          uint32
       +-- establish-subscription-error-datastore
       |  +--ro reason?                   identityref
       |  +--ro period-hint?              centiseconds
       |  +--ro filter-failure-hint?      string
       |  +--ro object-count-estimate?    uint32
       |  +--ro object-count-limit?       uint32
       |  +--ro kilobytes-estimate?       uint32
       |  +--ro kilobytes-limit?          uint32
       +-- modify-subscription-error-datastore
          +--ro reason?                   identityref
          +--ro period-hint?              centiseconds
          +--ro filter-failure-hint?      string
          +--ro object-count-estimate?    uint32
          +--ro object-count-limit?       uint32
          +--ro kilobytes-estimate?       uint32
          +--ro kilobytes-limit?          uint32
       notifications:
          +---n push-update
          |  +--ro id?                   sn:subscription-id
          |  +--ro datastore-contents?   <anydata>
          |  +--ro incomplete-update?    empty
          +---n push-change-update {on-change}?
             +--ro id?                   sn:subscription-id
             +--ro datastore-changes
             |  +--ro yang-patch
             |     +--ro patch-id    string
             |     +--ro comment?    string
             |     +--ro edit* [edit-id]
             |        +--ro edit-id      string
             |        +--ro operation    enumeration
             |        +--ro target       target-resource-offset
             |        +--ro point?       target-resource-offset
             |        +--ro where?       enumeration
             |        +--ro value?       <anydata>
             +--ro incomplete-update?    empty

Alternatives 

Alternative event headers include

...

Alt #2 Based on current CPS event

{
  "schema": "org.onap.ncmp:cmhandle-lcm-event-schema:v1",
  "id": "77b8f114-4562-4069-8234-6d059ff742ac",
  "source": "org.onap.ncmp",
  "type": "org.onap.ncmp.cmhandle-lcm-event",
  "content": {
     "observedTimestamp": "2020-12-01T00:00:00.000+0000",  # time of received REST registration request
     "cmhandleId": "43t345tbnfd85435"
     "operation" : "CREATE",
     "data" : {

           <event body>

      }

}


 Contents of event body based on RFC 8641 with Alt #1 header

{

 "eventId": "00001",

 "eventTime": "2015-11-16T16:42:25-04:00",

 "eventType": "org.onap.ncmp.CmHandleCreateEvent",
 "eventSource": "org.onap.ncmp", # ??? Is this needed?
 "event": {

      "ietf-yang-push:push-change-update" : {

         "id" : "349839",

         "datastore-changes" : {
             "ietf-yang-patch:yang-patch" : {
                 "patch-id" : "34534ffd98",  # Some unreadable patch id generated by the machine 
                 "edit" : [
                    {
                      "edit-id" : "ded43434-1",
                      "operation" : "create",
                      "target" : "/cmhandle=111222333",
                      "value" : {
                           "state" : {
                               "cmhandleState" : "ADVISED"
                           }
                      }
                  ]
            }
      }

}

Proposal Details

Scope covers the Create, Update and Delete of CM Handles.

...