2 ============LICENSE_START==================================================
4 ===========================================================================
5 Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
6 ===========================================================================
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
11 http://www.apache.org/licenses/LICENSE-2.0
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
18 ============LICENSE_END====================================================
20 <div ng-controller="decisionPolicyController">
23 <div class="form-group row">
24 <div class="form-group col-sm-6">
25 <label>Policy Name:<sup><b>*</b></sup></label> <input type="text"
26 class="form-control" ng-disabled="temp.policy.readOnly"
27 ng-readonly="temp.policy.editPolicy"
28 ng-model="temp.policy.policyName" required pattern="\S+"
29 title="Enter Policy Name without any spaces and special characters and will accept _." />
31 <div class="form-group col-sm-6">
32 <label>Description:</label> <input type="text" class="form-control"
33 ng-disabled="temp.policy.readOnly"
34 ng-model="temp.policy.policyDescription"
35 title="Description field will accept any type of data." />
38 <div class="form-group row">
39 <div class="form-group col-sm-6">
40 <label>Onap Name:<sup><b>*</b></sup></label> <select
41 class="form-control" ng-disabled="temp.policy.readOnly"
42 ng-model="temp.policy.onapName"
43 ng-options="option for option in onapNameDictionaryDatas track by option"
44 required pattern="\S+"
45 title="Select the dropdown value driven from OnapName (common)Dictionary."></select>
47 <div class="form-group col-sm-6">
48 <label>Rule Provider:<sup><b>*</b></sup></label><select
49 class="form-control" ng-disabled="temp.policy.readOnly"
50 ng-model="temp.policy.ruleProvider"
51 ng-init="providerListener(temp.policy.ruleProvider);"
52 ng-click="providerListener(temp.policy.ruleProvider);">
53 <option>Custom</option>
55 <option>Rainy_Day</option>
56 <option>GUARD_YAML</option>
57 <option>GUARD_BL_YAML</option>
62 <div ng-if="temp.policy.ruleProvider == 'Rainy_Day'">
64 <div class="form-group row">
65 <div class="form-group row">
66 <div class="form-group col-sm-1">
67 <label>Service Type:<sup><b>*</b></sup></label>
69 <div class="form-group col-sm-2">
70 <input type="text" class="form-control"
71 ng-disabled="temp.policy.readOnly"
72 ng-model="temp.policy.rainyday.serviceType"
73 placeholder="Service Type" title="Enter Service Type value." />
75 <div class="form-group col-sm-1">
76 <label>VNF Type:<sup><b>*</b></sup></label>
78 <div class="form-group col-sm-2">
79 <input type="text" class="form-control"
80 ng-disabled="temp.policy.readOnly"
81 ng-model="temp.policy.rainyday.vnfType" placeholder="VNF Type"
82 title="Enter VNF Type value." />
84 <div class="form-group col-sm-1">
85 <label>Building Block ID:<sup><b>*</b></sup></label>
87 <div class="form-group col-sm-2">
88 <select class="form-control" ng-disabled="temp.policy.readOnly"
89 ng-model="temp.policy.rainyday.bbid"
90 ng-options="option for option in rainyDayDictionaryDatas track by option"
91 ng-change="getWorkstepValues(temp.policy.rainyday.bbid)"
92 title="Select the dropdown value driven from Rainday Allowed Treatments (Decision)Dictionary.">
93 <option value="">{{temp.policy.rainyday.bbid}}</option>
96 <div class="form-group col-sm-1">
97 <label>Work Step:<sup><b>*</b></sup></label>
99 <div class="form-group col-sm-2">
100 <select class="form-control" ng-disabled="temp.policy.readOnly"
101 ng-model="temp.policy.rainyday.workstep"
102 ng-options="option for option in workstepDictionaryDatas track by option"
103 ng-change="getTreatmentValues(temp.policy.rainyday.bbid, temp.policy.rainyday.workstep)">
104 <option value="">{{temp.policy.rainyday.workstep}}</option>
108 <div class="form-group row">
109 <div class="form-group col-sm-3">
110 <label>Desired Automated Treatments:</label>
111 <button type="button" class="btn btn-default"
112 ng-disabled="temp.policy.readOnly" ng-click="addNewTreatment()">
113 <i class="fa fa-plus"></i>
117 <div class="form-group row">
119 data-ng-repeat="treatmentTableChoice in temp.policy.rainyday.treatmentTableChoices">
120 <div class="form-group row" style="margin-left: 2%">
121 <div class="form-group col-sm-1">
122 <label>Error Code:<sup><b>*</b></sup></label>
124 <div class="form-group col-sm-3">
125 <input type="text" class="form-control"
126 ng-disabled="temp.policy.readOnly"
127 ng-model="treatmentTableChoice.errorcode"
128 placeholder="Error Code" />
130 <div class="form-group col-sm-1">
131 <label>Desired Treatment:<sup><b>*</b></sup></label>
133 <div class="form-group col-sm-3">
134 <select class="form-control" ng-disabled="temp.policy.readOnly"
135 ng-model="treatmentTableChoice.treatment"
136 ng-options="option for option in allowedTreatmentsDatas track by option">
137 <option value="">{{treatmentTableChoice.treatment}}</option>
140 <div class="form-group col-sm-1">
141 <button type="button" class="btn btn-default"
142 ng-disabled="temp.policy.readOnly"
143 ng-click="removeTreatment()">
144 <i class="fa fa-minus"></i>
153 <div ng-if="temp.policy.ruleProvider == 'GUARD_BL_YAML'">
155 <div class="form-group row">
156 <div class="form-group col-sm-1">
157 <label>Guard BlackList YAML Attributes:</label><br>
160 <div class="form-group row">
161 <div class="form-group row" style="margin-left: 2%">
162 <div class="form-group col-sm-3">
163 <label> actor: </label>
165 <div class="form-group col-sm-3">
166 <input type="text" class="form-control"
167 ng-disabled="temp.policy.readOnly"
168 ng-model="temp.policy.yamlparams.actor" placeholder="Actor" />
171 <div class="form-group row" style="margin-left: 2%">
172 <div class="form-group col-sm-3">
173 <label> recipe: </label>
175 <div class="form-group col-sm-3">
176 <input type="text" class="form-control"
177 ng-disabled="temp.policy.readOnly"
178 ng-model="temp.policy.yamlparams.recipe" placeholder="Recipe" />
181 <div class="form-group row" style="margin-left: 2%">
182 <div class="form-group col-sm-3">
183 <label> CLName: </label>
185 <div class="form-group col-sm-3">
186 <input type="text" class="form-control"
187 ng-disabled="temp.policy.readOnly"
188 ng-model="temp.policy.yamlparams.clname" placeholder="CLName" />
191 <div class="form-group row" style="margin-left: 2%">
192 <div class="form-group col-sm-3">
193 <label> guardActiveStart: </label>
195 <div class="form-group col-sm-3">
196 <input type="text" class="form-control"
197 ng-disabled="temp.policy.readOnly"
198 ng-model="temp.policy.yamlparams.guardActiveStart"
199 placeholder="00:00:00-05:00" />
202 <div class="form-group row" style="margin-left: 2%">
203 <div class="form-group col-sm-3">
204 <label> guardActiveEnd: </label>
206 <div class="form-group col-sm-3">
207 <input type="text" class="form-control"
208 ng-disabled="temp.policy.readOnly"
209 ng-model="temp.policy.yamlparams.guardActiveEnd"
210 placeholder="00:00:00-05:00" />
213 <div class="form-group row" style="margin-left: 2%">
214 <div class="form-group col-sm-3">
215 <label> BlackList Entry Type: </label>
217 <div class="form-group col-sm-3">
218 <select class="form-control"
219 ng-model="temp.policy.blackListEntryType"
220 ng-disabled="temp.policy.readOnly"
221 ng-change="initializeBlackList(temp.policy.blackListEntryType)">
222 <option>Use Manual Entry</option>
223 <option>Use File Upload</option>
227 <div class="form-group row" style="margin-left: 2%">
228 <div class="form-group col-sm-3">
229 <label>Export BlackList Entries:</label>
231 <div class="form-group col-sm-3">
232 <button type="button" class="btn btn-default"
233 ng-disabled="disableOnCreate"
234 ng-click="exportBlackListEntries()">Export BlackList</button>
237 <div ng-if="temp.policy.blackListEntryType == 'Use File Upload'"
238 class="form-group row" style="margin-left: 2%">
239 <div class="form-group col-sm-3">
240 <label>Upload BlackList: </label>
242 <div class="form-group col-sm-4">
243 <input type="file" name="file" class="form-control"
245 onchange="angular.element(this).scope().uploadBLFile(this.files)" />
247 <div class="form-group col-sm-2">
248 <button class="btn btn-primary" ng-disabled="importButton"
249 ng-click="submitUpload()">Upload</button>
252 <div ng-if="temp.policy.blackListEntryType == 'Use File Upload'"
253 class="form-group row" style="margin-left: 2%">
254 <div class="form-group col-sm-3">
255 <label>Search BlackList: </label>
257 <div class="form-group col-sm-4">
258 <input type="text" class="form-control" class="search"
259 placeholder="{{'search'}}..." ng-model="search"> <select
260 class="form-control" multiple ng-disabled="true"
261 style="height: 400px;"
262 ng-model="temp.policy.blackListSearchEntry"
263 ng-options="option for option in blackListEntries | filter:search"></select>
266 <div ng-if="temp.policy.blackListEntryType == 'Use Manual Entry'"
267 class="form-group row" style="margin-left: 2%">
268 <div class="form-group col-sm-3">
269 <label> BlackList: </label>
270 <button type="button" class="btn btn-default"
271 ng-disabled="temp.policy.readOnly" ng-click="addNewBL()">
272 <i class="fa fa-plus"></i>
275 <div class="form-group col-sm-4">
277 data-ng-repeat="choice in temp.policy.yamlparams.blackList track by $index">
278 <div class="form-group row">
279 <div class="form-group col-sm-9">
280 <input type="text" class="form-control"
281 ng-disabled="temp.policy.readOnly"
282 ng-model="temp.policy.yamlparams.blackList[$index]"
283 placeholder="BlackList" />
285 <div class="form-group col-sm-1">
286 <button type="button" class="btn btn-default"
287 ng-disabled="temp.policy.readOnly"
288 ng-click="removeBL(temp.policy.yamlparams.blackList[$index])">
289 <i class="fa fa-minus"></i>
300 <div ng-if="temp.policy.ruleProvider == 'GUARD_YAML'">
302 <div class="form-group row">
303 <div class="form-group col-sm-1">
304 <label>Guard YAML Attributes:</label><br>
307 <div class="form-group row">
308 <div class="form-group row" style="margin-left: 2%">
309 <div class="form-group col-sm-3">
310 <label> actor: </label>
312 <div class="form-group col-sm-3">
313 <input type="text" class="form-control"
314 ng-disabled="temp.policy.readOnly"
315 ng-model="temp.policy.yamlparams.actor" placeholder="Actor" />
318 <div class="form-group row" style="margin-left: 2%">
319 <div class="form-group col-sm-3">
320 <label> recipe: </label>
322 <div class="form-group col-sm-3">
323 <input type="text" class="form-control"
324 ng-disabled="temp.policy.readOnly"
325 ng-model="temp.policy.yamlparams.recipe" placeholder="Recipe" />
328 <div class="form-group row" style="margin-left: 2%">
329 <div class="form-group col-sm-3">
330 <label> CLName: </label>
332 <div class="form-group col-sm-3">
333 <input type="text" class="form-control"
334 ng-disabled="temp.policy.readOnly"
335 ng-model="temp.policy.yamlparams.clname" placeholder="CLName" />
338 <div class="form-group row" style="margin-left: 2%">
339 <div class="form-group col-sm-3">
340 <label> Targets: </label>
341 <button type="button" class="btn btn-default"
342 ng-disabled="temp.policy.readOnly" ng-click="addNewTarget()">
343 <i class="fa fa-plus"></i>
346 <div class="form-group col-sm-4">
348 data-ng-repeat="choice in temp.policy.yamlparams.targets track by $index">
349 <div class="form-group row">
350 <div class="form-group col-sm-9">
351 <input type="text" class="form-control"
352 ng-disabled="temp.policy.readOnly"
353 ng-model="temp.policy.yamlparams.targets[$index]"
354 placeholder="Target" />
356 <div class="form-group col-sm-1">
357 <button type="button" class="btn btn-default" ng-show="$last"
358 ng-disabled="temp.policy.readOnly" ng-click="removeTarget()">
359 <i class="fa fa-minus"></i>
366 <div class="form-group row" style="margin-left: 2%">
367 <div class="form-group col-sm-3">
368 <label> limit: </label>
370 <div class="form-group col-sm-3">
371 <input type="text" class="form-control"
372 ng-disabled="temp.policy.readOnly"
373 ng-model="temp.policy.yamlparams.limit" placeholder="Limit"
374 title="Enter time limit value." />
377 <div class="form-group row" style="margin-left: 2%">
378 <div class="form-group col-sm-3">
379 <label> timeWindow: </label>
381 <div class="form-group col-sm-2">
382 <input type="text" class="form-control"
383 ng-disabled="temp.policy.readOnly"
384 ng-model="temp.policy.yamlparams.timeWindow"
385 placeholder="Time Window" title="Enter time window value." />
387 <div class="form-group col-sm-1">
388 <select class="form-control" ng-disabled="temp.policy.readOnly"
389 ng-model="temp.policy.yamlparams.timeUnits"
390 title="Select the Time Units value from dropdown options.">
391 <option>minute</option>
392 <option>hour</option>
394 <option>week</option>
395 <option>month</option>
396 <option>year</option>
400 <div class="form-group row" style="margin-left: 2%">
401 <div class="form-group col-sm-3">
402 <label> guardActiveStart: </label>
404 <div class="form-group col-sm-3">
405 <input type="text" class="form-control"
406 ng-disabled="temp.policy.readOnly"
407 ng-model="temp.policy.yamlparams.guardActiveStart"
408 title="Enter Guard Active Start value in following patren '00:00:00-05:00'."
409 placeholder="00:00:00-05:00" />
412 <div class="form-group row" style="margin-left: 2%">
413 <div class="form-group col-sm-3">
414 <label> guardActiveEnd: </label>
416 <div class="form-group col-sm-3">
417 <input type="text" class="form-control"
418 ng-disabled="temp.policy.readOnly"
419 ng-model="temp.policy.yamlparams.guardActiveEnd"
420 title="Enter Guard Active End value in following patren '00:00:00-05:00'."
421 placeholder="00:00:00-05:00" />
429 <div ng-if="temp.policy.ruleProvider == 'Custom'">
431 <div class="form-group row">
432 <div class="form-group col-sm-1">
433 <label>Component Attributes:</label><br>
434 <button type="button" class="btn btn-default"
435 ng-disabled="temp.policy.readOnly" ng-click="addNewChoice()"
436 title="onClick Component Attribute row is added.">
437 <i class="fa fa-plus"></i>
441 <div class="form-group row">
442 <div data-ng-repeat="choice in temp.policy.attributes">
443 <div class="form-group row" style="margin-left: 2%">
444 <div class="form-group col-sm-3">
445 <select class="form-control" ng-disabled="temp.policy.readOnly"
446 ng-model="choice.key"
447 ng-options="option for option in attributeDictionaryDatas track by option"
448 title="Select the dropdown value driven from Attribute (common)Dictionary.">
449 <option value="">{{choice.key}}</option>
452 <div class="form-group col-sm-3">
453 <input type="text" class="form-control"
454 ng-disabled="temp.policy.readOnly" ng-model="choice.value"
455 placeholder="Attribute Value"
456 title="Enter the Attribute Value without any spaces and special characters" />
458 <div class="form-group col-sm-1">
459 <button type="button" class="btn btn-default" ng-show="$last"
460 ng-disabled="temp.policy.readOnly" ng-click="removeChoice()"
461 title="onClick will remove the last row">
462 <i class="fa fa-minus"></i>
471 <div ng-if="temp.policy.ruleProvider == 'Custom'">
473 <div class="form-group row">
474 <div class="form-group col-sm-1">
475 <label>Settings Attributes:</label><br>
476 <button type="button" class="btn btn-default"
477 ng-disabled="temp.policy.readOnly"
478 ng-click="addNewSettingsChoice()"
479 title="onClick Settings Attribute row is added.">
480 <i class="fa fa-plus"></i>
484 <div class="form-group row">
485 <div data-ng-repeat="settingschoice in temp.policy.settings">
486 <div class="form-group row" style="margin-left: 2%">
487 <div class="form-group col-sm-3">
488 <select class="form-control" ng-disabled="temp.policy.readOnly"
489 ng-model="settingschoice.key"
490 ng-options="option for option in settingsDictionaryDatas track by option"
491 title="Select the dropdown value driven from Settings (Decision)Dictionary.">
492 <option value="">{{settingschoice.key}}</option>
495 <div class="form-group col-sm-3">
496 <input type="text" class="form-control"
497 ng-disabled="temp.policy.readOnly"
498 ng-model="settingschoice.value" placeholder="Settings Value"
499 title="Enter the Settings Attribute Value without any spaces and special characters" />
501 <div class="form-group col-sm-1">
502 <button type="button" class="btn btn-default" ng-show="$last"
503 ng-disabled="temp.policy.readOnly"
504 ng-click="removeSettingsChoice()"
505 title="onClick will remove the last row">
506 <i class="fa fa-minus"></i>
515 <div ng-if="temp.policy.ruleProvider == 'Custom'">
517 <label>Decision Rule Algorithms:<sup><b></b></sup></label><br>
518 <div class="form-group row">
519 <div class="form-group col-sm-1">
520 <button type="button" class="btn btn-default"
521 ng-disabled="temp.policy.readOnly"
522 ng-click="addNewRuleAlgorithm()"
523 title="onClick Rule Algorithms row is added.">
524 <i class="fa fa-plus"></i>
528 <div class="form-group row">
530 data-ng-repeat="ruleAlgorithmschoice in temp.policy.ruleAlgorithmschoices">
531 <div class="form-group row" style="margin-left: 2%">
532 <div class="form-group col-sm-1">
534 ng-model="ruleAlgorithmschoice.dynamicRuleAlgorithmLabels"
535 name="dynamicRuleAlgorithmLabels">{{ruleAlgorithmschoice.id}}</label>
537 <div class="form-group col-sm-3">
538 <select class="form-control" id="mySelect"
539 ng-disabled="temp.policy.readOnly"
540 ng-model="ruleAlgorithmschoice.dynamicRuleAlgorithmField1"
541 ng-options="option for option in attributeDictionaryDatas track by option"
542 name="dynamicRuleAlgorithmField1"
543 title="Select the dropdown value driven from Attribute (common)Dictionary or Settings (Decision)Dictionary.">
544 <option value="">{{ruleAlgorithmschoice.dynamicRuleAlgorithmField1}}</option>
547 <div class="form-group col-sm-3">
548 <select type="text" class="form-control"
549 ng-disabled="temp.policy.readOnly"
550 ng-model="ruleAlgorithmschoice.dynamicRuleAlgorithmCombo"
551 ng-options="option for option in functionDefinitionDatas track by option"
552 name="dynamicRuleAlgorithmCombo"
553 title="Select the dropdown value driven from FunctionDataType."></select>
555 <div class="form-group col-sm-3">
556 <input type="text" class="form-control"
557 ng-disabled="temp.policy.readOnly"
558 ng-model="ruleAlgorithmschoice.dynamicRuleAlgorithmField2"
559 name="dynamicRuleAlgorithmField2"
560 title="Enter the Value without any spaces and special characters and for rule formation use A1, A2,..etc., based on above Rules." />
562 <div class="form-group col-sm-1">
563 <button type="button" class="btn btn-default"
564 ng-disabled="temp.policy.readOnly"
565 ng-click="removeRuleAlgorithm()"
566 title="onClick will remove the last row">
567 <i class="fa fa-minus"></i>
576 <div id="validate" style="width: 70%"></div>
578 <div class="modal-footer">
579 <button class="btn btn-primary" herf="javascript:void(0)"
580 ng-disabled="temp.policy.readOnly"
581 ng-click="validatePolicy(temp.policy);"
582 title="Validate the data entered in the Policy fields.">Validate</button>
583 <button class="btn btn-success" herf="javascript:void(0)"
584 ng-disabled="savebutton" ng-disabled="temp.policy.readOnly"
585 ng-click="saveDecisionPolicy(temp);"
586 title="Save the Policy with validated data.">Save</button>
587 <button type="button" class="btn btn-default" ng-click="refresh();"
588 title="Close the template.">Close</button>