Document env variables or docker-compose
[oam/nf-oam-adopter.git] / docs / pm / index.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. SPDX-License-Identifier: CC-BY-4.0
3 .. Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
4
5 ===============
6 PM REST Manager
7 ===============
8
9 PM REST Manager library follows `VES Event Listener 7.1 <https://docs.onap.org/projects/onap-vnfrqts-requirements/en/latest/Chapter8/ves7_1spec.html#>`_
10
11 PM VES Message
12 --------------
13
14 **Datatype: commonEventHeader**
15
16 .. list-table::
17    :header-rows: 1
18
19    * - Field
20      - Mandatory
21      - Default value
22      - Configurable
23      - Runtime
24      - Notes
25    * - domain
26      - yes
27      - measurement
28      - no
29      - no
30      - none
31    * - eventId
32      - yes
33      - none
34      - yes
35      - yes
36      - Unique id generated from combination of multiple fields, selection of fields configurable via mapping config file.
37    * - eventName
38      - yes
39      - PM Notification
40      - yes
41      - yes
42      - value configurable via mapping config file.
43    * - priority
44      - yes
45      - HIGH
46      - yes
47      - no
48      - value configurable via mapping config file.
49    * - reportingEntityName
50      - yes
51      - NF-OAM-ADOPTER
52      - yes
53      - yes
54      - value configurable via mapping config file.
55    * - startEpochMicrosec
56      - yes
57      - none
58      - none
59      - yes
60      - System time at the moment of notification generation
61    * - lastEpochMicrosec
62      - yes
63      - none
64      - none
65      - yes
66      - System time at the moment of notification generation
67    * - sequence
68      - yes
69      - none
70      - no
71      - yes
72      - incremental per line on csv file. Each file will start processing will start from sequence 0.
73    * - sourceName
74      - yes
75      - none
76      - yes
77      - yes
78      - value configurable via mapping config file.
79    * - version
80      - yes
81      - 4.1
82      - no
83      - no
84      - Library only enforces mandatory fields for 4.1 version
85    * - vesEventListenerVersion
86      - yes
87      - 7.1
88      - no
89      - no
90      - Library only enforces mandatory fields for 7.1 version
91    * - eventType
92      - no
93      - none
94      - no
95      - no
96      - none
97    * - nfcNamingCode
98      - no
99      - none
100      - no
101      - no
102      - none
103    * - nfNamingCode
104      - no
105      - none
106      - no
107      - no
108      - none
109    * - nfVendorName
110      - no
111      - SOME-VENDOR
112      - yes
113      - no
114      - value configurable via mapping config file.
115    * - reportingEntityId
116      - no
117      - ONAP-NF-OAM-SOME-VENDOR-ADAPTER
118      - yes
119      - no
120      - value configurable via mapping config file.
121    * - internalHeader Fields
122      - no
123      - none
124      - no
125      - no
126      - none
127    * - sourceId
128      - no
129      - none
130      - none
131      - no
132      - none
133    * - timeZoneOffset
134      - no
135      - none
136      - no
137      - no
138      - none
139
140
141 **Datatype: measurementFields**
142
143 .. list-table::
144    :header-rows: 1
145
146    * - Field
147      - Mandatory
148      - Default value
149      - Configurable
150      - Runtime
151      - Notes
152    * - additionalFields
153      - no
154      - none
155      - yes
156      - yes
157      - values configurable via mapping config file.
158    * - additionalMeasurements
159      - yes
160      - none
161      - yes
162      - yes
163      - values configurable via mapping config file.
164    * - measurementInterval
165      - yes
166      - none
167      - yes
168      - no
169      - value configurable via mapping config file.
170    * - measurementFieldsVersion
171      - yes
172      - 4.0
173      - no
174      - no
175      - none
176
177 REST PM Configuration
178 ---------------------
179
180 **Rest Adapter configuration**
181
182 Configuration file **application.yml** contains global definitions required to be consumed by PM REST adapters services.
183
184 - **synchronization-time-start** Defines the time for execution of pull of PM files and forwarding as VES Message
185 - **synchronization-time-frequency** Define the frequency to trigger the pull and forward of PM data after first execution.
186 - **mapping-config-path** Defines the path where mapping configuration file is located
187
188 **Rest SB Client Adapter configuration**
189
190 - **ran-token-endpoint** Defines rand endpoint from where token will be obtained
191 - **ran-pm-endpoint:** Defines rand endpoint from where ZIP with PM files will be GET.
192 - **ran-time-zone-offset-endpoint** Defines rand endpoint from where we GET the timezone from the device.
193
194 .. literalinclude:: pm-rest-manager.yaml
195   :language: YAML
196
197 Mapping Configuration
198 ---------------------
199
200 Configuration file **pm-ves-message-mapping.yaml** contains all definitions required to define the mapping
201 from ZIP file with collection of csv files information to VES Message format
202
203 .. note::
204    File name can be changed as long it matches with configured **mapping-config-path** and file is in yaml format
205
206 - **reporting-entity-name** Reporting entity name assigned to the event
207 - **reporting-entity-id** Reporting entity id assigned to the event
208 - **nf-vendor-name** Vendor name assigned to the event
209 - **event-source-type** Source type assigned to the event
210 - **event-name** Event name assigned to the event
211 - **measurement-interval** Interval over which measurements are being reported in seconds
212 - **priority** Priority assigned to the event
213
214 - **CSV**
215     - **source-name** Column names containing containing information
216     - **source-name-regex** The regular expression to which source-name string value is to be matched and removed
217     - **event-id** Collection of columns names to generate an uniqueID
218     - **additional-fields** Collection of columns names containing information to be attached
219     - **additional-measurements-name** Name assigned to AdditionalMeasurement array
220     - **additional-measurements** Collection of columns names containing information to be attached
221     - **batch-size** File will be processed and send in small batches event notifications. Size define the number of events which will contain each notification
222
223 .. literalinclude:: pm-ves-message-mapping.yaml
224   :language: YAML
225
226 PM Adapter Configuration
227 ------------------------
228
229 PM Adapters can be instantiated at runtime
230
231 **Create a PM Adapter**
232
233 **POST** ``https://<SERVICE_IP>:<SERVICE_PORT>/adapters/adapter``
234
235 .. literalinclude:: create-adapter.json
236   :language: JSON
237
238 **Get PM Adapters**
239
240 **GET** ``https://<SERVICE_IP>:<SERVICE_PORT>/adapters/``
241
242 .. literalinclude:: get-adapters.json
243   :language: JSON
244
245
246 **Delete PM Adapter**
247
248 **DELETE** ``https://<SERVICE_IP>:<SERVICE_PORT>/adapters/adapter/10.53.40.50``