Add a FlowManagement Component
[oam.git] / solution / smo / apps / flows / data / flows.json
1 [
2     {
3         "id": "51e83a0892da060e",
4         "type": "tab",
5         "label": "VES-Messages",
6         "disabled": false,
7         "info": "Sends a VES message with body defined by 3GPP TS 28.532.\n",
8         "env": []
9     },
10     {
11         "id": "7b2f4859e5963695",
12         "type": "tls-config",
13         "name": "",
14         "cert": "",
15         "key": "",
16         "ca": "",
17         "certname": "",
18         "keyname": "",
19         "caname": "",
20         "servername": "",
21         "verifyservercert": false,
22         "alpnprotocol": ""
23     },
24     {
25         "id": "91a1f8d3ce84ceda",
26         "type": "inject",
27         "z": "51e83a0892da060e",
28         "name": "notifyFileReady",
29         "props": [
30             {
31                 "p": "payload"
32             },
33             {
34                 "p": "topic",
35                 "vt": "str"
36             }
37         ],
38         "repeat": "",
39         "crontab": "",
40         "once": false,
41         "onceDelay": 0.1,
42         "topic": "notifyFileReady",
43         "payload": "",
44         "payloadType": "date",
45         "x": 120,
46         "y": 160,
47         "wires": [
48             [
49                 "b5533c10604af5a6",
50                 "f8e64d1cb25eb4ab"
51             ]
52         ]
53     },
54     {
55         "id": "b5533c10604af5a6",
56         "type": "function",
57         "z": "51e83a0892da060e",
58         "name": "vesHeader",
59         "func": "const timeStamp = new Date(msg.payload);\nconst eventType = msg.topic;\nlet domain = \"stndDefined\";\n// handle domain expecption for 'pnfRegistration'\nif (eventType === 'pnfRegistration') {\n    domain = eventType;\n} \nconst nfNamingCode = env.get('APP_NETWORK_FUNCTION_ID');\nconst namespaces = {\n    notifyHeartbeat: '3GPP-Heartbeat',\n    notifyFileReady: 'file-ready',\n    pnfRegistration: undefined\n};\n\nmsg.topic = \"commonEventHeader\"\nmsg.payload = {\n    domain: domain,\n    eventType: eventType,\n    eventId:[nfNamingCode, eventType, msg._msgid].join('_'),\n    eventName: [domain, eventType].join('_'),\n    sequence: Number(timeStamp),\n    priority: \"Low\",\n    reportingEntityId: \"c2b7d6e9-ee35-459a-ab8e-717a6fc1fde6\",\n    reportingEntityName: global.get('os').hostname(),\n    sourceId: \"378e9904-6d39-40ea-9994-0596fe2235a3\",\n    sourceName: env.get('APP_SOURCE'),\n    startEpochMicrosec: timeStamp.getTime() * 1000,\n    lastEpochMicrosec: timeStamp.getTime() * 1000,\n    nfNamingCode: nfNamingCode,\n    nfVendorName: env.get('APP_VENDOR'),\n    timeZoneOffset: \"+00:00\",\n    stndDefinedNamespace: namespaces[eventType],\n    version: \"4.1\",\n    vesEventListenerVersion: \"7.2.1\"\n}\nreturn msg;",
60         "outputs": 1,
61         "noerr": 0,
62         "initialize": "",
63         "finalize": "",
64         "libs": [],
65         "x": 350,
66         "y": 40,
67         "wires": [
68             [
69                 "f65b1c13e0243ef6"
70             ]
71         ]
72     },
73     {
74         "id": "f8e64d1cb25eb4ab",
75         "type": "function",
76         "z": "51e83a0892da060e",
77         "name": "vesStndDefindBody",
78         "func": "const timeStamp = new Date(msg.payload);\nconst startTime = new Date(Math.floor(Number(timeStamp) / 900000) * 900000);\nconst endTime = new Date(Number(startTime) + 900000);\nconst paddy = (num, padlen, padchar) => {\n    const pad_char = typeof padchar !== 'undefined' ? padchar : '0';\n    const pad = new Array(1 + padlen).join(pad_char);\n    return (pad + num).slice(-pad.length);\n}\nconst fileStartTime = [\n    paddy(startTime.getFullYear(), 4),\n    paddy(startTime.getMonth() + 1, 2),\n    paddy(startTime.getDate(), 2),\n    '.',\n    paddy(startTime.getHours(), 2),\n    paddy(startTime.getMinutes(), 2),\n    '+0000'\n].join('');\nconst fileEndTime = [\n    paddy(endTime.getHours(), 2),\n    paddy(endTime.getMinutes(), 2),\n    '+0000'\n].join('');\nconst fileLocation = ['/pm-data-files/A', fileStartTime, '-', fileEndTime, '_', env.get('APP_NETWORK_FUNCTION_ID'), '.xml'].join('');\nmsg.payload = {\n    schemaReference: 'https://forge.3gpp.org/rep/sa5/MnS/-/raw/Rel-16/OpenAPI/TS28532_FileDataReportingMnS.yaml#components/schemas/NotifyFileReady',\n    stndDefinedFieldsVersion: '1.0',\n    data: {\n        href: global.get('os').hostname(),\n        notificationId: Number(startTime),\n        notificationType: msg.topic,\n        eventTime: timeStamp.toISOString(),\n        systemDN: '/',\n        fileInfoList: [\n            {\n                fileLocation: fileLocation,\n                fileSize: 1234,\n                fileReadyTime: startTime.toISOString(),\n                fileExpirationTime: endTime.toISOString(),\n                fileCompression: 'no',\n                fileFormat: 'xml',\n                fileDataType: 'Performance'\n            }\n        ],\n        additionalText: 'Have fun!'\n    }\n};\nmsg.topic = 'stndDefinedFields';\nreturn msg;",
79         "outputs": 1,
80         "noerr": 0,
81         "initialize": "",
82         "finalize": "",
83         "libs": [],
84         "x": 370,
85         "y": 160,
86         "wires": [
87             [
88                 "f65b1c13e0243ef6"
89             ]
90         ]
91     },
92     {
93         "id": "f65b1c13e0243ef6",
94         "type": "join",
95         "z": "51e83a0892da060e",
96         "name": "",
97         "mode": "custom",
98         "build": "object",
99         "property": "payload",
100         "propertyType": "msg",
101         "key": "topic",
102         "joiner": "\\n",
103         "joinerType": "str",
104         "accumulate": false,
105         "timeout": "",
106         "count": "2",
107         "reduceRight": false,
108         "reduceExp": "",
109         "reduceInit": "",
110         "reduceInitType": "",
111         "reduceFixup": "",
112         "x": 550,
113         "y": 120,
114         "wires": [
115             [
116                 "1d6949a57bce82ab"
117             ]
118         ]
119     },
120     {
121         "id": "1d6949a57bce82ab",
122         "type": "function",
123         "z": "51e83a0892da060e",
124         "name": "createVesEvent",
125         "func": "msg.payload = {\n  event: msg.payload\n};\nreturn msg;",
126         "outputs": 1,
127         "noerr": 0,
128         "initialize": "",
129         "finalize": "",
130         "libs": [],
131         "x": 720,
132         "y": 120,
133         "wires": [
134             [
135                 "27e1d8d1e9b8fd93",
136                 "9ab2b4d9caf52c14"
137             ]
138         ]
139     },
140     {
141         "id": "27e1d8d1e9b8fd93",
142         "type": "http request",
143         "z": "51e83a0892da060e",
144         "name": "",
145         "method": "POST",
146         "ret": "txt",
147         "paytoqs": "ignore",
148         "url": "https://ves-collector.oam.smo.o-ran-sc.org/eventListener/v7",
149         "tls": "7b2f4859e5963695",
150         "persist": false,
151         "proxy": "",
152         "insecureHTTPParser": false,
153         "authType": "basic",
154         "senderr": false,
155         "headers": [],
156         "x": 910,
157         "y": 120,
158         "wires": [
159             [
160                 "f3412bcb9e134063"
161             ]
162         ]
163     },
164     {
165         "id": "f3412bcb9e134063",
166         "type": "debug",
167         "z": "51e83a0892da060e",
168         "name": "VesCollectorResponse",
169         "active": true,
170         "tosidebar": true,
171         "console": false,
172         "tostatus": false,
173         "complete": "payload",
174         "targetType": "msg",
175         "statusVal": "",
176         "statusType": "auto",
177         "x": 1120,
178         "y": 120,
179         "wires": []
180     },
181     {
182         "id": "b5e1e7a83051b5b6",
183         "type": "inject",
184         "z": "51e83a0892da060e",
185         "name": "pnfRegistration",
186         "props": [
187             {
188                 "p": "payload"
189             },
190             {
191                 "p": "topic",
192                 "vt": "str"
193             }
194         ],
195         "repeat": "",
196         "crontab": "",
197         "once": false,
198         "onceDelay": 0.1,
199         "topic": "pnfRegistration",
200         "payload": "",
201         "payloadType": "date",
202         "x": 120,
203         "y": 80,
204         "wires": [
205             [
206                 "bd43459cf3907a5a",
207                 "b5533c10604af5a6"
208             ]
209         ]
210     },
211     {
212         "id": "bd43459cf3907a5a",
213         "type": "function",
214         "z": "51e83a0892da060e",
215         "name": "vesBody",
216         "func": "msg.topic = 'pnfRegistrationFields';\nmsg.payload = {\n    pnfRegistrationFieldsVersion: '2.1',\n    lastServiceDate: '2023-02-05',\n    macAddress: '02:42:f7:d4:62:ce',\n    manufactureDate: '2021-01-16',\n    modelNumber: 'O-RAN-SC Model',\n    oamV4IpAddress: '10.10.10.11',\n    oamV6IpAddress: '0:0:0:0:0:ffff:a0a:011',\n    serialNumber: 'VENDORA-PNF2-10.10.10.11-pnf2 BestInClass',\n    softwareVersion: '2.3.5',\n    unitFamily: \"O-RAN-SC\",\n    unitType: 'PNF2',\n    vendorName: env.get('APP_VENDOR'),\n    additionalFields: {\n        oamPort: '830',\n        protocol: 'SSH',\n        username: 'netconf',\n        password: 'netconf!',\n        reconnectOnChangedSchema: 'false',\n        'sleep-factor': '1.5',\n    tcpOnly: 'false',\n    connectionTimeout: '20000',\n    maxConnectionAttempts: '100',\n    betweenAttemptsTimeout: '2000',\n    keepaliveDelay: '120'\n}\n};\nreturn msg;",
217         "outputs": 1,
218         "noerr": 0,
219         "initialize": "",
220         "finalize": "",
221         "libs": [],
222         "x": 340,
223         "y": 80,
224         "wires": [
225             [
226                 "f65b1c13e0243ef6"
227             ]
228         ]
229     },
230     {
231         "id": "9ab2b4d9caf52c14",
232         "type": "debug",
233         "z": "51e83a0892da060e",
234         "name": "ves-message-data",
235         "active": false,
236         "tosidebar": true,
237         "console": false,
238         "tostatus": false,
239         "complete": "payload",
240         "targetType": "msg",
241         "statusVal": "",
242         "statusType": "auto",
243         "x": 930,
244         "y": 160,
245         "wires": []
246     },
247     {
248         "id": "7d589030272c0a94",
249         "type": "inject",
250         "z": "51e83a0892da060e",
251         "name": "notifyHeartbeat",
252         "props": [
253             {
254                 "p": "payload"
255             },
256             {
257                 "p": "topic",
258                 "vt": "str"
259             }
260         ],
261         "repeat": "",
262         "crontab": "",
263         "once": false,
264         "onceDelay": 0.1,
265         "topic": "notifyHeartbeat",
266         "payload": "",
267         "payloadType": "date",
268         "x": 120,
269         "y": 120,
270         "wires": [
271             [
272                 "b5533c10604af5a6",
273                 "ab3bc53f12d28d8f"
274             ]
275         ]
276     },
277     {
278         "id": "ab3bc53f12d28d8f",
279         "type": "function",
280         "z": "51e83a0892da060e",
281         "name": "vesStndDefindBody",
282         "func": "const timeStamp = new Date(msg.payload);\nmsg.payload = {\n    schemaReference: 'https://forge.3gpp.org/rep/sa5/MnS/-/raw/Rel-16/OpenAPI/TS28532_HeartbeatNtf.yaml#components/schemas/NotifyHeartbeat',\n    stndDefinedFieldsVersion: '1.0',\n    data: {\n        href: global.get('os').hostname(),\n        notificationId: Number(timeStamp),\n        notificationType: msg.topic,\n        eventTime: timeStamp.toISOString(),\n        systemDN: \"/\",\n        heartbeatNtfPeriod: 120\n    }\n};\nmsg.topic = \"stndDefinedFields\";\nreturn msg;",
283         "outputs": 1,
284         "noerr": 0,
285         "initialize": "",
286         "finalize": "",
287         "libs": [],
288         "x": 370,
289         "y": 120,
290         "wires": [
291             [
292                 "f65b1c13e0243ef6"
293             ]
294         ]
295     }
296 ]