blob: a28d4b05299ae932eb06965ca57089af0c0852e8 [file] [log] [blame]
emaclee41121982022-07-28 06:52:39 +01001.. This work is licensed under a Creative Commons Attribution 4.0 International License.
2.. http://creativecommons.org/licenses/by/4.0
3.. Copyright (C) 2022 Nordix Foundation
4
5.. DO NOT CHANGE THIS LABEL FOR RELEASE NOTES - EVEN THOUGH IT GIVES A WARNING
6.. _cpsEvents:
7
8CPS Events
9##########
10
11CPS Core
12********
13..
14 Cps core events yet to be written
15
16
17CPS-NCMP
18********
19
20Lifecycle Management (LCM) Event
21================================
22
23
24Overview
25--------
26Lifecycle management events are published as cm handle state transitions from one state to another.
27
28
29LCM events and state handler
30----------------------------
31The LCM events are triggered under the state handler which has the following responsibilities:
32
33#. Updating and persisting cm handle state based on the target state of the cm handle
34
35#. Create and calls to publish the LCM event based on the cm handle state transition that occured
36
37 **3 possible event types:**
38
39 * Create
40 * Update
41 * Delete
42
43
44
45LCM Event Schema
46----------------
47The current published LCM event is based on the following schema:
48
49:download:`Life cycle management event schema <schemas/lcm-event-schema-v1.json>`
50
51LCM Event structure
52-------------------
53
54Events header
55^^^^^^^^^^^^^
56*Event header prototype for all event types*
57
58.. code-block:: json
59
60 {
61 "eventId" : "00001",
62 "eventCorrelationId : "cmhandle-001",
63 "eventTime" : "2021-11-16T16:42:25-04:00",
64 "eventSource" : "org.onap.ncmp",
65 "eventType" : "org.onap.ncmp.cmhandle-lcm-event.create",
66 "eventSchema" : "org.onap.ncmp:cmhandle-lcm-event",
67 "eventSchemaVersion" : "1.0"
68 "event": ....
69 }
70
71Events payload
72^^^^^^^^^^^^^^
73Event payload varies based on the type of event.
74
75**CREATE**
76
77Event payload for this event contains the properties of the new cm handle created.
78
79*Create event payload prototype*
80
81.. code-block:: json
82
83 "event": {
84 "cmHandleId" : "cmhandle-001",
85 "newValues" : {
86 "cmHandleState" : "ADVISED",
87 "dataSyncEnabled" : "TRUE",
88 "cmhandleProperties" : [
89 "prop1" : "val1",
90 "prop2" : "val2"
91 ]
92 }
93 }
94 }
95
96
97**UPDATE**
98
99Event payload for this event contains the difference in state and properties of the cm handle.
100
101*Update event payload prototype*
102
103.. code-block:: json
104
105 "event": {
106 "cmHandleId" : "cmhandle-001",
107 "oldValues" : {
108 "cmHandleState" : "ADVISED",
109 "dataSyncEnabled" : "FALSE",
110 "cmhandleProperties" : [
111 "prop1" : "val1",
112 "prop2" : "val2",
113 }
114 "newValues" : {
115 "cmHandleState" : "READY",
116 "dataSyncEnabled" : "TRUE",
117 "cmhandleProperties" : [
118 "prop1" : "updatedval1",
119 "prop2" : "updatedval2"
120 ]
121 }
122 }
123 }
124
125
126**DELETE**
127
128Event payload for this event contains the identifier of the deleted cm handle.
129
130*Delete event payload prototype*
131
132.. code-block:: json
133
134 "event": {
135 "cmHandleId" : "cmhandle-001",
136 }
137
138