diff options
Diffstat (limited to 'kubernetes/pomba/charts/pomba-validation-service')
6 files changed, 68 insertions, 25 deletions
diff --git a/kubernetes/pomba/charts/pomba-validation-service/Chart.yaml b/kubernetes/pomba/charts/pomba-validation-service/Chart.yaml index 3fbbb5d8b6..020409da0b 100644 --- a/kubernetes/pomba/charts/pomba-validation-service/Chart.yaml +++ b/kubernetes/pomba/charts/pomba-validation-service/Chart.yaml @@ -15,4 +15,4 @@ apiVersion: v1 description: POMBA Validaton-Service name: pomba-validation-service -version: 3.0.0 +version: 4.0.0 diff --git a/kubernetes/pomba/charts/pomba-validation-service/requirements.yaml b/kubernetes/pomba/charts/pomba-validation-service/requirements.yaml index 9f23fac6f8..71fbbc5ce9 100644 --- a/kubernetes/pomba/charts/pomba-validation-service/requirements.yaml +++ b/kubernetes/pomba/charts/pomba-validation-service/requirements.yaml @@ -14,5 +14,5 @@ dependencies: - name: common - version: ~3.0.0 + version: ~4.x-0 repository: '@local' diff --git a/kubernetes/pomba/charts/pomba-validation-service/resources/appconfig/rule-data-dictionary.properties b/kubernetes/pomba/charts/pomba-validation-service/resources/appconfig/rule-data-dictionary.properties new file mode 100644 index 0000000000..d93f030395 --- /dev/null +++ b/kubernetes/pomba/charts/pomba-validation-service/resources/appconfig/rule-data-dictionary.properties @@ -0,0 +1,9 @@ +rule.datadictionary.hostport={{ .Values.config.dataDictHostPort }} +rule.datadictionary.connect.timeout=1000 +rule.datadictionary.read.timeout=1000 + +# basic authentication: base64 encoding of username:password +rule.datadictionary.credentials={{ .Values.config.dataDictCredentials }} + +# ex: /commonModelElements/instance~nfValuesCatalog~1.0/ +rule.datadictionary.uri=/commonModelElements/{0}~{1}~1.0/validateInstance 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..877e74c7e0 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 @@ -38,31 +38,31 @@ entity { // NDCB-AAI comparison: VF list useRule { name 'NDCB-AAI-attribute-comparison' - attributes 'context-list.ndcb.vfList[*]', 'context-list.aai.vfList[*]' + attributes 'context-list.ndcb.vnfList[*]', 'context-list.aai.vnfList[*]' } // NDCB-AAI comparison: VF-Module list useRule { name 'NDCB-AAI-attribute-comparison' - attributes 'context-list.ndcb.vfList[*].vfModuleList[*]', 'context-list.aai.vfList[*].vfModuleList[*]' + attributes 'context-list.ndcb.vnfList[*].vfModuleList[*]', 'context-list.aai.vnfList[*].vfModuleList[*]' } // NDCB-AAI comparison: VNFC list useRule { name 'NDCB-AAI-attribute-comparison' - attributes 'context-list.ndcb.vfList[*].vnfcList[*]', 'context-list.aai.vfList[*].vnfcList[*]' + attributes 'context-list.ndcb.vnfList[*].vnfcList[*]', 'context-list.aai.vnfList[*].vnfcList[*]' } // NDCB-AAI comparison: VM list useRule { name 'NDCB-AAI-attribute-comparison' - attributes 'context-list.ndcb.vfList[*].vfModuleList[*].vmList[*]', 'context-list.aai.vfList[*].vfModuleList[*].vmList[*]' + attributes 'context-list.ndcb.vnfList[*].vfModuleList[*].vmList[*]', 'context-list.aai.vnfList[*].vfModuleList[*].vmList[*]' } // NDCB-AAI comparison: Network list useRule { name 'NDCB-AAI-attribute-comparison' - attributes 'context-list.ndcb.vfList[*].vfModuleList[*].networkList[*]', 'context-list.aai.vfList[*].vfModuleList[*].networkList[*]' + attributes 'context-list.ndcb.vnfList[*].vfModuleList[*].networkList[*]', 'context-list.aai.vnfList[*].vfModuleList[*].networkList[*]' } // SDNC-AAI comparison: Context level @@ -80,31 +80,31 @@ entity { // SDNC-AAI comparison: VF list useRule { name 'SDNC-AAI-attribute-comparison' - attributes 'context-list.sdnc.vfList[*]', 'context-list.aai.vfList[*]' + attributes 'context-list.sdnc.vnfList[*]', 'context-list.aai.vnfList[*]' } // SDNC-AAI comparison: VF-Module list useRule { name 'SDNC-AAI-attribute-comparison' - attributes 'context-list.sdnc.vfList[*].vfModuleList[*]', 'context-list.aai.vfList[*].vfModuleList[*]' + attributes 'context-list.sdnc.vnfList[*].vfModuleList[*]', 'context-list.aai.vnfList[*].vfModuleList[*]' } // SDNC-AAI comparison: VNFC list useRule { name 'SDNC-AAI-attribute-comparison' - attributes 'context-list.sdnc.vfList[*].vnfcList[*]', 'context-list.aai.vfList[*].vnfcList[*]' + attributes 'context-list.sdnc.vnfList[*].vnfcList[*]', 'context-list.aai.vnfList[*].vnfcList[*]' } // SDNC-AAI comparison: VM list useRule { name 'SDNC-AAI-attribute-comparison' - attributes 'context-list.sdnc.vfList[*].vfModuleList[*].vmList[*]', 'context-list.aai.vfList[*].vfModuleList[*].vmList[*]' + attributes 'context-list.sdnc.vnfList[*].vfModuleList[*].vmList[*]', 'context-list.aai.vnfList[*].vfModuleList[*].vmList[*]' } // SDNC-AAI comparison: Network list useRule { name 'SDNC-AAI-attribute-comparison' - attributes 'context-list.sdnc.vfList[*].vfModuleList[*].networkList[*]', 'context-list.aai.vfList[*].vfModuleList[*].networkList[*]' + attributes 'context-list.sdnc.vnfList[*].vfModuleList[*].networkList[*]', 'context-list.aai.vnfList[*].vfModuleList[*].networkList[*]' } // SDNC-NDCB comparison: Context level @@ -122,49 +122,49 @@ entity { // SDNC-NDCB comparison: VF list useRule { name 'SDNC-NDCB-attribute-comparison' - attributes 'context-list.sdnc.vfList[*]', 'context-list.ndcb.vfList[*]' + attributes 'context-list.sdnc.vnfList[*]', 'context-list.ndcb.vnfList[*]' } // SDNC-NDCB comparison: VF-Module list useRule { name 'SDNC-NDCB-attribute-comparison' - attributes 'context-list.sdnc.vfList[*].vfModuleList[*]', 'context-list.ndcb.vfList[*].vfModuleList[*]' + attributes 'context-list.sdnc.vnfList[*].vfModuleList[*]', 'context-list.ndcb.vnfList[*].vfModuleList[*]' } // SDNC-NDCB comparison: VNFC list useRule { name 'SDNC-NDCB-attribute-comparison' - attributes 'context-list.sdnc.vfList[*].vnfcList[*]', 'context-list.ndcb.vfList[*].vnfcList[*]' + attributes 'context-list.sdnc.vnfList[*].vnfcList[*]', 'context-list.ndcb.vnfList[*].vnfcList[*]' } // SDNC-NDCB comparison: VM list useRule { name 'SDNC-NDCB-attribute-comparison' - attributes 'context-list.sdnc.vfList[*].vfModuleList[*].vmList[*]', 'context-list.ndcb.vfList[*].vfModuleList[*].vmList[*]' + attributes 'context-list.sdnc.vnfList[*].vfModuleList[*].vmList[*]', 'context-list.ndcb.vnfList[*].vfModuleList[*].vmList[*]' } // SDNC-NDCB comparison: Network list useRule { name 'SDNC-NDCB-attribute-comparison' - attributes 'context-list.sdnc.vfList[*].vfModuleList[*].networkList[*]', 'context-list.ndcb.vfList[*].vfModuleList[*].networkList[*]' + attributes 'context-list.sdnc.vnfList[*].vfModuleList[*].networkList[*]', 'context-list.ndcb.vnfList[*].vfModuleList[*].networkList[*]' } // SDC-AAI VNFC type useRule { name 'SDC-AAI-vnfc-type' - attributes 'context-list.sdc.vfList[*].vnfcList[*]', 'context-list.aai.vfList[*].vnfcList[*]' + attributes 'context-list.sdc.vnfList[*].vnfcList[*]', 'context-list.aai.vnfList[*].vnfcList[*]' } // SDC-AAI VNFC node count useRule { name 'SDC-AAI-vnfc-node-count' - attributes 'context-list.sdc.vfList[*].vnfcList[*]', 'context-list.aai.vfList[*].vnfcList[*]' + attributes 'context-list.sdc.vnfList[*].vnfcList[*]', 'context-list.aai.vnfList[*].vnfcList[*]' } // SDC-AAI VF-Module instance useRule { name 'SDC-AAI-vf-module-instance-check' - attributes 'context-list.ndcb.vfList[*].vfModuleList[*]', 'context-list.aai.vfList[*].vfModuleList[*]' + attributes 'context-list.sdc.vnfList[*].vfModuleList[*]', 'context-list.aai.vnfList[*].vfModuleList[*]' } } } @@ -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.vnfList[*].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) + ''' +} diff --git a/kubernetes/pomba/charts/pomba-validation-service/templates/deployment.yaml b/kubernetes/pomba/charts/pomba-validation-service/templates/deployment.yaml index f802245c5a..df62915b64 100644 --- a/kubernetes/pomba/charts/pomba-validation-service/templates/deployment.yaml +++ b/kubernetes/pomba/charts/pomba-validation-service/templates/deployment.yaml @@ -104,6 +104,8 @@ spec: path: validation-service-auth.properties - key: rule-indexing.properties path: rule-indexing.properties + - key: rule-data-dictionary.properties + path: rule-data-dictionary.properties - key: aai-environment.properties path: aai-environment.properties - key: schemaIngest.properties diff --git a/kubernetes/pomba/charts/pomba-validation-service/values.yaml b/kubernetes/pomba/charts/pomba-validation-service/values.yaml index bb513cf001..d0b964e5e3 100644 --- a/kubernetes/pomba/charts/pomba-validation-service/values.yaml +++ b/kubernetes/pomba/charts/pomba-validation-service/values.yaml @@ -37,7 +37,6 @@ pullPolicy: IfNotPresent debugEnabled: false # application configuration -# Example: config: appDir: /opt/app/validation-service configDir: /opt/app/validation-service/appconfig @@ -45,8 +44,8 @@ config: configTopicsDir: /opt/app/validation-service/appconfig/topics rulesDir: /opt/app/validation-service/bundleconfig/etc/rules/poa-event maxHeap: 1024 -# username: myusername -# password: mypassword + dataDictHostPort: http://dummy-host:443 + dataDictCredentials: cG9tYmE6cG9tYmE= # default number of instances replicaCount: 1 @@ -57,14 +56,14 @@ affinity: {} # probe configuration parameters liveness: - initialDelaySeconds: 10 + initialDelaySeconds: 30 periodSeconds: 10 # necessary to disable liveness probe when setting breakpoints # in debugger so K8s doesn't restart unresponsive container enabled: false readiness: - initialDelaySeconds: 10 + initialDelaySeconds: 30 periodSeconds: 10 enabled: false |