[OAM-264] Fix renamed paths in README.md for smo-deployment
[it/dep.git] / smo-install / test / pythonsdk / src / oransdk / policy / templates / commission_apex.json.j2
1 {
2   "data_types": {
3     "onap.datatype.controlloop.Target": {
4       "derived_from": "tosca.datatypes.Root",
5       "properties": {
6         "targetType": {
7           "required": true,
8           "constraints": [
9             {
10               "valid_values": [
11                 "VNF","VM","VFMODULE","PNF"]
12             }],
13           "description": "Category for the target type",
14           "type": "string"
15         },
16         "entityIds": {
17           "required": false,
18           "metadata": {
19             "clamp_possible_values": "ClampExecution:CSAR_RESOURCES"
20           },
21           "entry_schema": {
22             "type": "string"
23           },
24           "description": "Map of values that identify the resource. If none are provided, it is assumed that the
25 entity that generated the ONSET event will be the target.
26 ",
27           "type": "map"
28         }
29       },
30       "description": "Definition for a entity in A&AI to perform a control loop operation on"
31     },
32     "onap.datatypes.ToscaConceptIdentifier": {
33       "derived_from": "tosca.datatypes.Root",
34       "properties": {
35         "version": {
36           "required": true,
37           "type": "string"
38         },
39         "name": {
40           "required": true,
41           "type": "string"
42         }
43       }
44     },
45     "onap.datatype.controlloop.Operation": {
46       "derived_from": "tosca.datatypes.Root",
47       "properties": {
48         "failure_guard": {
49           "required": false,
50           "default": "final_failure_guard",
51           "description": "Points to the operation to invoke when the current operation is blocked due to guard policy enforcement.",
52           "type": "string"
53         },
54         "retries": {
55           "required": true,
56           "default": 0,
57           "description": "The number of retries the actor should attempt to perform the operation.",
58           "type": "integer"
59         },
60         "success": {
61           "required": false,
62           "default": "final_success",
63           "description": "Points to the operation to invoke on success. A value of \"final_success\" indicates and end to the operation.",
64           "type": "string"
65         },
66         "description": {
67           "required": false,
68           "description": "A user-friendly description of the intent for the operation",
69           "type": "string"
70         },
71         "failure_retries": {
72           "required": false,
73           "default": "final_failure_retries",
74           "description": "Points to the operation to invoke when the current operation has exceeded its max retries.",
75           "type": "string"
76         },
77         "timeout": {
78           "required": true,
79           "description": "The amount of time for the actor to perform the operation.",
80           "type": "integer"
81         },
82         "failure": {
83           "required": false,
84           "default": "final_failure",
85           "description": "Points to the operation to invoke on Actor operation failure.",
86           "type": "string"
87         },
88         "id": {
89           "required": true,
90           "description": "Unique identifier for the operation",
91           "type": "string"
92         },
93         "failure_timeout": {
94           "required": false,
95           "default": "final_failure_timeout",
96           "description": "Points to the operation to invoke when the time out for the operation occurs.",
97           "type": "string"
98         },
99         "failure_exception": {
100           "required": false,
101           "default": "final_failure_exception",
102           "description": "Points to the operation to invoke when the current operation causes an exception.",
103           "type": "string"
104         },
105         "operation": {
106           "required": true,
107           "description": "The definition of the operation to be performed.",
108           "type": "onap.datatype.controlloop.Actor"
109         }
110       },
111       "description": "An operation supported by an actor"
112     },
113     "onap.datatype.controlloop.Actor": {
114       "derived_from": "tosca.datatypes.Root",
115       "properties": {
116         "payload": {
117           "required": false,
118           "metadata": {
119             "clamp_possible_values": "ClampExecution:CDS/payload"
120           },
121           "entry_schema": {
122             "type": "string"
123           },
124           "description": "Name/value pairs of payload information passed by Policy to the actor",
125           "type": "map"
126         },
127         "target": {
128           "required": true,
129           "description": "The resource the operation should be performed on.",
130           "type": "onap.datatype.controlloop.Target"
131         },
132         "operation": {
133           "required": true,
134           "metadata": {
135             "clamp_possible_values": "Dictionary:DefaultOperations,ClampExecution:CDS/operation"
136           },
137           "description": "The operation the actor is performing.",
138           "type": "string"
139         },
140         "actor": {
141           "required": true,
142           "metadata": {
143             "clamp_possible_values": "Dictionary:DefaultActors,ClampExecution:CDS/actor"
144           },
145           "description": "The actor performing the operation.",
146           "type": "string"
147         }
148       },
149       "description": "An actor/operation/target definition"
150     }
151   },
152   "topology_template": {
153     "policies": [
154       {
155         "operational.apex.linkmonitor": {
156           "properties": {
157             "eventInputParameters": {
158               "DMaaPConsumer": {
159                 "carrierTechnologyParameters": {
160                   "parameters": {
161                     "url": "http://message-router:3904/events/unauthenticated.SEC_FAULT_OUTPUT/{{dmaapGroup}}/{{dmaapUser}}?timeout=15000&limit=100"
162                   },
163                   "carrierTechnology": "RESTCLIENT",
164                   "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters"
165                 },
166                 "eventName": "LinkFailureInputEvent",
167                 "eventProtocolParameters": {
168                   "parameters": {
169                     "versionAlias": "version",
170                     "pojoField": "LinkFailureInput"
171                   },
172                   "eventProtocol": "JSON"
173                 }
174               }
175             },
176             "eventOutputParameters": {
177               "RestProducer": {
178                 "eventNameFilter": "LinkFailureOutputEvent",
179                 "carrierTechnologyParameters": {
180                   "parameters": {
181                     "url": "http://sdnc-oam:8282/rests/data/network-topology:network-topology/topology=topology-netconf/node={OduId}/yang-ext:mount/o-ran-sc-du-hello-world:network-function/distributed-unit-functions={OduId}/radio-resource-management-policy-ratio=rrm-pol-2",
182                     "httpMethod": "PUT",
183                     "httpHeaders": [
184                       [
185                         "Authorization","Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ=="]]
186                   },
187                   "carrierTechnology": "RESTCLIENT",
188                   "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters"
189                 },
190                 "eventProtocolParameters": {
191                   "parameters": {
192                     "pojoField": "LinkFailureOutput"
193                   },
194                   "eventProtocol": "JSON"
195                 }
196               },
197               "StdOutProducer": {
198                 "eventNameFilter": "ApexMessageOutputEvent",
199                 "carrierTechnologyParameters": {
200                   "parameters": {
201                     "standardIo": true
202                   },
203                   "carrierTechnology": "FILE"
204                 },
205                 "eventProtocolParameters": {
206                   "parameters": {
207                     "pojoField": "message"
208                   },
209                   "eventProtocol": "JSON"
210                 }
211               }
212             },
213             "engineServiceParameters": {
214               "policy_type_impl": {
215                 "apexPolicyModel": {
216                   "key": {
217                     "version": "0.0.1",
218                     "name": "LinkMonitorModel"
219                   },
220                   "policies": {
221                     "key": {
222                       "version": "0.0.1",
223                       "name": "LinkMonitorModel_Policies"
224                     },
225                     "policyMap": {
226                       "entry": [
227                         {
228                           "key": {
229                             "version": "0.0.1",
230                             "name": "LinkMonitorPolicy"
231                           },
232                           "value": {
233                             "template": "Freestyle",
234                             "policyKey": {
235                               "version": "0.0.1",
236                               "name": "LinkMonitorPolicy"
237                             },
238                             "state": {
239                               "entry": [
240                                 {
241                                   "key": "LinkClearedState",
242                                   "value": {
243                                     "defaultTask": {
244                                       "version": "0.0.1",
245                                       "name": "LinkClearedTask"
246                                     },
247                                     "stateOutputs": {
248                                       "entry": [
249                                         {
250                                           "key": "LinkClearedLogic_Output_Direct",
251                                           "value": {
252                                             "key": {
253                                               "parentKeyName": "LinkMonitorPolicy",
254                                               "parentKeyVersion": "0.0.1",
255                                               "parentLocalName": "LinkClearedState",
256                                               "localName": "LinkClearedLogic_Output_Direct"
257                                             },
258                                             "outgoingEvent": {
259                                               "version": "0.0.1",
260                                               "name": "ApexMessageOutputEvent"
261                                             },
262                                             "nextState": {
263                                               "parentKeyName": "NULL",
264                                               "parentKeyVersion": "0.0.0",
265                                               "parentLocalName": "NULL",
266                                               "localName": "NULL"
267                                             }
268                                           }
269                                         }]
270                                     },
271                                     "taskReferences": {
272                                       "entry": [
273                                         {
274                                           "key": {
275                                             "version": "0.0.1",
276                                             "name": "LinkClearedTask"
277                                           },
278                                           "value": {
279                                             "key": {
280                                               "parentKeyName": "LinkMonitorPolicy",
281                                               "parentKeyVersion": "0.0.1",
282                                               "parentLocalName": "LinkClearedState",
283                                               "localName": "LinkClearedTask"
284                                             },
285                                             "output": {
286                                               "parentKeyName": "LinkMonitorPolicy",
287                                               "parentKeyVersion": "0.0.1",
288                                               "parentLocalName": "LinkClearedState",
289                                               "localName": "LinkClearedLogic_Output_Direct"
290                                             },
291                                             "outputType": "DIRECT"
292                                           }
293                                         }]
294                                     },
295                                     "stateKey": {
296                                       "parentKeyName": "LinkMonitorPolicy",
297                                       "parentKeyVersion": "0.0.1",
298                                       "parentLocalName": "NULL",
299                                       "localName": "LinkClearedState"
300                                     },
301                                     "contextAlbumReference": [],
302                                     "stateFinalizerLogicMap": {
303                                       "entry": []
304                                     },
305                                     "taskSelectionLogic": {
306                                       "key": "NULL",
307                                       "logic": "",
308                                       "logicFlavour": "UNDEFINED"
309                                     },
310                                     "trigger": {
311                                       "version": "0.0.1",
312                                       "name": "CreateLinkClearedOutfieldsEvent"
313                                     }
314                                   }
315                                 },{
316                                   "key": "LinkFailureOrClearedState",
317                                   "value": {
318                                     "defaultTask": {
319                                       "version": "0.0.1",
320                                       "name": "NoPolicyDefinedTask"
321                                     },
322                                     "stateOutputs": {
323                                       "entry": [
324                                         {
325                                           "key": "CreateLinkClearedOutfieldsLogic_Output_Direct",
326                                           "value": {
327                                             "key": {
328                                               "parentKeyName": "LinkMonitorPolicy",
329                                               "parentKeyVersion": "0.0.1",
330                                               "parentLocalName": "LinkFailureOrClearedState",
331                                               "localName": "CreateLinkClearedOutfieldsLogic_Output_Direct"
332                                             },
333                                             "outgoingEvent": {
334                                               "version": "0.0.1",
335                                               "name": "CreateLinkClearedOutfieldsEvent"
336                                             },
337                                             "nextState": {
338                                               "parentKeyName": "LinkMonitorPolicy",
339                                               "parentKeyVersion": "0.0.1",
340                                               "parentLocalName": "NULL",
341                                               "localName": "LinkClearedState"
342                                             }
343                                           }
344                                         },{
345                                           "key": "CreateLinkFailureOutfieldsLogic_Output_Direct",
346                                           "value": {
347                                             "key": {
348                                               "parentKeyName": "LinkMonitorPolicy",
349                                               "parentKeyVersion": "0.0.1",
350                                               "parentLocalName": "LinkFailureOrClearedState",
351                                               "localName": "CreateLinkFailureOutfieldsLogic_Output_Direct"
352                                             },
353                                             "outgoingEvent": {
354                                               "version": "0.0.1",
355                                               "name": "CreateLinkFailureOutfieldsEvent"
356                                             },
357                                             "nextState": {
358                                               "parentKeyName": "LinkMonitorPolicy",
359                                               "parentKeyVersion": "0.0.1",
360                                               "parentLocalName": "NULL",
361                                               "localName": "LinkFailureState"
362                                             }
363                                           }
364                                         },{
365                                           "key": "NoPolicyDefinedLogic_Output_Direct",
366                                           "value": {
367                                             "key": {
368                                               "parentKeyName": "LinkMonitorPolicy",
369                                               "parentKeyVersion": "0.0.1",
370                                               "parentLocalName": "LinkFailureOrClearedState",
371                                               "localName": "NoPolicyDefinedLogic_Output_Direct"
372                                             },
373                                             "outgoingEvent": {
374                                               "version": "0.0.1",
375                                               "name": "ApexMessageOutputEvent"
376                                             },
377                                             "nextState": {
378                                               "parentKeyName": "NULL",
379                                               "parentKeyVersion": "0.0.0",
380                                               "parentLocalName": "NULL",
381                                               "localName": "NULL"
382                                             }
383                                           }
384                                         }]
385                                     },
386                                     "taskReferences": {
387                                       "entry": [
388                                         {
389                                           "key": {
390                                             "version": "0.0.1",
391                                             "name": "CreateLinkClearedOutfieldsTask"
392                                           },
393                                           "value": {
394                                             "key": {
395                                               "parentKeyName": "LinkMonitorPolicy",
396                                               "parentKeyVersion": "0.0.1",
397                                               "parentLocalName": "LinkFailureOrClearedState",
398                                               "localName": "CreateLinkClearedOutfieldsTask"
399                                             },
400                                             "output": {
401                                               "parentKeyName": "LinkMonitorPolicy",
402                                               "parentKeyVersion": "0.0.1",
403                                               "parentLocalName": "LinkFailureOrClearedState",
404                                               "localName": "CreateLinkClearedOutfieldsLogic_Output_Direct"
405                                             },
406                                             "outputType": "DIRECT"
407                                           }
408                                         },{
409                                           "key": {
410                                             "version": "0.0.1",
411                                             "name": "CreateLinkFailureOutfieldsTask"
412                                           },
413                                           "value": {
414                                             "key": {
415                                               "parentKeyName": "LinkMonitorPolicy",
416                                               "parentKeyVersion": "0.0.1",
417                                               "parentLocalName": "LinkFailureOrClearedState",
418                                               "localName": "CreateLinkFailureOutfieldsTask"
419                                             },
420                                             "output": {
421                                               "parentKeyName": "LinkMonitorPolicy",
422                                               "parentKeyVersion": "0.0.1",
423                                               "parentLocalName": "LinkFailureOrClearedState",
424                                               "localName": "CreateLinkFailureOutfieldsLogic_Output_Direct"
425                                             },
426                                             "outputType": "DIRECT"
427                                           }
428                                         },{
429                                           "key": {
430                                             "version": "0.0.1",
431                                             "name": "NoPolicyDefinedTask"
432                                           },
433                                           "value": {
434                                             "key": {
435                                               "parentKeyName": "LinkMonitorPolicy",
436                                               "parentKeyVersion": "0.0.1",
437                                               "parentLocalName": "LinkFailureOrClearedState",
438                                               "localName": "NoPolicyDefinedTask"
439                                             },
440                                             "output": {
441                                               "parentKeyName": "LinkMonitorPolicy",
442                                               "parentKeyVersion": "0.0.1",
443                                               "parentLocalName": "LinkFailureOrClearedState",
444                                               "localName": "NoPolicyDefinedLogic_Output_Direct"
445                                             },
446                                             "outputType": "DIRECT"
447                                           }
448                                         }]
449                                     },
450                                     "stateKey": {
451                                       "parentKeyName": "LinkMonitorPolicy",
452                                       "parentKeyVersion": "0.0.1",
453                                       "parentLocalName": "NULL",
454                                       "localName": "LinkFailureOrClearedState"
455                                     },
456                                     "contextAlbumReference": [],
457                                     "stateFinalizerLogicMap": {
458                                       "entry": []
459                                     },
460                                     "taskSelectionLogic": {
461                                       "key": "TaskSelectionLogic",
462                                       "logic": "/*
463  * ============LICENSE_START=======================================================
464  * Copyright (C) 2021 Nordix Foundation.
465  * ================================================================================
466  * Licensed under the Apache License, Version 2.0 (the \"License\");
467  * you may not use this file except in compliance with the License.
468  * You may obtain a copy of the License at
469  *
470  *      http://www.apache.org/licenses/LICENSE-2.0
471  *
472  * Unless required by applicable law or agreed to in writing, software
473  * distributed under the License is distributed on an \"AS IS\" BASIS,
474  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
475  * See the License for the specific language governing permissions and
476  * limitations under the License.
477  *
478  * SPDX-License-Identifier: Apache-2.0
479  * ============LICENSE_END=========================================================
480  */
481
482 executor.logger.info(\"Task Selection Execution: '\"+executor.subject.id+
483     \"'. InputFields: '\"+executor.inFields+\"'\");
484
485 var linkFailureInput = executor.inFields.get(\"LinkFailureInput\");
486 var commonEventHeader = linkFailureInput.get(\"event\").get(\"commonEventHeader\");
487 var domain = commonEventHeader.get(\"domain\");
488
489 taskFailure = executor.subject.getTaskKey(\"CreateLinkFailureOutfieldsTask\");
490 taskCleared = executor.subject.getTaskKey(\"CreateLinkClearedOutfieldsTask\");
491 taskDefault = executor.subject.getDefaultTaskKey();
492
493 if (domain == \"fault\") {
494     var faultFields = linkFailureInput.get(\"event\").get(\"faultFields\");
495     var alarmCondition = faultFields.get(\"alarmCondition\");
496     var eventSeverity = faultFields.get(\"eventSeverity\");
497     if (alarmCondition == \"28\" && eventSeverity != \"NORMAL\") {
498         taskFailure.copyTo(executor.selectedTask);
499     } else if (alarmCondition == \"28\" && eventSeverity == \"NORMAL\") {
500         taskCleared.copyTo(executor.selectedTask);
501     } else {
502         taskDefault.copyTo(executor.selectedTask);
503     }
504 } else {
505     taskDefault.copyTo(executor.selectedTask);
506 }
507
508 true;",
509                                       "logicFlavour": "JAVASCRIPT"
510                                     },
511                                     "trigger": {
512                                       "version": "0.0.1",
513                                       "name": "LinkFailureInputEvent"
514                                     }
515                                   }
516                                 },{
517                                   "key": "LinkFailureState",
518                                   "value": {
519                                     "defaultTask": {
520                                       "version": "0.0.1",
521                                       "name": "LinkFailureTask"
522                                     },
523                                     "stateOutputs": {
524                                       "entry": [
525                                         {
526                                           "key": "LinkFailureLogic_Output_Direct",
527                                           "value": {
528                                             "key": {
529                                               "parentKeyName": "LinkMonitorPolicy",
530                                               "parentKeyVersion": "0.0.1",
531                                               "parentLocalName": "LinkFailureState",
532                                               "localName": "LinkFailureLogic_Output_Direct"
533                                             },
534                                             "outgoingEvent": {
535                                               "version": "0.0.1",
536                                               "name": "LinkFailureOutputEvent"
537                                             },
538                                             "nextState": {
539                                               "parentKeyName": "NULL",
540                                               "parentKeyVersion": "0.0.0",
541                                               "parentLocalName": "NULL",
542                                               "localName": "NULL"
543                                             }
544                                           }
545                                         }]
546                                     },
547                                     "taskReferences": {
548                                       "entry": [
549                                         {
550                                           "key": {
551                                             "version": "0.0.1",
552                                             "name": "LinkFailureTask"
553                                           },
554                                           "value": {
555                                             "key": {
556                                               "parentKeyName": "LinkMonitorPolicy",
557                                               "parentKeyVersion": "0.0.1",
558                                               "parentLocalName": "LinkFailureState",
559                                               "localName": "LinkFailureTask"
560                                             },
561                                             "output": {
562                                               "parentKeyName": "LinkMonitorPolicy",
563                                               "parentKeyVersion": "0.0.1",
564                                               "parentLocalName": "LinkFailureState",
565                                               "localName": "LinkFailureLogic_Output_Direct"
566                                             },
567                                             "outputType": "DIRECT"
568                                           }
569                                         }]
570                                     },
571                                     "stateKey": {
572                                       "parentKeyName": "LinkMonitorPolicy",
573                                       "parentKeyVersion": "0.0.1",
574                                       "parentLocalName": "NULL",
575                                       "localName": "LinkFailureState"
576                                     },
577                                     "contextAlbumReference": [],
578                                     "stateFinalizerLogicMap": {
579                                       "entry": []
580                                     },
581                                     "taskSelectionLogic": {
582                                       "key": "NULL",
583                                       "logic": "",
584                                       "logicFlavour": "UNDEFINED"
585                                     },
586                                     "trigger": {
587                                       "version": "0.0.1",
588                                       "name": "CreateLinkFailureOutfieldsEvent"
589                                     }
590                                   }
591                                 }]
592                             },
593                             "firstState": "LinkFailureOrClearedState"
594                           }
595                         }]
596                     }
597                   },
598                   "events": {
599                     "key": {
600                       "version": "0.0.1",
601                       "name": "LinkMonitorModel_Events"
602                     },
603                     "eventMap": {
604                       "entry": [
605                         {
606                           "key": {
607                             "version": "0.0.1",
608                             "name": "ApexMessageOutputEvent"
609                           },
610                           "value": {
611                             "key": {
612                               "version": "0.0.1",
613                               "name": "ApexMessageOutputEvent"
614                             },
615                             "target": "APEX",
616                             "source": "APEX",
617                             "nameSpace": "org.onap.policy.apex.auth.clieditor",
618                             "parameter": {
619                               "entry": [
620                                 {
621                                   "key": "message",
622                                   "value": {
623                                     "optional": false,
624                                     "key": "message",
625                                     "fieldSchemaKey": {
626                                       "version": "0.0.1",
627                                       "name": "MessageSchema"
628                                     }
629                                   }
630                                 }]
631                             }
632                           }
633                         },{
634                           "key": {
635                             "version": "0.0.1",
636                             "name": "CreateLinkClearedOutfieldsEvent"
637                           },
638                           "value": {
639                             "key": {
640                               "version": "0.0.1",
641                               "name": "CreateLinkClearedOutfieldsEvent"
642                             },
643                             "target": "APEX",
644                             "source": "APEX",
645                             "nameSpace": "org.onap.policy.apex.auth.clieditor",
646                             "parameter": {
647                               "entry": [
648                                 {
649                                   "key": "OruId",
650                                   "value": {
651                                     "optional": false,
652                                     "key": "OruId",
653                                     "fieldSchemaKey": {
654                                       "version": "0.0.1",
655                                       "name": "OruIdSchema"
656                                     }
657                                   }
658                                 }]
659                             }
660                           }
661                         },{
662                           "key": {
663                             "version": "0.0.1",
664                             "name": "CreateLinkFailureOutfieldsEvent"
665                           },
666                           "value": {
667                             "key": {
668                               "version": "0.0.1",
669                               "name": "CreateLinkFailureOutfieldsEvent"
670                             },
671                             "target": "APEX",
672                             "source": "APEX",
673                             "nameSpace": "org.onap.policy.apex.auth.clieditor",
674                             "parameter": {
675                               "entry": [
676                                 {
677                                   "key": "OduId",
678                                   "value": {
679                                     "optional": false,
680                                     "key": "OduId",
681                                     "fieldSchemaKey": {
682                                       "version": "0.0.1",
683                                       "name": "OduIdSchema"
684                                     }
685                                   }
686                                 },{
687                                   "key": "OruId",
688                                   "value": {
689                                     "optional": false,
690                                     "key": "OruId",
691                                     "fieldSchemaKey": {
692                                       "version": "0.0.1",
693                                       "name": "OruIdSchema"
694                                     }
695                                   }
696                                 }]
697                             }
698                           }
699                         },{
700                           "key": {
701                             "version": "0.0.1",
702                             "name": "LinkFailureInputEvent"
703                           },
704                           "value": {
705                             "key": {
706                               "version": "0.0.1",
707                               "name": "LinkFailureInputEvent"
708                             },
709                             "target": "APEX",
710                             "source": "DMAAP",
711                             "nameSpace": "org.onap.policy.apex.auth.clieditor",
712                             "parameter": {
713                               "entry": [
714                                 {
715                                   "key": "LinkFailureInput",
716                                   "value": {
717                                     "optional": false,
718                                     "key": "LinkFailureInput",
719                                     "fieldSchemaKey": {
720                                       "version": "0.0.1",
721                                       "name": "LinkFailureInputSchema"
722                                     }
723                                   }
724                                 }]
725                             }
726                           }
727                         },{
728                           "key": {
729                             "version": "0.0.1",
730                             "name": "LinkFailureOutputEvent"
731                           },
732                           "value": {
733                             "key": {
734                               "version": "0.0.1",
735                               "name": "LinkFailureOutputEvent"
736                             },
737                             "target": "OAM",
738                             "source": "APEX",
739                             "nameSpace": "org.onap.policy.apex.auth.clieditor",
740                             "parameter": {
741                               "entry": [
742                                 {
743                                   "key": "LinkFailureOutput",
744                                   "value": {
745                                     "optional": false,
746                                     "key": "LinkFailureOutput",
747                                     "fieldSchemaKey": {
748                                       "version": "0.0.1",
749                                       "name": "LinkFailureOutputSchema"
750                                     }
751                                   }
752                                 }]
753                             }
754                           }
755                         }]
756                     }
757                   },
758                   "keyInformation": {
759                     "key": {
760                       "version": "0.0.1",
761                       "name": "LinkMonitorModel_KeyInfo"
762                     },
763                     "keyInfoMap": {
764                       "entry": [
765                         {
766                           "key": {
767                             "version": "0.0.1",
768                             "name": "ApexMessageOutputEvent"
769                           },
770                           "value": {
771                             "key": {
772                               "version": "0.0.1",
773                               "name": "ApexMessageOutputEvent"
774                             },
775                             "description": "Generated description for concept referred to by key \"ApexMessageOutputEvent:0.0.1\"",
776                             "UUID": "cca47d74-7754-4a61-b163-ca31f66b157b"
777                           }
778                         },{
779                           "key": {
780                             "version": "0.0.1",
781                             "name": "CreateLinkClearedOutfieldsEvent"
782                           },
783                           "value": {
784                             "key": {
785                               "version": "0.0.1",
786                               "name": "CreateLinkClearedOutfieldsEvent"
787                             },
788                             "description": "Generated description for concept referred to by key \"CreateLinkClearedOutfieldsEvent:0.0.1\"",
789                             "UUID": "a295d6a3-1b73-387e-abba-b41e9b608802"
790                           }
791                         },{
792                           "key": {
793                             "version": "0.0.1",
794                             "name": "CreateLinkClearedOutfieldsTask"
795                           },
796                           "value": {
797                             "key": {
798                               "version": "0.0.1",
799                               "name": "CreateLinkClearedOutfieldsTask"
800                             },
801                             "description": "This task creates the output fields when link failure is cleared.",
802                             "UUID": "fd594e88-411d-4a94-b2be-697b3a0d7adf"
803                           }
804                         },{
805                           "key": {
806                             "version": "0.0.1",
807                             "name": "CreateLinkFailureOutfieldsEvent"
808                           },
809                           "value": {
810                             "key": {
811                               "version": "0.0.1",
812                               "name": "CreateLinkFailureOutfieldsEvent"
813                             },
814                             "description": "Generated description for concept referred to by key \"CreateLinkFailureOutfieldsEvent:0.0.1\"",
815                             "UUID": "02be2b5d-45b7-3c54-ae54-97f2b5c30125"
816                           }
817                         },{
818                           "key": {
819                             "version": "0.0.1",
820                             "name": "CreateLinkFailureOutfieldsTask"
821                           },
822                           "value": {
823                             "key": {
824                               "version": "0.0.1",
825                               "name": "CreateLinkFailureOutfieldsTask"
826                             },
827                             "description": "This task the output fields when link failure is detected.",
828                             "UUID": "ac3d9842-80af-4a98-951c-bd79a431c613"
829                           }
830                         },{
831                           "key": {
832                             "version": "0.0.1",
833                             "name": "LinkClearedTask"
834                           },
835                           "value": {
836                             "key": {
837                               "version": "0.0.1",
838                               "name": "LinkClearedTask"
839                             },
840                             "description": "This task sends a message to the output when link failure is cleared.",
841                             "UUID": "eecfde90-896c-4343-8f9c-2603ced94e2d"
842                           }
843                         },{
844                           "key": {
845                             "version": "0.0.1",
846                             "name": "LinkFailureInputEvent"
847                           },
848                           "value": {
849                             "key": {
850                               "version": "0.0.1",
851                               "name": "LinkFailureInputEvent"
852                             },
853                             "description": "Generated description for concept referred to by key \"LinkFailureInputEvent:0.0.1\"",
854                             "UUID": "c4500941-3f98-4080-a9cc-5b9753ed050b"
855                           }
856                         },{
857                           "key": {
858                             "version": "0.0.1",
859                             "name": "LinkFailureInputSchema"
860                           },
861                           "value": {
862                             "key": {
863                               "version": "0.0.1",
864                               "name": "LinkFailureInputSchema"
865                             },
866                             "description": "Generated description for concept referred to by key \"LinkFailureInputSchema:0.0.1\"",
867                             "UUID": "3b3974fc-3012-3b02-9f33-c9d8eefe4dc1"
868                           }
869                         },{
870                           "key": {
871                             "version": "0.0.1",
872                             "name": "LinkFailureOutputEvent"
873                           },
874                           "value": {
875                             "key": {
876                               "version": "0.0.1",
877                               "name": "LinkFailureOutputEvent"
878                             },
879                             "description": "Generated description for concept referred to by key \"LinkFailureOutputEvent:0.0.1\"",
880                             "UUID": "4f04aa98-e917-4f4a-882a-c75ba5a99374"
881                           }
882                         },{
883                           "key": {
884                             "version": "0.0.1",
885                             "name": "LinkFailureOutputSchema"
886                           },
887                           "value": {
888                             "key": {
889                               "version": "0.0.1",
890                               "name": "LinkFailureOutputSchema"
891                             },
892                             "description": "Generated description for concept referred to by key \"LinkFailureOutputSchema:0.0.1\"",
893                             "UUID": "2d1a7f6e-eb9a-3984-be1f-283d98111b84"
894                           }
895                         },{
896                           "key": {
897                             "version": "0.0.1",
898                             "name": "LinkFailureTask"
899                           },
900                           "value": {
901                             "key": {
902                               "version": "0.0.1",
903                               "name": "LinkFailureTask"
904                             },
905                             "description": "This task updates the config for O-RU when link failure is detected.",
906                             "UUID": "3351b0f4-cf06-4fa2-8823-edf67bd30223"
907                           }
908                         },{
909                           "key": {
910                             "version": "0.0.1",
911                             "name": "LinkMonitorModel"
912                           },
913                           "value": {
914                             "key": {
915                               "version": "0.0.1",
916                               "name": "LinkMonitorModel"
917                             },
918                             "description": "This is the Apex Policy Model for link monitoring.",
919                             "UUID": "540226fb-55ee-4f0e-a444-983a0494818e"
920                           }
921                         },{
922                           "key": {
923                             "version": "0.0.1",
924                             "name": "LinkMonitorModel_Events"
925                           },
926                           "value": {
927                             "key": {
928                               "version": "0.0.1",
929                               "name": "LinkMonitorModel_Events"
930                             },
931                             "description": "Generated description for concept referred to by key \"LinkMonitorModel_Events:0.0.1\"",
932                             "UUID": "27ad3e7e-fe3b-3bd6-9081-718705c2bcea"
933                           }
934                         },{
935                           "key": {
936                             "version": "0.0.1",
937                             "name": "LinkMonitorModel_KeyInfo"
938                           },
939                           "value": {
940                             "key": {
941                               "version": "0.0.1",
942                               "name": "LinkMonitorModel_KeyInfo"
943                             },
944                             "description": "Generated description for concept referred to by key \"LinkMonitorModel_KeyInfo:0.0.1\"",
945                             "UUID": "ea0b5f58-eefd-358a-9660-840c640bf981"
946                           }
947                         },{
948                           "key": {
949                             "version": "0.0.1",
950                             "name": "LinkMonitorModel_Policies"
951                           },
952                           "value": {
953                             "key": {
954                               "version": "0.0.1",
955                               "name": "LinkMonitorModel_Policies"
956                             },
957                             "description": "Generated description for concept referred to by key \"LinkMonitorModel_Policies:0.0.1\"",
958                             "UUID": "ee9e0b0f-2b7d-3ab7-9a98-c5ec05ed823d"
959                           }
960                         },{
961                           "key": {
962                             "version": "0.0.1",
963                             "name": "LinkMonitorModel_Schemas"
964                           },
965                           "value": {
966                             "key": {
967                               "version": "0.0.1",
968                               "name": "LinkMonitorModel_Schemas"
969                             },
970                             "description": "Generated description for concept referred to by key \"LinkMonitorModel_Schemas:0.0.1\"",
971                             "UUID": "fa5f9b8f-796c-3c70-84e9-5140c958c4bb"
972                           }
973                         },{
974                           "key": {
975                             "version": "0.0.1",
976                             "name": "LinkMonitorModel_Tasks"
977                           },
978                           "value": {
979                             "key": {
980                               "version": "0.0.1",
981                               "name": "LinkMonitorModel_Tasks"
982                             },
983                             "description": "Generated description for concept referred to by key \"LinkMonitorModel_Tasks:0.0.1\"",
984                             "UUID": "eec592f7-69d5-39a9-981a-e552f787ed01"
985                           }
986                         },{
987                           "key": {
988                             "version": "0.0.1",
989                             "name": "LinkMonitorPolicy"
990                           },
991                           "value": {
992                             "key": {
993                               "version": "0.0.1",
994                               "name": "LinkMonitorPolicy"
995                             },
996                             "description": "Generated description for concept referred to by key \"LinkMonitorPolicy:0.0.1\"",
997                             "UUID": "6c5e410f-489a-46ff-964e-982ce6e8b6d0"
998                           }
999                         },{
1000                           "key": {
1001                             "version": "0.0.1",
1002                             "name": "MessageSchema"
1003                           },
1004                           "value": {
1005                             "key": {
1006                               "version": "0.0.1",
1007                               "name": "MessageSchema"
1008                             },
1009                             "description": "A schema for messages from apex",
1010                             "UUID": "ac4b34ac-39d6-3393-a267-8d5b84854018"
1011                           }
1012                         },{
1013                           "key": {
1014                             "version": "0.0.1",
1015                             "name": "NoPolicyDefinedTask"
1016                           },
1017                           "value": {
1018                             "key": {
1019                               "version": "0.0.1",
1020                               "name": "NoPolicyDefinedTask"
1021                             },
1022                             "description": "This task sends a message to the output when an event is received for which no policy has been defined.",
1023                             "UUID": "d48b619e-d00d-4008-b884-02d76ea4350b"
1024                           }
1025                         },{
1026                           "key": {
1027                             "version": "0.0.1",
1028                             "name": "OduIdSchema"
1029                           },
1030                           "value": {
1031                             "key": {
1032                               "version": "0.0.1",
1033                               "name": "OduIdSchema"
1034                             },
1035                             "description": "A schema for O-DU-ID",
1036                             "UUID": "50662174-a88b-3cbd-91bd-8e91b40b2660"
1037                           }
1038                         },{
1039                           "key": {
1040                             "version": "0.0.1",
1041                             "name": "OruIdSchema"
1042                           },
1043                           "value": {
1044                             "key": {
1045                               "version": "0.0.1",
1046                               "name": "OruIdSchema"
1047                             },
1048                             "description": "A schema for O-RU-ID",
1049                             "UUID": "54daf32b-015f-39cd-8530-a1175c5553e9"
1050                           }
1051                         }]
1052                     }
1053                   },
1054                   "schemas": {
1055                     "key": {
1056                       "version": "0.0.1",
1057                       "name": "LinkMonitorModel_Schemas"
1058                     },
1059                     "schemas": {
1060                       "entry": [
1061                         {
1062                           "key": {
1063                             "version": "0.0.1",
1064                             "name": "LinkFailureInputSchema"
1065                           },
1066                           "value": {
1067                             "schemaDefinition": "{
1068     \"type\": \"record\",
1069     \"name\": \"Link_Failure_Input\",
1070     \"fields\": [
1071         {
1072             \"name\": \"event\",
1073             \"type\": {
1074                 \"type\": \"record\",
1075                 \"name\": \"Event_Type\",
1076                 \"fields\": [
1077                     {
1078                         \"name\": \"commonEventHeader\",
1079                         \"type\": {
1080                             \"type\": \"record\",
1081                             \"name\": \"Common_Event_Header_Type\",
1082                             \"fields\": [
1083                                 {
1084                                     \"name\": \"domain\",
1085                                     \"type\": \"string\"
1086                                 },
1087                                 {
1088                                     \"name\": \"eventId\",
1089                                     \"type\": \"string\"
1090                                 },
1091                                 {
1092                                     \"name\": \"eventName\",
1093                                     \"type\": \"string\"
1094                                 },
1095                                 {
1096                                     \"name\": \"eventType\",
1097                                     \"type\": \"string\"
1098                                 },
1099                                 {
1100                                     \"name\": \"sequence\",
1101                                     \"type\": \"int\"
1102                                 },
1103                                 {
1104                                     \"name\": \"priority\",
1105                                     \"type\": \"string\"
1106                                 },
1107                                 {
1108                                     \"name\": \"reportingEntityId\",
1109                                     \"type\": \"string\"
1110                                 },
1111                                 {
1112                                     \"name\": \"reportingEntityName\",
1113                                     \"type\": \"string\"
1114                                 },
1115                                 {
1116                                     \"name\": \"sourceId\",
1117                                     \"type\": \"string\"
1118                                 },
1119                                 {
1120                                     \"name\": \"sourceName\",
1121                                     \"type\": \"string\"
1122                                 },
1123                                 {
1124                                     \"name\": \"startEpochMicrosec\",
1125                                     \"type\": \"string\"
1126                                 },
1127                                 {
1128                                     \"name\": \"lastEpochMicrosec\",
1129                                     \"type\": \"string\"
1130                                 },
1131                                 {
1132                                     \"name\": \"nfNamingCode\",
1133                                     \"type\": \"string\"
1134                                 },
1135                                 {
1136                                     \"name\": \"nfVendorName\",
1137                                     \"type\": \"string\"
1138                                 },
1139                                 {
1140                                     \"name\": \"timeZoneOffset\",
1141                                     \"type\": \"string\"
1142                                 },
1143                                 {
1144                                     \"name\": \"version\",
1145                                     \"type\": \"string\"
1146                                 },
1147                                 {
1148                                     \"name\": \"vesEventListenerVersion\",
1149                                     \"type\": \"string\"
1150                                 }
1151                             ]
1152                         }
1153                     },
1154                     {
1155                         \"name\": \"faultFields\",
1156                         \"type\": {
1157                             \"type\": \"record\",
1158                             \"name\": \"Fault_Fields_Type\",
1159                             \"fields\": [
1160                                 {
1161                                     \"name\": \"faultFieldsVersion\",
1162                                     \"type\": \"string\"
1163                                 },
1164                                 {
1165                                     \"name\": \"alarmCondition\",
1166                                     \"type\": \"string\"
1167                                 },
1168                                 {
1169                                     \"name\": \"alarmInterfaceA\",
1170                                     \"type\": \"string\"
1171                                 },
1172                                 {
1173                                     \"name\": \"eventSourceType\",
1174                                     \"type\": \"string\"
1175                                 },
1176                                 {
1177                                     \"name\": \"specificProblem\",
1178                                     \"type\": \"string\"
1179                                 },
1180                                 {
1181                                     \"name\": \"eventSeverity\",
1182                                     \"type\": \"string\"
1183                                 },
1184                                 {
1185                                     \"name\": \"vfStatus\",
1186                                     \"type\": \"string\"
1187                                 },
1188                                 {
1189                                     \"name\": \"alarmAdditionalInformation\",
1190                                     \"type\": {
1191                                         \"type\": \"record\",
1192                                         \"name\": \"Alarm_Additional_Information_Type\",
1193                                         \"fields\": [
1194                                             {
1195                                                 \"name\": \"eventTime\",
1196                                                 \"type\": \"string\"
1197                                             },
1198                                             {
1199                                                 \"name\": \"equipType\",
1200                                                 \"type\": \"string\"
1201                                             },
1202                                             {
1203                                                 \"name\": \"vendor\",
1204                                                 \"type\": \"string\"
1205                                             },
1206                                             {
1207                                                 \"name\": \"model\",
1208                                                 \"type\": \"string\"
1209                                             }
1210                                         ]
1211                                     }
1212                                 }
1213                             ]
1214                         }
1215                     }
1216                 ]
1217             }
1218         }
1219     ]
1220 }",
1221                             "key": {
1222                               "version": "0.0.1",
1223                               "name": "LinkFailureInputSchema"
1224                             },
1225                             "schemaFlavour": "Avro"
1226                           }
1227                         },{
1228                           "key": {
1229                             "version": "0.0.1",
1230                             "name": "LinkFailureOutputSchema"
1231                           },
1232                           "value": {
1233                             "schemaDefinition": "{
1234   \"name\": \"Link_Failure_Output\",
1235   \"type\": \"record\",
1236   \"fields\": [
1237     {
1238       \"name\": \"o_DasH_ran_DasH_sc_DasH_du_DasH_hello_DasH_world_ColoN_radio_DasH_resource_DasH_management_DasH_policy_DasH_ratio\",
1239       \"type\": {
1240         \"type\": \"array\",
1241         \"items\": {
1242           \"name\": \"o_DasH_ran_DasH_sc_DasH_du_DasH_hello_DasH_world_ColoN_radio_DasH_resource_DasH_management_DasH_policy_DasH_ratio_record\",
1243           \"type\": \"record\",
1244           \"fields\": [
1245             {
1246               \"name\": \"id\",
1247               \"type\": \"string\"
1248             },
1249             {
1250               \"name\": \"radio_DasH_resource_DasH_management_DasH_policy_DasH_max_DasH_ratio\",
1251               \"type\": \"int\"
1252             },
1253             {
1254               \"name\": \"radio_DasH_resource_DasH_management_DasH_policy_DasH_members\",
1255               \"type\": {
1256                 \"type\": \"array\",
1257                 \"items\": {
1258                   \"name\": \"radio_DasH_resource_DasH_management_DasH_policy_DasH_members_record\",
1259                   \"type\": \"record\",
1260                   \"fields\": [
1261                     {
1262                       \"name\": \"mobile_DasH_country_DasH_code\",
1263                       \"type\": \"string\"
1264                     },
1265                     {
1266                       \"name\": \"mobile_DasH_network_DasH_code\",
1267                       \"type\": \"string\"
1268                     },
1269                     {
1270                       \"name\": \"slice_DasH_differentiator\",
1271                       \"type\": \"int\"
1272                     },
1273                     {
1274                       \"name\": \"slice_DasH_service_DasH_type\",
1275                       \"type\": \"int\"
1276                     }
1277                   ]
1278                 }
1279               }
1280             },
1281             {
1282               \"name\": \"radio_DasH_resource_DasH_management_DasH_policy_DasH_min_DasH_ratio\",
1283               \"type\": \"int\"
1284             },
1285             {
1286               \"name\": \"user_DasH_label\",
1287               \"type\": \"string\"
1288             },
1289             {
1290               \"name\": \"resource_DasH_type\",
1291               \"type\": \"string\"
1292             },
1293             {
1294               \"name\": \"radio_DasH_resource_DasH_management_DasH_policy_DasH_dedicated_DasH_ratio\",
1295               \"type\": \"int\"
1296             },
1297             {
1298               \"name\": \"administrative_DasH_state\",
1299               \"type\": \"string\"
1300             }
1301           ]
1302         }
1303       }
1304     }
1305   ]
1306 }",
1307                             "key": {
1308                               "version": "0.0.1",
1309                               "name": "LinkFailureOutputSchema"
1310                             },
1311                             "schemaFlavour": "Avro"
1312                           }
1313                         },{
1314                           "key": {
1315                             "version": "0.0.1",
1316                             "name": "MessageSchema"
1317                           },
1318                           "value": {
1319                             "schemaDefinition": "java.lang.String",
1320                             "key": {
1321                               "version": "0.0.1",
1322                               "name": "MessageSchema"
1323                             },
1324                             "schemaFlavour": "Java"
1325                           }
1326                         },{
1327                           "key": {
1328                             "version": "0.0.1",
1329                             "name": "OduIdSchema"
1330                           },
1331                           "value": {
1332                             "schemaDefinition": "java.lang.String",
1333                             "key": {
1334                               "version": "0.0.1",
1335                               "name": "OduIdSchema"
1336                             },
1337                             "schemaFlavour": "Java"
1338                           }
1339                         },{
1340                           "key": {
1341                             "version": "0.0.1",
1342                             "name": "OruIdSchema"
1343                           },
1344                           "value": {
1345                             "schemaDefinition": "java.lang.String",
1346                             "key": {
1347                               "version": "0.0.1",
1348                               "name": "OruIdSchema"
1349                             },
1350                             "schemaFlavour": "Java"
1351                           }
1352                         }]
1353                     }
1354                   },
1355                   "tasks": {
1356                     "key": {
1357                       "version": "0.0.1",
1358                       "name": "LinkMonitorModel_Tasks"
1359                     },
1360                     "taskMap": {
1361                       "entry": [
1362                         {
1363                           "key": {
1364                             "version": "0.0.1",
1365                             "name": "CreateLinkClearedOutfieldsTask"
1366                           },
1367                           "value": {
1368                             "taskParameters": {
1369                               "entry": []
1370                             },
1371                             "key": {
1372                               "version": "0.0.1",
1373                               "name": "CreateLinkClearedOutfieldsTask"
1374                             },
1375                             "taskLogic": {
1376                               "key": "TaskLogic",
1377                               "logic": "/*
1378  * ============LICENSE_START=======================================================
1379  * Copyright (C) 2021 Nordix Foundation.
1380  * ================================================================================
1381  * Licensed under the Apache License, Version 2.0 (the \"License\");
1382  * you may not use this file except in compliance with the License.
1383  * You may obtain a copy of the License at
1384  *
1385  *      http://www.apache.org/licenses/LICENSE-2.0
1386  *
1387  * Unless required by applicable law or agreed to in writing, software
1388  * distributed under the License is distributed on an \"AS IS\" BASIS,
1389  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1390  * See the License for the specific language governing permissions and
1391  * limitations under the License.
1392  *
1393  * SPDX-License-Identifier: Apache-2.0
1394  * ============LICENSE_END=========================================================
1395  */
1396
1397 executor.logger.info(\"Task Execution: '\"+executor.subject.id+\"'. Input Fields: '\"+executor.inFields+\"'\");
1398
1399 var linkFailureInput = executor.inFields.get(\"LinkFailureInput\");
1400 var oruId = linkFailureInput.get(\"event\").get(\"commonEventHeader\").get(\"sourceName\");
1401
1402 executor.outFields.put(\"OruId\", oruId);
1403
1404 executor.logger.info(executor.outFields);
1405
1406 true;",
1407                               "logicFlavour": "JAVASCRIPT"
1408                             },
1409                             "inputFields": {
1410                               "entry": [
1411                                 {
1412                                   "key": "LinkFailureInput",
1413                                   "value": {
1414                                     "optional": false,
1415                                     "key": "LinkFailureInput",
1416                                     "fieldSchemaKey": {
1417                                       "version": "0.0.1",
1418                                       "name": "LinkFailureInputSchema"
1419                                     }
1420                                   }
1421                                 }]
1422                             },
1423                             "outputFields": {
1424                               "entry": [
1425                                 {
1426                                   "key": "OruId",
1427                                   "value": {
1428                                     "optional": false,
1429                                     "key": "OruId",
1430                                     "fieldSchemaKey": {
1431                                       "version": "0.0.1",
1432                                       "name": "OruIdSchema"
1433                                     }
1434                                   }
1435                                 }]
1436                             },
1437                             "contextAlbumReference": []
1438                           }
1439                         },{
1440                           "key": {
1441                             "version": "0.0.1",
1442                             "name": "CreateLinkFailureOutfieldsTask"
1443                           },
1444                           "value": {
1445                             "taskParameters": {
1446                               "entry": []
1447                             },
1448                             "key": {
1449                               "version": "0.0.1",
1450                               "name": "CreateLinkFailureOutfieldsTask"
1451                             },
1452                             "taskLogic": {
1453                               "key": "TaskLogic",
1454                               "logic": "/*
1455  * ============LICENSE_START=======================================================
1456  * Copyright (C) 2021 Nordix Foundation.
1457  * ================================================================================
1458  * Licensed under the Apache License, Version 2.0 (the \"License\");
1459  * you may not use this file except in compliance with the License.
1460  * You may obtain a copy of the License at
1461  *
1462  *      http://www.apache.org/licenses/LICENSE-2.0
1463  *
1464  * Unless required by applicable law or agreed to in writing, software
1465  * distributed under the License is distributed on an \"AS IS\" BASIS,
1466  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1467  * See the License for the specific language governing permissions and
1468  * limitations under the License.
1469  *
1470  * SPDX-License-Identifier: Apache-2.0
1471  * ============LICENSE_END=========================================================
1472  */
1473
1474 executor.logger.info(\"Task Execution: '\"+executor.subject.id+\"'. Input Fields: '\"+executor.inFields+\"'\");
1475
1476 var returnValue = true;
1477 var linkFailureInput = executor.inFields.get(\"LinkFailureInput\");
1478 var oruId = linkFailureInput.get(\"event\").get(\"commonEventHeader\").get(\"sourceName\");
1479 var oruOduMap = JSON.parse(executor.parameters.get(\"ORU-ODU-Map\"));
1480
1481 if (oruId in oruOduMap) {
1482     var oduId = oruOduMap[oruId];
1483     executor.outFields.put(\"OruId\", oruId);
1484     executor.outFields.put(\"OduId\", oduId);
1485     executor.logger.info(executor.outFields);
1486 } else {
1487     executor.message = \"No O-RU found in the config with this ID: \" + oruId;
1488     returnValue = false;
1489 }
1490
1491 returnValue;",
1492                               "logicFlavour": "JAVASCRIPT"
1493                             },
1494                             "inputFields": {
1495                               "entry": [
1496                                 {
1497                                   "key": "LinkFailureInput",
1498                                   "value": {
1499                                     "optional": false,
1500                                     "key": "LinkFailureInput",
1501                                     "fieldSchemaKey": {
1502                                       "version": "0.0.1",
1503                                       "name": "LinkFailureInputSchema"
1504                                     }
1505                                   }
1506                                 }]
1507                             },
1508                             "outputFields": {
1509                               "entry": [
1510                                 {
1511                                   "key": "OduId",
1512                                   "value": {
1513                                     "optional": false,
1514                                     "key": "OduId",
1515                                     "fieldSchemaKey": {
1516                                       "version": "0.0.1",
1517                                       "name": "OduIdSchema"
1518                                     }
1519                                   }
1520                                 },{
1521                                   "key": "OruId",
1522                                   "value": {
1523                                     "optional": false,
1524                                     "key": "OruId",
1525                                     "fieldSchemaKey": {
1526                                       "version": "0.0.1",
1527                                       "name": "OruIdSchema"
1528                                     }
1529                                   }
1530                                 }]
1531                             },
1532                             "contextAlbumReference": []
1533                           }
1534                         },{
1535                           "key": {
1536                             "version": "0.0.1",
1537                             "name": "LinkClearedTask"
1538                           },
1539                           "value": {
1540                             "taskParameters": {
1541                               "entry": []
1542                             },
1543                             "key": {
1544                               "version": "0.0.1",
1545                               "name": "LinkClearedTask"
1546                             },
1547                             "taskLogic": {
1548                               "key": "TaskLogic",
1549                               "logic": "/*
1550  * ============LICENSE_START=======================================================
1551  * Copyright (C) 2021 Nordix Foundation.
1552  * ================================================================================
1553  * Licensed under the Apache License, Version 2.0 (the \"License\");
1554  * you may not use this file except in compliance with the License.
1555  * You may obtain a copy of the License at
1556  *
1557  *      http://www.apache.org/licenses/LICENSE-2.0
1558  *
1559  * Unless required by applicable law or agreed to in writing, software
1560  * distributed under the License is distributed on an \"AS IS\" BASIS,
1561  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1562  * See the License for the specific language governing permissions and
1563  * limitations under the License.
1564  *
1565  * SPDX-License-Identifier: Apache-2.0
1566  * ============LICENSE_END=========================================================
1567  */
1568
1569 executor.logger.info(\"Task Execution: '\"+executor.subject.id+\"'. Input Fields: '\"+executor.inFields+\"'\");
1570
1571 var oruId = executor.inFields.get(\"OruId\");
1572
1573 executor.outFields.put(\"message\", \"CLEARED link failure for O-RU: \" + oruId);
1574
1575 executor.logger.info(executor.outFields);
1576
1577 true;",
1578                               "logicFlavour": "JAVASCRIPT"
1579                             },
1580                             "inputFields": {
1581                               "entry": [
1582                                 {
1583                                   "key": "OruId",
1584                                   "value": {
1585                                     "optional": false,
1586                                     "key": "OruId",
1587                                     "fieldSchemaKey": {
1588                                       "version": "0.0.1",
1589                                       "name": "OruIdSchema"
1590                                     }
1591                                   }
1592                                 }]
1593                             },
1594                             "outputFields": {
1595                               "entry": [
1596                                 {
1597                                   "key": "message",
1598                                   "value": {
1599                                     "optional": false,
1600                                     "key": "message",
1601                                     "fieldSchemaKey": {
1602                                       "version": "0.0.1",
1603                                       "name": "MessageSchema"
1604                                     }
1605                                   }
1606                                 }]
1607                             },
1608                             "contextAlbumReference": []
1609                           }
1610                         },{
1611                           "key": {
1612                             "version": "0.0.1",
1613                             "name": "LinkFailureTask"
1614                           },
1615                           "value": {
1616                             "taskParameters": {
1617                               "entry": []
1618                             },
1619                             "key": {
1620                               "version": "0.0.1",
1621                               "name": "LinkFailureTask"
1622                             },
1623                             "taskLogic": {
1624                               "key": "TaskLogic",
1625                               "logic": "/*
1626  * ============LICENSE_START=======================================================
1627  * Copyright (C) 2021 Nordix Foundation.
1628  * ================================================================================
1629  * Licensed under the Apache License, Version 2.0 (the \"License\");
1630  * you may not use this file except in compliance with the License.
1631  * You may obtain a copy of the License at
1632  *
1633  *      http://www.apache.org/licenses/LICENSE-2.0
1634  *
1635  * Unless required by applicable law or agreed to in writing, software
1636  * distributed under the License is distributed on an \"AS IS\" BASIS,
1637  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1638  * See the License for the specific language governing permissions and
1639  * limitations under the License.
1640  *
1641  * SPDX-License-Identifier: Apache-2.0
1642  * ============LICENSE_END=========================================================
1643  */
1644
1645 executor.logger.info(\"Task Execution: '\"+executor.subject.id+\"'. Input Fields: '\"+executor.inFields+\"'\");
1646
1647 var linkFailureOutput = executor.subject.getOutFieldSchemaHelper(\"LinkFailureOutput\").createNewInstance();
1648
1649 var oruId = executor.inFields.get(\"OruId\");
1650 var oduId = executor.inFields.get(\"OduId\");
1651
1652 var unlockMessageArray = new java.util.ArrayList();
1653 for (var i = 0; i < 1; i++) {
1654     unlockMessageArray.add({
1655       \"id\":\"rrm-pol-2\",
1656       \"radio_DasH_resource_DasH_management_DasH_policy_DasH_max_DasH_ratio\":25,
1657       \"radio_DasH_resource_DasH_management_DasH_policy_DasH_members\":
1658           [
1659               {
1660                   \"mobile_DasH_country_DasH_code\":\"310\",
1661                   \"mobile_DasH_network_DasH_code\":\"150\",
1662                   \"slice_DasH_differentiator\":1,
1663                   \"slice_DasH_service_DasH_type\":1
1664               }
1665           ],
1666       \"radio_DasH_resource_DasH_management_DasH_policy_DasH_min_DasH_ratio\":15,
1667       \"user_DasH_label\":\"rrm-pol-2\",
1668       \"resource_DasH_type\":\"prb\",
1669       \"radio_DasH_resource_DasH_management_DasH_policy_DasH_dedicated_DasH_ratio\":20,
1670       \"administrative_DasH_state\":\"unlocked\"
1671   });
1672 }
1673
1674 linkFailureOutput.put(\"o_DasH_ran_DasH_sc_DasH_du_DasH_hello_DasH_world_ColoN_radio_DasH_resource_DasH_management_DasH_policy_DasH_ratio\", unlockMessageArray);
1675 executor.outFields.put(\"LinkFailureOutput\", linkFailureOutput.toString());
1676
1677 executor.getExecutionProperties().setProperty(\"OduId\", oduId);
1678 executor.getExecutionProperties().setProperty(\"OruId\", oruId);
1679
1680 executor.logger.info(executor.outFields);
1681
1682 true;",
1683                               "logicFlavour": "JAVASCRIPT"
1684                             },
1685                             "inputFields": {
1686                               "entry": [
1687                                 {
1688                                   "key": "OduId",
1689                                   "value": {
1690                                     "optional": false,
1691                                     "key": "OduId",
1692                                     "fieldSchemaKey": {
1693                                       "version": "0.0.1",
1694                                       "name": "OduIdSchema"
1695                                     }
1696                                   }
1697                                 },{
1698                                   "key": "OruId",
1699                                   "value": {
1700                                     "optional": false,
1701                                     "key": "OruId",
1702                                     "fieldSchemaKey": {
1703                                       "version": "0.0.1",
1704                                       "name": "OruIdSchema"
1705                                     }
1706                                   }
1707                                 }]
1708                             },
1709                             "outputFields": {
1710                               "entry": [
1711                                 {
1712                                   "key": "LinkFailureOutput",
1713                                   "value": {
1714                                     "optional": false,
1715                                     "key": "LinkFailureOutput",
1716                                     "fieldSchemaKey": {
1717                                       "version": "0.0.1",
1718                                       "name": "LinkFailureOutputSchema"
1719                                     }
1720                                   }
1721                                 }]
1722                             },
1723                             "contextAlbumReference": []
1724                           }
1725                         },{
1726                           "key": {
1727                             "version": "0.0.1",
1728                             "name": "NoPolicyDefinedTask"
1729                           },
1730                           "value": {
1731                             "taskParameters": {
1732                               "entry": []
1733                             },
1734                             "key": {
1735                               "version": "0.0.1",
1736                               "name": "NoPolicyDefinedTask"
1737                             },
1738                             "taskLogic": {
1739                               "key": "TaskLogic",
1740                               "logic": "/*
1741  * ============LICENSE_START=======================================================
1742  * Copyright (C) 2021 Nordix Foundation.
1743  * ================================================================================
1744  * Licensed under the Apache License, Version 2.0 (the \"License\");
1745  * you may not use this file except in compliance with the License.
1746  * You may obtain a copy of the License at
1747  *
1748  *      http://www.apache.org/licenses/LICENSE-2.0
1749  *
1750  * Unless required by applicable law or agreed to in writing, software
1751  * distributed under the License is distributed on an \"AS IS\" BASIS,
1752  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1753  * See the License for the specific language governing permissions and
1754  * limitations under the License.
1755  *
1756  * SPDX-License-Identifier: Apache-2.0
1757  * ============LICENSE_END=========================================================
1758  */
1759
1760 executor.logger.info(\"Task Execution: '\"+executor.subject.id+\"'. Input Fields: '\"+executor.inFields+\"'\");
1761
1762 executor.outFields.put(\"message\", \"No policy defined for this event\");
1763
1764 executor.logger.info(executor.outFields);
1765
1766 true;",
1767                               "logicFlavour": "JAVASCRIPT"
1768                             },
1769                             "inputFields": {
1770                               "entry": [
1771                                 {
1772                                   "key": "LinkFailureInput",
1773                                   "value": {
1774                                     "optional": false,
1775                                     "key": "LinkFailureInput",
1776                                     "fieldSchemaKey": {
1777                                       "version": "0.0.1",
1778                                       "name": "LinkFailureInputSchema"
1779                                     }
1780                                   }
1781                                 }]
1782                             },
1783                             "outputFields": {
1784                               "entry": [
1785                                 {
1786                                   "key": "message",
1787                                   "value": {
1788                                     "optional": false,
1789                                     "key": "message",
1790                                     "fieldSchemaKey": {
1791                                       "version": "0.0.1",
1792                                       "name": "MessageSchema"
1793                                     }
1794                                   }
1795                                 }]
1796                             },
1797                             "contextAlbumReference": []
1798                           }
1799                         }]
1800                     }
1801                   }
1802                 }
1803               },
1804               "version": "0.0.1",
1805               "id": 101,
1806               "instanceCount": 1,
1807               "name": "LinkMonitorApexEngine",
1808               "engineParameters": {
1809                 "taskParameters": [
1810                   {
1811                     "key": "ORU-ODU-Map",
1812                     "value": "{
1813    \"o-ru-11211\": \"o-du-1121\",
1814    \"o-ru-11223\": \"o-du-1122\",
1815    \"o-ru-11222\": \"o-du-1122\",
1816    \"o-ru-11221\": \"o-du-1122\"
1817 }"
1818                   }],
1819                 "contextParameters": {
1820                   "schemaParameters": {
1821                     "Avro": {
1822                       "parameterClassName": "org.onap.policy.apex.plugins.context.schema.avro.AvroSchemaHelperParameters"
1823                     }
1824                   },
1825                   "parameterClassName": "org.onap.policy.apex.context.parameters.ContextParameters"
1826                 },
1827                 "executorParameters": {
1828                   "JAVASCRIPT": {
1829                     "parameterClassName": "org.onap.policy.apex.plugins.executor.javascript.JavascriptExecutorParameters"
1830                   }
1831                 }
1832               },
1833               "deploymentPort": 12345
1834             }
1835           },
1836           "metadata": {
1837             "policy-id": "operational.apex.linkmonitor",
1838             "policy-version": "1.0.0"
1839           },
1840           "version": "1.0.0",
1841           "type_version": "1.0.0",
1842           "type": "onap.policies.controlloop.operational.common.Apex"
1843         }
1844       }],
1845     "node_templates": {
1846       "org.onap.domain.linkmonitor.LinkMonitorControlLoopDefinition0": {
1847         "properties": {
1848           "elements": [
1849             {
1850               "version": "1.2.3",
1851               "name": "org.onap.domain.linkmonitor.LinkMonitorPolicyControlLoopElement"
1852             }],
1853           "provider": "Ericsson"
1854         },
1855         "description": "Control loop for Link Monitor",
1856         "version": "1.2.3",
1857         "type_version": "1.0.0",
1858         "type": "org.onap.policy.clamp.controlloop.ControlLoop"
1859       },
1860       "org.onap.policy.controlloop.PolicyControlLoopParticipant": {
1861         "properties": {
1862           "provider": "ONAP"
1863         },
1864         "description": "Participant for policy framework",
1865         "version": "2.3.1",
1866         "type_version": "1.0.1",
1867         "type": "org.onap.policy.clamp.controlloop.Participant"
1868       },
1869       "org.onap.domain.linkmonitor.LinkMonitorPolicyControlLoopElement": {
1870         "properties": {
1871           "participantType": {
1872             "version": "2.3.1",
1873             "name": "org.onap.policy.controlloop.PolicyControlLoopParticipant"
1874           },
1875           "policy_type_id": {
1876             "version": "1.0.0",
1877             "name": "onap.policies.controlloop.operational.common.Apex"
1878           },
1879           "participant_id": {
1880             "version": "1.0.0",
1881             "name": "org.onap.PM_Policy"
1882           },
1883           "pdpGroup": "defaultGroup",
1884           "provider": "Ericsson",
1885           "policy_id": {
1886             "version": "1.0.0",
1887             "name": "operational.apex.linkmonitor"
1888           }
1889         },
1890         "description": "Control loop element for the Link Monitor",
1891         "version": "1.2.3",
1892         "type_version": "1.0.1",
1893         "type": "org.onap.policy.clamp.controlloop.PolicyControlLoopElement"
1894       }
1895     }
1896   },
1897   "policy_types": {
1898     "onap.policies.controlloop.operational.Common": {
1899       "derived_from": "tosca.policies.Root",
1900       "properties": {
1901         "abatement": {
1902           "required": true,
1903           "default": false,
1904           "description": "Whether an abatement event message will be expected for the control loop from DCAE.",
1905           "type": "boolean"
1906         },
1907         "operations": {
1908           "required": true,
1909           "entry_schema": {
1910             "type": "onap.datatype.controlloop.Operation"
1911           },
1912           "description": "List of operations to be performed when Control Loop is triggered.",
1913           "type": "list"
1914         },
1915         "timeout": {
1916           "required": true,
1917           "description": "Overall timeout for executing all the operations. This timeout should equal or exceed the total
1918 timeout for each operation listed.
1919 ",
1920           "type": "integer"
1921         },
1922         "id": {
1923           "required": true,
1924           "description": "The unique control loop id.",
1925           "type": "string"
1926         },
1927         "trigger": {
1928           "required": true,
1929           "description": "Initial operation to execute upon receiving an Onset event message for the Control Loop.",
1930           "type": "string"
1931         }
1932       },
1933       "description": "Operational Policy for Control Loop execution. Originated in Frankfurt to support TOSCA Compliant
1934 Policy Types. This does NOT support the legacy Policy YAML policy type.
1935 ",
1936       "version": "1.0.0",
1937       "name": "onap.policies.controlloop.operational.Common"
1938     },
1939     "onap.policies.controlloop.operational.common.Apex": {
1940       "derived_from": "onap.policies.controlloop.operational.Common",
1941       "properties": {
1942         "javaProperties": {
1943           "required": false,
1944           "description": "Name/value pairs of properties to be set for APEX if needed.",
1945           "type": "string"
1946         },
1947         "eventInputParameters": {
1948           "required": true,
1949           "description": "The event input parameters.",
1950           "type": "string"
1951         },
1952         "eventOutputParameters": {
1953           "required": true,
1954           "description": "The event output parameters.",
1955           "type": "string"
1956         },
1957         "engineServiceParameters": {
1958           "required": true,
1959           "description": "The engine parameters like name, instanceCount, policy implementation, parameters etc.",
1960           "type": "string"
1961         }
1962       },
1963       "description": "Operational policies for Apex PDP",
1964       "version": "1.0.0",
1965       "type_version": "1.0.0",
1966       "name": "onap.policies.controlloop.operational.common.Apex"
1967     }
1968   },
1969   "tosca_definitions_version": "tosca_simple_yaml_1_1_0",
1970   "node_types": {
1971     "org.onap.policy.clamp.controlloop.ControlLoop": {
1972       "derived_from": "tosca.nodetypes.Root",
1973       "properties": {
1974         "elements": {
1975           "required": true,
1976           "metadata": {
1977             "common": true
1978           },
1979           "entry_schema": {
1980             "type": "onap.datatypes.ToscaConceptIdentifier"
1981           },
1982           "description": "Specifies a list of control loop element definitions that make up this control loop definition",
1983           "type": "list"
1984         },
1985         "provider": {
1986           "required": false,
1987           "metadata": {
1988             "common": true
1989           },
1990           "description": "Specifies the organization that provides the control loop element",
1991           "type": "string"
1992         }
1993       },
1994       "version": "1.0.1"
1995     },
1996     "org.onap.policy.clamp.controlloop.Participant": {
1997       "derived_from": "tosca.nodetypes.Root",
1998       "properties": {
1999         "provider": {
2000           "requred": false,
2001           "type": "string"
2002         }
2003       },
2004       "version": "1.0.1"
2005     },
2006     "org.onap.policy.clamp.controlloop.ControlLoopElement": {
2007       "derived_from": "tosca.nodetypes.Root",
2008       "properties": {
2009         "runningToPassiveTimeout": {
2010           "required": false,
2011           "metadata": {
2012             "common": true
2013           },
2014           "default": 60,
2015           "constraints": [
2016             {
2017               "greater_or_equal": 0
2018             }],
2019           "description": "The maximum time in seconds to wait for a state chage from running to passive",
2020           "type": "integer"
2021         },
2022         "participantType": {
2023           "required": true,
2024           "metadata": {
2025             "common": true
2026           },
2027           "description": "The identity of the participant type that hosts this type of Control Loop Element",
2028           "type": "onap.datatypes.ToscaConceptIdentifier"
2029         },
2030         "startPhase": {
2031           "required": false,
2032           "metadata": {
2033             "common": true
2034           },
2035           "constraints": [
2036             {
2037               "greater_or_equal": 0
2038             }],
2039           "description": "A value indicating the start phase in which this control loop element will be started, the first start phase is zero. Control Loop Elements are started in their start_phase order and stopped in reverse start phase order. Control Loop Elements with the same start phase are started and stopped simultaneously",
2040           "type": "integer"
2041         },
2042         "passiveToUninitializedTimeout": {
2043           "required": false,
2044           "metadata": {
2045             "common": true
2046           },
2047           "default": 60,
2048           "constraints": [
2049             {
2050               "greater_or_equal": 0
2051             }],
2052           "description": "The maximum time in seconds to wait for a state chage from passive to uninitialized",
2053           "type": "integer"
2054         },
2055         "uninitializedToPassiveTimeout": {
2056           "required": false,
2057           "metadata": {
2058             "common": true
2059           },
2060           "default": 60,
2061           "constraints": [
2062             {
2063               "greater_or_equal": 0
2064             }],
2065           "description": "The maximum time in seconds to wait for a state chage from uninitialized to passive",
2066           "type": "integer"
2067         },
2068         "participant_id": {
2069           "metadata": {
2070             "common": true
2071           },
2072           "requred": true,
2073           "type": "onap.datatypes.ToscaConceptIdentifier"
2074         },
2075         "provider": {
2076           "required": false,
2077           "metadata": {
2078             "common": true
2079           },
2080           "description": "Specifies the organization that provides the control loop element",
2081           "type": "string"
2082         },
2083         "passiveToRunningTimeout": {
2084           "required": false,
2085           "metadata": {
2086             "common": true
2087           },
2088           "default": 60,
2089           "constraints": [
2090             {
2091               "greater_or_equal": 0
2092             }],
2093           "description": "The maximum time in seconds to wait for a state chage from passive to running",
2094           "type": "integer"
2095         }
2096       },
2097       "version": "1.0.1"
2098     },
2099     "org.onap.policy.clamp.controlloop.PolicyControlLoopElement": {
2100       "derived_from": "org.onap.policy.clamp.controlloop.ControlLoopElement",
2101       "properties": {
2102         "policy_type_id": {
2103           "requred": true,
2104           "type": "onap.datatypes.ToscaConceptIdentifier"
2105         },
2106         "policy_id": {
2107           "requred": false,
2108           "type": "onap.datatypes.ToscaConceptIdentifier"
2109         }
2110       },
2111       "version": "1.0.1"
2112     }
2113   }
2114 }