summaryrefslogtreecommitdiffstats
path: root/kubernetes/pomba/charts/pomba-validation-service/resources/bundleconfig/etc
diff options
context:
space:
mode:
authorPierre Rioux <pierre.rioux@amdocs.com>2019-01-09 15:41:17 -0500
committerPierre Rioux <pierre.rioux@amdocs.com>2019-01-10 10:24:08 -0500
commit5f4b3db5c14181852d93544716ce6b52ee7ae19d (patch)
treee1ea5bad3116161207a9f51e50f7af386304a2e1 /kubernetes/pomba/charts/pomba-validation-service/resources/bundleconfig/etc
parentd9a8c9ed9247bd82a23d413882a08f63c63dda70 (diff)
[LOG-404] adding data-dictonary config
Change-Id: Ie786aa3d9d3094409c48a741064d39facd3a6f94 Signed-off-by: Pierre Rioux <pierre.rioux@amdocs.com> Issue-ID: LOG-404
Diffstat (limited to 'kubernetes/pomba/charts/pomba-validation-service/resources/bundleconfig/etc')
-rw-r--r--kubernetes/pomba/charts/pomba-validation-service/resources/bundleconfig/etc/rules/poa-event/default-rules.groovy33
1 files changed, 33 insertions, 0 deletions
diff --git a/kubernetes/pomba/charts/pomba-validation-service/resources/bundleconfig/etc/rules/poa-event/default-rules.groovy b/kubernetes/pomba/charts/pomba-validation-service/resources/bundleconfig/etc/rules/poa-event/default-rules.groovy
index 1dc97da288..fd2385af08 100644
--- a/kubernetes/pomba/charts/pomba-validation-service/resources/bundleconfig/etc/rules/poa-event/default-rules.groovy
+++ b/kubernetes/pomba/charts/pomba-validation-service/resources/bundleconfig/etc/rules/poa-event/default-rules.groovy
@@ -481,3 +481,36 @@ rule {
return new Tuple2(result, details)
'''
}
+
+/*
+ * The data-dictionary rule below can be used with this useRule clause:
+ * useRule {
+ * name 'Data-Dictionary validate VF type'
+ * attributes 'context-list.ndcb.vfList[*].vfModuleList[*].networkList[*].type'
+ * }
+ */
+rule {
+ name 'Data-Dictionary validate VF type'
+ category 'INVALID_VALUE'
+ description 'Validate all VF type values against data-dictionary'
+ errorText 'VF type [{0}] failed data-dictionary validation: {1}'
+ severity 'ERROR'
+ attributes 'typeList'
+ validate '''
+ boolean success = true
+ List<String> details = new ArrayList<>()
+ typeList.any {
+ if(!success) {
+ // break out of 'any' loop
+ return false
+ }
+ def result = org.onap.aai.validation.ruledriven.rule.builtin.DataDictionary.validate("instance", "vfModuleNetworkType", "type", "$it")
+ if(!result.isEmpty()) {
+ success = false
+ details.add("$it")
+ details.add("$result")
+ }
+ }
+ return new Tuple2(success, details)
+ '''
+}