Overview

CPS-1142 - Getting issue details... STATUS

  • Each Cm-Handle state change triggers a LCM event notification sent to the user to notify about the state change.
  • When a Cm-Handle is registered it will initially be set in an 'ADVISED' state.
  • If the module sync watchdog operation starts to work on an 'ADVISED' Cm-Handle, the Cm-Handle state will transition to 'READY' or 'LOCKED' based on if the module-sync has succeeded or failed respectively.
  • If the module sync watchdog operation is successful, data-sync-enabled will be set to false and the data sync-state will be 'NONE_REQUESTED'.
  • If the user wants to set data-sync-enabled to true, it has to be enabled on its dedicated API endpoint.
  • Once data sync-enabled is set to true, the data sync-state will be set to 'UNSYNCHRONIZED'.
  • Only the handles with an 'UNSYNCHRONIZED' data sync-state will be picked up by the data-sync watchdog operation.
  • If the data-sync watchdog was able to complete the sync successfully then the dataStoreSync state will changed to SYNCHRONIZED.
  • If the handles are to be deleted during update, then their states will be set to 'DELETING'. Once deletion is complete, the state is set to 'DELETED'.

Diagram of the possible transactions between CM-Handle states

CPS-799 Spike: Define states and state handling for CM handle

Notification details

Notification handling in code

LcmEvents in code

The Event structure of the notification

Event schema

LcmEvent Scema (cps-ncmp-events)
{

  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "$id": "urn:cps:org.onap.ncmp.cmhandle.lcm-event:v1",

  "$ref": "#/definitions/LcmEvent",

  "definitions": {

    "Values": {
      "description": "Values that represents the state of a cmHandle",
      "type": "object",
      "properties": {
        "dataSyncEnabled":{
          "description": "Whether data sync enabled",
          "type": "boolean"
        },
        "cmHandleState": {
          "description": "State of cmHandle",
          "type": "string",
          "enum": ["ADVISED", "READY", "LOCKED", "DELETING", "DELETED"]
        },
        "cmHandleProperties": {
          "description": "cmHandle properties",
          "type": "object",
          "default": null,
          "existingJavaType": "java.util.List<java.util.Map<String,String>>",
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },

    "Event": {
      "description": "The Payload of an event",
      "type": "object",
      "properties": {
        "cmHandleId": {
          "description": "cmHandle id",
          "type": "string"
        },
        "oldValues": {
          "$ref": "#/definitions/Values"
        },
        "newValues": {
          "$ref": "#/definitions/Values"
        }
      },
      "required": [
        "cmHandleId"
      ],
      "additionalProperties": false
    },

    "LcmEvent": {
      "description": "The payload for LCM event",
      "type": "object",
      "javaType" : "org.onap.ncmp.cmhandle.event.lcm.LcmEvent",
      "properties": {
        "eventId": {
          "description": "The unique id identifying the event",
          "type": "string"
        },
        "eventCorrelationId": {
          "description": "The id identifying the event",
          "type": "string"
        },
        "eventTime": {
          "description": "The timestamp when original event occurred",
          "type": "string"
        },
        "eventSource": {
          "description": "The source of the event",
          "type": "string"
        },
        "eventType": {
          "description": "The type of the event",
          "type": "string"
        },
        "eventSchema": {
          "description": "The schema that this event adheres to",
          "type": "string"
        },
        "eventSchemaVersion": {
          "description": "The version of the schema that this event adheres to",
          "type": "string"
        },
        "event": {
          "$ref": "#/definitions/Event"
        }
      },
      "required": [
        "eventId",
        "eventCorrelationId",
        "eventTime",
        "eventSource",
        "eventType",
        "eventSchema",
        "eventSchemaVersion",
        "event"
      ],
      "additionalProperties": false
    }

  }
}


Event examples

CPS-1104 Agree LCM Event schemas

Create Event
{
  "eventId"               : "00001",    
  "eventCorrelationId     : "cmhandle-001"      
  "eventTime"             : "2021-11-16T16:42:25-04:00",
  "eventSource"           : "org.onap.ncmp",                                 
  "eventType"             : "org.onap.ncmp.cmhandle-lcm-event.create",   
  ”eventSchema”           : “org.onap.ncmp:cmhandle-lcm-event",  
  "eventSchemaVersion"    : "1.0" 

  "event": {
         “cmHandleId” : “cmhandle-001”,
         "newValues" : {                      # include ALL cmhandle metadata attributes in newValues section
             “cmHandleState”  : “ADVISED”, 
             “dataSyncEnabled” : “TRUE”,
             “cmhandleProperties” : [
                          “someProperty-1” : “Initial property value 1”,
                          “someProperty-2” : “Initial property value 2”
                   ]
         }   
    }
}
Update Event
{
  "eventId"                : "00001",    
  "eventCorrelationId      : "cmhandle-001"      
  "eventTime"              : "2021-11-16T16:42:25-04:00",
  "eventSource"            : "org.onap.ncmp",                                 
  "eventType"              : "org.onap.ncmp.cmhandle-lcm-event.update",   
  ”eventSchema”            : “org.onap.ncmp:cmhandle-lcm-event", 
  "eventSchemaVersion"    : "1.0"  
  
  "event": {
         “cmHandleId” : “cmhandle-001”
         "oldValues" : {
    			 “cmHandleState”  : “ADVISED”,
                 “dataSyncEnabled” : “FALSE”, 
                 “cmhandleProperties” : [
                          “someProperty-0” : “ This property will be updated”,
                          “someProperty-1” : “ This property will be deleted”,
              }
          "newValues" : {
	    	 “cmHandleState”  : “READY”,
             “dataSyncEnabled” : “TRUE”,  
             “cmhandleProperties” : [
                          “someProperty-0” : “ This property has been updated”,
                          “someProperty-2” : “ This property is newly added to the cmhandle”
                   ]
           }   
       ]
    }
}

Delete Event
{
  "eventId"                : "00001",    
  "eventCorrelationId      : "cmhandle-001",       
  "eventTime"              : "2021-11-16T16:42:25-04:00",
  "eventSource"            : "org.onap.ncmp",                                 
  "eventType"              : "org.onap.ncmp.cmhandle-lcm-event.delete",   
  ”eventSchema”            : “org.onap.ncmp:cmhandle-lcm-event",  
  "eventSchemaVersion"    : "1.0"   
     
  "event": {
        “cmHandleId” : “cmhandle-001”    
  }
}

Typical use cases which leads to state changes and trigger notification events

State changes after new cm Handle is registered

State change use case diagram

State changes after cm Handle update received

Cm handle state changes after update

State changes during module-sync watchdog execution

State changes in watchdog

State changes during data-sync watchdog execution

data-sync Watchdog related state changes

Source materials

Important links to related Spikes and Implementation proposals

  • No labels