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