91e73d180bb888bc14e617b465b8cee7d6aab2ce
[nonrtric.git] / test / usecases / oruclosedlooprecovery / apexpolicyversion / LinkMonitor / models / LinkMonitorModelJavascript_0.0.1.apex
1 #-------------------------------------------------------------------------------
2 # ============LICENSE_START=======================================================
3 # Copyright (C) 2021 Nordix Foundation.
4 # ================================================================================
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 #      http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #
17 # SPDX-License-Identifier: Apache-2.0
18 # ============LICENSE_END=========================================================
19 #-------------------------------------------------------------------------------
20
21 ##### Model #####
22
23 model create name=LinkMonitorModel version=0.0.1 uuid=540226fb-55ee-4f0e-a444-983a0494818e description="This is the Apex Policy Model for link monitoring."
24
25
26 ##### Schemas #####
27
28 schema create name=LinkFailureInputSchema flavour=Avro schema=LS
29 #MACROFILE:"examples/LinkMonitor/schemas/LinkFailureInputSchema.avsc"
30 LE
31 schema create name=LinkFailureOutputSchema flavour=Avro schema=LS
32 #MACROFILE:"examples/LinkMonitor/schemas/LinkFailureOutputSchema.avsc"
33 LE
34 schema create name=MessageSchema description="A schema for messages from apex" flavour=Java schema=java.lang.String
35 schema create name=OruIdSchema description="A schema for O-RU-ID" flavour=Java schema=java.lang.String
36 schema create name=OduIdSchema description="A schema for O-DU-ID" flavour=Java schema=java.lang.String
37
38
39 ##### Tasks #####
40
41 task create name=LinkFailureTask version=0.0.1 uuid=3351b0f4-cf06-4fa2-8823-edf67bd30223 description=LS
42 This task updates the config for O-RU when link failure is detected.
43 LE
44 task inputfield create name=LinkFailureTask fieldName=OruId schemaName=OruIdSchema
45 task inputfield create name=LinkFailureTask fieldName=OduId schemaName=OduIdSchema
46 task outputfield create name=LinkFailureTask fieldName=LinkFailureOutput schemaName=LinkFailureOutputSchema
47 task logic create name=LinkFailureTask logicFlavour=JAVASCRIPT logic=LS
48 #MACROFILE:"examples/LinkMonitor/models/LinkFailureLogic.js"
49 LE
50
51 task create name=LinkClearedTask version=0.0.1 uuid=eecfde90-896c-4343-8f9c-2603ced94e2d description=LS
52 This task sends a message to the output when link failure is cleared.
53 LE
54 task inputfield create name=LinkClearedTask fieldName=OruId schemaName=OruIdSchema
55 task outputfield create name=LinkClearedTask fieldName=message schemaName=MessageSchema
56 task logic create name=LinkClearedTask logicFlavour=JAVASCRIPT logic=LS
57 #MACROFILE:"examples/LinkMonitor/models/LinkClearedLogic.js"
58 LE
59
60 task create name=NoPolicyDefinedTask version=0.0.1 uuid=d48b619e-d00d-4008-b884-02d76ea4350b description=LS
61 This task sends a message to the output when an event is received for which no policy has been defined.
62 LE
63 task inputfield create name=NoPolicyDefinedTask fieldName=LinkFailureInput schemaName=LinkFailureInputSchema
64 task outputfield create name=NoPolicyDefinedTask fieldName=message schemaName=MessageSchema
65 task logic create name=NoPolicyDefinedTask logicFlavour=JAVASCRIPT logic=LS
66 #MACROFILE:"examples/LinkMonitor/models/NoPolicyDefinedLogic.js"
67 LE
68
69 task create name=CreateLinkClearedOutfieldsTask version=0.0.1 uuid=fd594e88-411d-4a94-b2be-697b3a0d7adf description=LS
70 This task creates the output fields when link failure is cleared.
71 LE
72 task inputfield create name=CreateLinkClearedOutfieldsTask fieldName=LinkFailureInput schemaName=LinkFailureInputSchema
73 task outputfield create name=CreateLinkClearedOutfieldsTask fieldName=OruId schemaName=OruIdSchema
74 task logic create name=CreateLinkClearedOutfieldsTask logicFlavour=JAVASCRIPT logic=LS
75 #MACROFILE:"examples/LinkMonitor/models/CreateLinkClearedOutfieldsLogic.js"
76 LE
77
78 task create name=CreateLinkFailureOutfieldsTask version=0.0.1 uuid=ac3d9842-80af-4a98-951c-bd79a431c613 description=LS
79 This task the output fields when link failure is detected.
80 LE
81 task inputfield create name=CreateLinkFailureOutfieldsTask fieldName=LinkFailureInput schemaName=LinkFailureInputSchema
82 task outputfield create name=CreateLinkFailureOutfieldsTask fieldName=OruId schemaName=OruIdSchema
83 task outputfield create name=CreateLinkFailureOutfieldsTask fieldName=OduId schemaName=OduIdSchema
84 task logic create name=CreateLinkFailureOutfieldsTask logicFlavour=JAVASCRIPT logic=LS
85 #MACROFILE:"examples/LinkMonitor/models/CreateLinkFailureOutfieldsLogic.js"
86 LE
87
88
89 ##### Events #####
90
91 event create name=LinkFailureInputEvent version=0.0.1 uuid=c4500941-3f98-4080-a9cc-5b9753ed050b source=DMAAP target=APEX
92 event parameter create name=LinkFailureInputEvent parName=LinkFailureInput schemaName=LinkFailureInputSchema
93
94 event create name=LinkFailureOutputEvent version=0.0.1 uuid=4f04aa98-e917-4f4a-882a-c75ba5a99374 source="APEX" target="OAM"
95 event parameter create name=LinkFailureOutputEvent parName=LinkFailureOutput schemaName=LinkFailureOutputSchema
96
97 event create name=ApexMessageOutputEvent version=0.0.1 uuid=cca47d74-7754-4a61-b163-ca31f66b157b source="APEX" target="APEX"
98 event parameter create name=ApexMessageOutputEvent parName=message schemaName=MessageSchema
99
100 event create name=CreateLinkClearedOutfieldsEvent version=0.0.1 source="APEX" target="APEX"
101 event parameter create name=CreateLinkClearedOutfieldsEvent parName=OruId schemaName=OruIdSchema
102
103 event create name=CreateLinkFailureOutfieldsEvent version=0.0.1 source="APEX" target="APEX"
104 event parameter create name=CreateLinkFailureOutfieldsEvent parName=OruId schemaName=OruIdSchema
105 event parameter create name=CreateLinkFailureOutfieldsEvent parName=OduId schemaName=OduIdSchema
106
107
108 ##### Policy #####
109
110 policy create name=LinkMonitorPolicy version=0.0.1 uuid=6c5e410f-489a-46ff-964e-982ce6e8b6d0 template=Freestyle firstState=LinkFailureOrClearedState
111
112
113 ##### States #####
114
115 policy state create name=LinkMonitorPolicy stateName=LinkFailureState triggerName=CreateLinkFailureOutfieldsEvent defaultTaskName=LinkFailureTask
116 policy state output create name=LinkMonitorPolicy stateName=LinkFailureState outputName=LinkFailureLogic_Output_Direct eventName=LinkFailureOutputEvent nextState=NULL
117 policy state taskref create name=LinkMonitorPolicy stateName=LinkFailureState taskLocalName=LinkFailureTask taskName=LinkFailureTask outputType=DIRECT outputName=LinkFailureLogic_Output_Direct
118
119 policy state create name=LinkMonitorPolicy stateName=LinkClearedState triggerName=CreateLinkClearedOutfieldsEvent defaultTaskName=LinkClearedTask
120 policy state output create name=LinkMonitorPolicy stateName=LinkClearedState outputName=LinkClearedLogic_Output_Direct eventName=ApexMessageOutputEvent nextState=NULL
121 policy state taskref create name=LinkMonitorPolicy stateName=LinkClearedState taskLocalName=LinkClearedTask taskName=LinkClearedTask outputType=DIRECT outputName=LinkClearedLogic_Output_Direct
122
123 policy state create name=LinkMonitorPolicy stateName=LinkFailureOrClearedState triggerName=LinkFailureInputEvent defaultTaskName=NoPolicyDefinedTask
124 policy state output create name=LinkMonitorPolicy stateName=LinkFailureOrClearedState outputName=CreateLinkFailureOutfieldsLogic_Output_Direct eventName=CreateLinkFailureOutfieldsEvent nextState=LinkFailureState
125 policy state taskref create name=LinkMonitorPolicy stateName=LinkFailureOrClearedState taskLocalName=CreateLinkFailureOutfieldsTask taskName=CreateLinkFailureOutfieldsTask outputType=DIRECT outputName=CreateLinkFailureOutfieldsLogic_Output_Direct
126 policy state output create name=LinkMonitorPolicy stateName=LinkFailureOrClearedState outputName=CreateLinkClearedOutfieldsLogic_Output_Direct eventName=CreateLinkClearedOutfieldsEvent nextState=LinkClearedState
127 policy state taskref create name=LinkMonitorPolicy stateName=LinkFailureOrClearedState taskLocalName=CreateLinkClearedOutfieldsTask taskName=CreateLinkClearedOutfieldsTask outputType=DIRECT outputName=CreateLinkClearedOutfieldsLogic_Output_Direct
128 policy state output create name=LinkMonitorPolicy stateName=LinkFailureOrClearedState outputName=NoPolicyDefinedLogic_Output_Direct eventName=ApexMessageOutputEvent nextState=NULL
129 policy state taskref create name=LinkMonitorPolicy stateName=LinkFailureOrClearedState taskLocalName=NoPolicyDefinedTask taskName=NoPolicyDefinedTask outputType=DIRECT outputName=NoPolicyDefinedLogic_Output_Direct
130 policy state selecttasklogic create name=LinkMonitorPolicy version=0.0.1 stateName=LinkFailureOrClearedState logicFlavour=JAVASCRIPT logic=LS
131 #MACROFILE:"examples/LinkMonitor/models/TaskSelectionLogic.js"
132 LE