Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Add the new rule definition to any rule file (currently only default-rules.groovy exists).  There can be more than 1 rule fileMultiple rule files can exist, however a rule can only be defined once, then can subsequently be used multiple times.

...

Now add the useRule clause(s) in the validation section of all targeted entities.  Currently POMBA only has 1 entity defined for default rules (see entity definition here).

useRule contains 2 fields:

  • name: contains the name of the newly created rule.
  • attributes: specifies the location of the attributes to be passed to the rule at runtime; it's a full JSON path, starting from the incoming event's entity section, see example event above.

...

Code Block
languagebash
entity {
  name 'POA-EVENT'
  indexing {
	indices 'default-rules'
  }
  validation {
    // AAI service type
	useRule {
	  name 'validate-service-type'
	  attributes 'context-list.aai.service.type'
	}
	// SDC service type
	useRule {
	  name 'validate-service-type'
	  attributes 'context-list.sdc.service.type'
	}
  }
}

Restart Validation

Validation loads all the rule files at startup, so the pod needs to be restarted.

Since helm is recommended to deploy POMBA, the deployment must be deleted and reinstalled.  (Note that helm upgrade --restart-pods can't be used to restart validation, there's an open helm defect for this)Lastly, restart onap-validation; the container will restart and load the new rules that were added.

Code Block
languagebash
$ dockerhelm ps
CONTAINER IDlist
NAME             IMAGE       REVISION        UPDATED                         STATUS          CHART           NAMESPACE
demo2-pomba             1   ...
73dad4fc56b7            Tue Feb  dockercentral.it.att.com:5100/com.att.ecomp.aai.dev/onap-validation:1902.0.519 20:29:22 2019        DEPLOYED        pomba-4.0.0      onap
...
...
$ docker container restart 73dad4fc56b7
$ helm delete demo2-pomba --purge
$
$ cd ~/oom/kubernetes/pomba
$ helm install . --name demo2-pomba --namespace onap
...


Deploy Updated Rules