References

Issues & Decisions

#Issue

Notes

Decisions

1Use "Generic" Detail-fields or or more specific fields

kieran mccarthy prefer to use specific terms like 'orginalState' instead of generic 'details'

2how many event schema's for different events will there be?

e.g. 1 schema for state change, 1 other schema for public properties?
OR
a single schema with some fields not always of the used/compulsory

Need to discuss with kieran mccarthy 

One single schema for all cmhandle LCM events : org.onap.ncmp:cmhandle-lcm-event:v1

3what is the best term to use for change events 'original', 'previous' or something elseTeam found term 'original' confusing and prefers 'previous' e.g. previousStateuse 'oldValues' and 'newValues'.  See analysis below.
4Should public properties be part of (same) structure as stateTeam feels state and properties are very different and should not be combined into same structure
This also depends on open issue #2
Agreed at team meeting that all cmhandle metadata attributes to be managed in the same manner whether that is state or properties.
5Should the schema version be separate from 'eventSchema'?

The event schema is defined like this : org.onap.ncmp:cmhandle-lcm-event:v1 where version is at the end of the schema string.  It would be better to split the schema version into its own header field.  e.g.

”eventSchema”               : “org.onap.ncmp:cmhandle-lcm-event",   
”eventSchemaVersion”   : “v1.0",   

Toine Siebelink Can we split the schema version into its own field or is it a standard way to reference schema versions like the way CPS do it for their events (at least I think this is what they do?) like this : 'org.onap.ncmp:cmhandle-lcm-event:v1'

    

//priyank : Agreed to use the specified format in the notes in LCM Schema and also create a user story to handle the async schema on similar grounds.

6Mentioning the mandatory and optional fields in our schemas.

Mandatory(M) and Optional(O)

Schema Sample : 


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

  "event": {
         “cmHandleId” : “cmhandle-001”,(M)
         "newValues" : {                     (O)
             “cmHandleState”  : “READY”,    (O)
             “dataSyncEnabled” : “TRUE”,     (O)
             “cmhandleProperties” : [        (O)
                          “someProperty-1” : “Initial property value 1”, (O)
                          “someProperty-2” : “Initial property value 2”  (O)
                   ]
         }   
    }
}

kieran mccarthy  Please correct if something is wrong.

[kieran]  This looks good - the given eventSource may change but the format is fine.

7Agree on the topic name where the events need to be published.

Previously we configured the topic name as "ncmp-events" , but since now we are calling these events as LcmEvents , I was wondering if the topic should reflect the same.

Toine Siebelink  suggested "ncmp-lcm-events" as an alternative name.

kieran mccarthy Tony Finnerty  your thoughts on this ? 

Priyank Maheshwari There is no reason to separate cm data events from these lcm events.  They are all ncmp events and the consumer may determine the nature of the event from eventType/eventSchema.  Sugegst to send them on ncmp-events topic.

8How will the DELETING event look like ? 
It should be same as UPDATE event or some other handling is needed?
DELETING 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”  : “READY”
              }
          "newValues" : {
	    	     “cmHandleState”  : “DELETING”,
           }   
       ]
    }
}


I just had this doubt and wanted to clarify.

kieran mccarthy  Toine Siebelink  Tony Finnerty 


//priyank It will behave the same as update event. we discussed and clarified.

Priyank Maheshwari The cmhandle LOCKED state should also be reflected in the event on the left (but ONLY if cmhandle LOCKED support is already implemented)

Overview

This page is for deciding the structure of the proposed "detail" section which needs to be introduced in the NcmpEvent payload.
Refer : CPS-858 Define Notifications on CM Handle Add (Ready) & Delete  #8

Purpose : Additional field(s) to store information about the previous state.

Current Schema

Current NcmpSchema
{
  "eventId"                : "00001",    
  "eventCorrelationId      : "cmhandle-001",       
  "eventTime"              : "2021-11-16T16:42:25-04:00",
  "eventSource"            : "org.onap.ncmp",                                 
  "eventType"              : "org.onap.ncmp.cmhandle-lcm-event",   
  ”eventSchema”            : “org.onap.ncmp:cmhandle-lcm-event:v1",   

  "event": {
      “cmHandleState”    : “READY”,
      "cmHandleId"       : "cmhandle-001",
      “cmhandle-properties” : [
          {“public-property-name-1” : “public-property-value-1”},
          {“public-property-name-2” : “public-property-value-2”}     
       ]
    }
}

Proposed events

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”    
  }
}
 

  • No labels

5 Comments

  1. Hi Priyank Maheshwari,

    Perhaps something like this can accommodate future additions to the event? 
    It really depends on what we want from "detail"  -  should not use that tag by the way as it adds little value to indicate the contents of the node.
    We can review/discuss in an meeting when it suits. 

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

      "event": {
          "cmHandleId" : "cmhandle-001",

          “cmHandleState”     : “READY”,
          “cmhandle-properties” : [
               {“public-property-name-1” : “public-property-value-1”},
               {“public-property-name-2” : “public-property-value-2”}     
          ]
         "originalState" : {  
              “cmHandleState”     : “ADVISED”,
              “cmhandle-properties” : [                    #  greyed out to indicate it may be added in the future
                    {“public-property-name-1” : “public-property--original-value-1”},
                    {“public-property-name-2” : “public-property-original-value-2”}     
              ]
          }
       }
    }

  2. Updated the Create, Update and Delete event proposals under Proposed Events section

  3. Updated the proposed event(examples) with our latest discussion to keep separate eventSchema and eventSchemaVersion.

  4. Hi Priyank Maheshwari
    FYI : Toine Siebelink Tony Finnerty 

    I see the in the LCM event schema defined in the recent code submit https://gerrit.onap.org/r/c/cps/+/129895/3/cps-ncmp-events/src/main/resources/schemas/lcm-event-schema-v1.json#18

    the id is set to the following  : 

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

    Perhaps we need to take a discussion on schemas and schema naming and versioning but I see the id is set to 

    "urn:cps:org.onap.ncmp.cmhandle.lcm-event:v1".  I see the version is included in the id.  We agreed to seperate the schema version from the schema name.

    should it be part of the id in this case?  

    Best Regards

    Kieran



  5. kieran mccarthy 

    The below $schema and $id that you pointed out is something internal information for the plugin ( jsonschema2pojo-maven-plugin ) that we use to generate java classes from json schema.

    The actual eventSchema and eventSchemaVersion will be something coming from the code as we agreed. (See line#80 and #84 of the schema)

    eventSchemaorg.onap.ncmp:cmhandle-lcm-event

    eventSchemaVersion: v1