Table of Contents | ||
---|---|---|
|
The POMBA Validation Service comes with a set of rules that verify the data provided from the supported context builders. The rules delivered are not exhaustive (refer to the POMBA Rules) but the architecture allows for operators to add their own rules or customize existing rules in order to fulfill their specific needs.
...
In ONAP, POMBA rules are delivered via the OOM project in default-rules.groovy.
The Rule Tester Utility can be used to test and debug new rules.
Update Rules
The structure and logic of the validation rules can be found here: https://wikilf-onap.onapatlassian.orgnet/wiki/display/DW/Validation+Service.
The purpose of this page is to show how to add rules to a POMBA deployment.
...
Rule definitions look like the following code block. Notice that only the content of the groovy method is in the validate
section. (For more examples, see Validation+Service#ValidationService-Examples)
Code Block | ||
---|---|---|
| ||
rule { name 'validate-service-type' category 'INVALID_TYPE' description 'Invalid service type' errorText 'Invalid type - value contains invalid characters, only [a-z,0-9,-] accepted' severity 'MINOR' attributes 'type' validate 'type != null && type.matches("[a-z,0-9,-]*")' } |
...
Code Block | ||
---|---|---|
| ||
$ helm list NAME REVISION UPDATED STATUS CHART NAMESPACE demo2-pomba 1 Tue Feb 19 20:29:22 2019 DEPLOYED pomba-4.0.0 onap ... $ helm delete demo2-pomba --purge $ $ cd ~/oom/kubernetes/pomba $ helm install . --name demo2-pomba --namespace onap ... |
...
Submit Updated Rules to OOM
Once the rule has been properly tested, submit the updated rules file in OOM's validation chart:
If a new rule file has been created, don't forget to update the chart's deployment.yaml.