Versions Compared

Key

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

...

Native policies can be supported by TOSCA policy type and policy. As for native Drools policy, since native DRL is packaged in JAR which has been deployed to nexus repo along with other dependency JARs, TOSCA policy for native DRL only needs to include the pointer for native JAR as well as necessary information being used by Drools PDP to instantiate a new controller instance with native DRL loaded into memory. Corresponding policy type should be defined and pre-loaded into policy framework so that TOSCA policy for native policy type can then be created off. As for native XACML policy, its contents are basically encoded in XML which is all XACML PDP needs to load into engine and run. Thus, TOSCA policy for native XACML only needs to include this XML content. An URL-encoded string can be created off composed XACML XML and is populated to a string property.

2.1 Native Drools Policy Support

Below is the policy types defined to support native Drools and XACML policies.

Code Block
languageyml
titlePolicy Type for Native Drools Policy
linenumberstrue
collapsetrue
tosca_definitions_version: tosca_simple_yaml_1_0_0
policy_types:
    onap.policies.controlloop.native.Drools:
        derived_from: tosca.policies.Root
        description: a policy type for native drools
        version: 1.0.0
        properties:
            rule_artifact:
                type: onap.datatypes.controlloop.native.rule_artifact
                required: true
                description: specifies rule artifact pointer
            drools_controller:
                type: onap.datatypes.controlloop.native.drools_controller
                required: true
                description: specifies information for drools controller instantiation
  
data_types:
    onap.datatypes.controlloop.native.rule_artifact:
        derived_from: tosca.datatypes.Root
        properties:
            groupId:
                type: string
                required: true
            artifactId:
                type: string
                required: true
            version:
                type: string
                required: true
    onap.datatypes.controlloop.native.drools_controller:
        derived_from: tosca.datatypes.Root
        properties:
            controllerName:
                type: string
                required: true
            sourceTopics:
                type: list
                required: true
                entry_schema:
                    type: onap.datatypes.controlloop.native.dmaap_config
            sinkTopics:
                type: list
                required: true
                entry_schema:
                    type: onap.datatypes.controlloop.native.dmaap_config
    onap.datatypes.controlloop.native.dmaap_config:
        derived_from: tosca.datatypes.Root
        properties:
            topicName:
                type: string
                required: true
            dmaapServer:
                type: string
                required: false   # default if not present
            serialization:
                type: list
                required: true
                entry_schema:
                    type: onap.datatypes.controlloop.native.dmaap.serialization
    onap.datatypes.controlloop.native.dmaap.serialization:
        derived_from: tosca.datatypes.Root
        properties:
            eventCanonicalName:
                type: string
                required: true
            eventFilter:
                type: string
                required: false
            customSerializer:
                type: string
                required: false

2.2 Native XACML Policy Support

Below is the policy types defined to support native XACML policies.

Code Block
languageyml
titlePolicy Type for Native XACML Policy
linenumberstrue
collapsetrue
tosca_definitions_version: tosca_simple_yaml_1_0_0
policy_types:
    onap.policies.controlloop.native.Xacml:
        derived_from: tosca.policies.Root
        description: a policy type for native xacml
        version: 1.0.0
        properties:
            policy:
                type: String
                required: true
                description: The XML XACML 3.0 PolicySet or Policy

...