aboutsummaryrefslogtreecommitdiffstats
path: root/src/onapsdk/clamp/templates/clamp_add_drools_policy.json.j2
blob: 40ca7cd0bcaad60079e17a48aecb790cf6d194e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
[
  {
    "name": "{{ name }}",
    "jsonRepresentation": {
      "title": "onap.policies.controlloop.operational.common.Drools",
      "type": "object",
      "description": "Operational policies for Drools PDP",
      "required": [
        "abatement",
        "operations",
        "trigger",
        "timeout",
        "id"
      ],
      "properties": {
        "abatement": {
          "type": "boolean",
          "description": "Whether an abatement event message will be expected for the control loop from DCAE.",
          "default": "false"
        },
        "operations": {
          "type": "array",
          "description": "List of operations to be performed when Control Loop is triggered.",
          "items": {
            "title": "onap.datatype.controlloop.Operation",
            "type": "object",
            "description": "An operation supported by an actor",
            "required": [
              "id",
              "operation",
              "retries",
              "timeout"
            ],
            "properties": {
              "failure_retries": {
                "type": "string",
                "description": "Points to the operation to invoke when the current operation has exceeded its max retries.",
                "default": "final_failure_retries"
              },
              "id": {
                "type": "string",
                "description": "Unique identifier for the operation"
              },
              "failure_timeout": {
                "type": "string",
                "description": "Points to the operation to invoke when the time out for the operation occurs.",
                "default": "final_failure_timeout"
              },
              "failure": {
                "type": "string",
                "description": "Points to the operation to invoke on Actor operation failure.",
                "default": "final_failure"
              },
              "operation": {
                "title": "onap.datatype.controlloop.Actor",
                "type": "object",
                "description": "An actor/operation/target definition",
                "required": [
                  "target",
                  "actor",
                  "operation"
                ],
                "properties": {
                  "payload": {
                    "type": "object",
                    "description": "Name/value pairs of payload information passed by Policy to the actor",
                    "anyOf": [
                      {
                        "title": "User defined",
                        "properties": {
                          
                        }
                      }
                    ]
                  },
                  "target": {
                    "title": "onap.datatype.controlloop.Target",
                    "type": "object",
                    "description": "Definition for a entity in A&AI to perform a control loop operation on",
                    "required": [
                      "targetType"
                    ],
                    "properties": {
                      "entityIds": {
                        "type": "object",
                        "description": "Map of values that identify the resource. If none are provided, it is assumed that the\nentity that generated the ONSET event will be the target.\n",
                        "anyOf": [
                          {
                            "title": "User defined",
                            "properties": {
                              
                            }
                          },
                          {
                            "title": "VNF-ubuntu18agent_VF 0",
                            "properties": {
                              "resourceID": {
                                "title": "Resource ID",
                                "type": "string",
                                "default": "6daf6e05-fc26-4aa3-9f0b-d47cf3f37ece",
                                "readOnly": "True"
                              }
                            }
                          },
                          {
                            "title": "VFMODULE-Ubuntu18agentVf..base_ubuntu18..module-0",
                            "properties": {
                              "resourceID": {
                                "title": "Resource ID",
                                "type": "string",
                                "default": "Ubuntu18agentVf..base_ubuntu18..module-0",
                                "readOnly": "True"
                              },
                              "modelInvariantId": {
                                "title": "Model Invariant Id (ModelInvariantUUID)",
                                "type": "string",
                                "default": "2556faee-75dd-448f-8d2f-d4201a957e7c",
                                "readOnly": "True"
                              },
                              "modelVersionId": {
                                "title": "Model Version Id (ModelUUID)",
                                "type": "string",
                                "default": "98df9741-530a-486c-b156-b2cb62e6fc6c",
                                "readOnly": "True"
                              },
                              "modelName": {
                                "title": "Model Name",
                                "type": "string",
                                "default": "Ubuntu18agentVf..base_ubuntu18..module-0",
                                "readOnly": "True"
                              },
                              "modelVersion": {
                                "title": "Model Version",
                                "type": "string",
                                "default": "1",
                                "readOnly": "True"
                              },
                              "modelCustomizationId": {
                                "title": "Customization ID",
                                "type": "string",
                                "default": "ba567b66-e46b-4521-8fdd-54185cb21a7f",
                                "readOnly": "True"
                              }
                            }
                          }
                        ]
                      },
                      "targetType": {
                        "type": "string",
                        "description": "Category for the target type",
                        "enum": [
                          "VNF",
                          "VM",
                          "VFMODULE",
                          "PNF"
                        ]
                      }
                    }
                  },
                  "actor": {
                    "type": "string",
                    "description": "The actor performing the operation.",
                    "enum": [
                      "SDNR",
                      "SDNC",
                      "VFC",
                      "SO",
                      "APPC",
                      "CDS"
                    ],
                    "options": {
                      "enum_titles": [
                        "SDNR",
                        "SDNC",
                        "VFC",
                        "SO",
                        "APPC"
                      ]
                    }
                  },
                  "operation": {
                    "type": "string",
                    "description": "The operation the actor is performing.",
                    "enum": [
                      "BandwidthOnDemand",
                      "VF Module Delete",
                      "Reroute",
                      "VF Module Create",
                      "ModifyConfig",
                      "Rebuild",
                      "Restart",
                      "Migrate",
                      "Health-Check"
                    ],
                    "options": {
                      "enum_titles": [
                        "BandwidthOnDemand (SDNC operation)",
                        "VF Module Delete (SO operation)",
                        "Reroute (SDNC operation)",
                        "VF Module Create (SO operation)",
                        "ModifyConfig (APPC/VFC operation)",
                        "Rebuild (APPC operation)",
                        "Restart (APPC operation)",
                        "Migrate (APPC operation)",
                        "Health-Check (APPC operation)"
                      ]
                    }
                  }
                }
              },
              "failure_guard": {
                "type": "string",
                "description": "Points to the operation to invoke when the current operation is blocked due to guard policy enforcement.",
                "default": "final_failure_guard"
              },
              "retries": {
                "type": "integer",
                "description": "The number of retries the actor should attempt to perform the operation.",
                "default": "0"
              },
              "timeout": {
                "type": "integer",
                "description": "The amount of time for the actor to perform the operation."
              },
              "failure_exception": {
                "type": "string",
                "description": "Points to the operation to invoke when the current operation causes an exception.",
                "default": "final_failure_exception"
              },
              "description": {
                "type": "string",
                "description": "A user-friendly description of the intent for the operation"
              },
              "success": {
                "type": "string",
                "description": "Points to the operation to invoke on success. A value of \"final_success\" indicates and end to the operation.",
                "default": "final_success"
              }
            }
          },
          "format": "tabs-top"
        },
        "trigger": {
          "type": "string",
          "description": "Initial operation to execute upon receiving an Onset event message for the Control Loop."
        },
        "timeout": {
          "type": "integer",
          "description": "Overall timeout for executing all the operations. This timeout should equal or exceed the total\ntimeout for each operation listed.\n"
        },
        "id": {
          "type": "string",
          "description": "The unique control loop id."
        },
        "controllerName": {
          "type": "string",
          "description": "Drools controller properties"
        }
      }
    },
    "configurationsJson": {
      "abatement": false,
      "operations": [
        {
          "failure_retries": "final_failure_retries",
          "id": "policy-1-vfmodule-create",
          "failure_timeout": "final_failure_timeout",
          "failure": "final_failure",
          "operation": {
            "payload": {
              "requestParameters": "{\"usePreload\":false,\"userParams\":[]}",
              "configurationParameters": "[{\"ip-addr\":\"$.vf-module-topology.vf-module-parameters.param[16].value\",\"oam-ip-addr\":\"$.vf-module-topology.vf-module-parameters.param[30].value\"}]"
            },
            "target": {
              "entityIds": {
                "resourceID": "{{ resourceID }}",
                "modelInvariantId": "{{ modelInvariantId }}",
                "modelVersionId": "{{ modelVersionId }}",
                "modelName": "{{ modelName }}",
                "modelVersion": "{{ modelVersion }}",
                "modelCustomizationId": "{{ modelCustomizationId }}"
              },
              "targetType": "VFMODULE"
            },
            "actor": "SO",
            "operation": "VF Module Create"
          },
          "failure_guard": "final_failure_guard",
          "retries": 1,
          "timeout": 300,
          "failure_exception": "final_failure_exception",
          "description": "test",
          "success": "final_success"
        }
      ],
      "trigger": "policy-1-vfmodule-create",
      "timeout": 650,
      "id": "{{ LOOP_name }}"
    },
    "policyModel": {
      "policyModelType": "onap.policies.controlloop.operational.common.Drools",
      "version": "1.0.0",
      "policyAcronym": "Drools",
      "policyPdpGroup": {
        "supportedPdpGroups": [
          {
            "defaultGroup": [
              "drools"
            ]
          }
        ]
      },
      "createdDate": "2020-07-22T01:37:38.528901Z",
      "updatedDate": "2020-07-22T01:37:51.752302Z",
      "updatedBy": "Not found",
      "createdBy": "Not found"
    },
    "createdDate": "2020-07-22T07:50:00.076714Z",
    "updatedDate": "2020-07-22T07:50:00.076714Z",
    "updatedBy": "clamp@clamp.onap.org",
    "createdBy": "clamp@clamp.onap.org",
    "pdpGroup": "defaultGroup",
    "pdpSubgroup": "drools"
  }
]