aboutsummaryrefslogtreecommitdiffstats
path: root/docs/cps-events.rst
blob: df37de36321f3bcf69196a14e28cbee8d86ccedc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
.. This work is licensed under a Creative Commons Attribution 4.0 International License.
.. http://creativecommons.org/licenses/by/4.0
.. Copyright (C) 2022 Nordix Foundation

.. DO NOT CHANGE THIS LABEL FOR RELEASE NOTES - EVEN THOUGH IT GIVES A WARNING
.. _cpsEvents:

CPS Events
##########

CPS-NCMP
********

Async events are triggered when a valid topic has been detected in a passthrough operation.

:download:`NCMP request response event schema <schemas/ncmp-async-request-response-event-schema-v1.json>`

Event header
^^^^^^^^^^^^^

.. code-block:: json

    {
        "eventId"               : "001",
        "eventCorrelationId"    : "cps-001",
        "eventTime"             : "2022-09-28T12:24:21.003+0000",
        "eventTarget"           : "test-topic",
        "eventType"             : "org.onap.cps.ncmp.event.model.DmiAsyncRequestResponseEvent",
        "eventSchema"           : "urn:cps:org.onap.cps.ncmp.event.model.DmiAsyncRequestResponseEvent:v1",
        "forwarded-Event"       : { ... }
    }

Forwarded-Event Payload
^^^^^^^^^^^^^^^^^^^^^^^

.. code-block:: json

    "Forwarded-Event": {
        "eventId"               : "002",
        "eventCorrelationId"    : "cps-001",
        "eventTime"             : "2022-09-28T12:24:18.340+0000",
        "eventTarget"           : "test-topic",
        "eventType"             : "org.onap.cps.ncmp.event.model.DmiAsyncRequestResponseEvent",
        "eventSchema"           : "urn:cps:org.onap.cps.ncmp.event.model.DmiAsyncRequestResponseEvent:v1",
        "eventSource"           : "org.onap.cps.ncmp.dmi",
        "response-data-schema"  : "urn:cps:org.onap.cps.ncmp.event.model.DmiAsyncRequestResponseEvent:v1",
        "response-status"       : "OK",
        "response-code"         : "200",
        "response-data"         : { ... }
    }


Lifecycle Management (LCM) Event
================================


Overview
--------
LCM events for CM Handles are published when a CM Handle is created, deleted or another change in the cm handle state occurs.

  **3 possible event types:**

  * Create
  * Update
  * Delete

LCM Event Schema
----------------
The current published LCM event is based on the following schema:

:download:`Life cycle management event schema <schemas/lcm-event-schema-v1.json>`

LCM Event structure
-------------------

Events header
^^^^^^^^^^^^^
*Event header prototype for all event types*

.. code-block:: json

  {
      "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": ....
  }

Events payload
^^^^^^^^^^^^^^
Event payload varies based on the type of event.

**CREATE**

Event payload for this event contains the properties of the new cm handle created.

*Create event payload prototype*

.. code-block:: json

  "event": {
         "cmHandleId" : "cmhandle-001",
         "newValues" : {
             "cmHandleState"  : "ADVISED",
             "dataSyncEnabled" : "TRUE",
             "cmhandleProperties" : [
                          "prop1" : "val1",
                          "prop2" : "val2"
                ]
            }
       }
   }


**UPDATE**

Event payload for this event contains the difference in state and properties of the cm handle.

*Update event payload prototype*

.. code-block:: json

  "event": {
         "cmHandleId" : "cmhandle-001",
         "oldValues" : {
                 "cmHandleState"  : "ADVISED",
                 "dataSyncEnabled" : "FALSE",
                 "cmhandleProperties" : [
                          "prop1" : "val1",
                          "prop2" : "val2",
              }
          "newValues" : {
             "cmHandleState"  : "READY",
             "dataSyncEnabled" : "TRUE",
             "cmhandleProperties" : [
                          "prop1" : "updatedval1",
                          "prop2" : "updatedval2"
                   ]
            }
       }
   }


**DELETE**

Event payload for this event contains the identifier of the deleted cm handle.

*Delete event payload prototype*

.. code-block:: json

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