Versions Compared

Key

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

...

Taking XACML as another example, some policy authors may want to add customized guard, coordination, etc. XACML policies in which using a TOSCA Policy Type abstraction does not make sense or simply isn't required.

Table of Contents

1. Native

...

Policy Development Guidelines

1.1 Drools Native

...

Policies

1.1.1 DRL development

DRL development refers to the composition of drl file which contains one or more drools rules written in drools language. These drools rules work together to fulfill policy decision making logic required by new custom application.

...

Dependency JAR developer should use development best practices/governance to test/deploy new and/or updated java artifacts to the nexus repo for drools PDP-D. These new java development should go through git review process and include necessary junit tests to make sure they will behave correctly as expected.

1.1.3 Drools controller configuration

TODO

1.2 XACML XML

XACML Policy Designers can use a text or XML editor of their choice to design and test their XACML Policies. The Github:att/XACML project has tools and a GUI available for creating policies and testing those 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.Native:
        derived_from: tosca.policies.Root
        description: a base policy type for all native PDP policies.controlloop
        version: 1.0.0
    onap.policies.native.Drools:
        derived_from: toscaonap.policies.RootNative
        description: a policy type for native drools policies
        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
            dmaapServerserialization:
                type: stringlist
                required: falsetrue
  # default if not present             serialization:
                type: list
                required: true
                entryentry_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

...

Code Block
languageyml
titleExample TOSCA policy for native Drools rules
linenumberstrue
collapsetrue
tosca_definitions_version: tosca_simple_yaml_1_0_0
topology_template:
  policies:
    - 
        Example_policy_name:
            type: onap.policies.controlloop.native.Drools
            version: 1.0.0
            metadata:
                policy-id: Example_policy_name
            properties:
                rule_artifact:
                    groupId: org.onap.policy.native
                    artifactId: example_controlloop
                    version: 1.0.0-SNAPSHOT
                drools_controller:
                    controllerName: example_controller_name
                    sourceTopics: 
                        -
                            topicName: POLICY_INPUT
           
                dmaapServer: example_dmaap_server                             serialization:
                                - 
                                    eventCanonicalName: org.onap.policy.controlloop.event.ControlLoopEvent
                                    eventFilter: [?($.closedLoopControlName == 'example_controlloop_name')]
                                    customSerializer: org.onap.policy.controlloop.utils.serializer,gson
                        -
                            topicName: SDNR_TO_POLICY
                            dmaapServerserialization:
example_dmaap_server                             serialization:   - 
                            -                                      eventCanonicalName: eventCanonicalName: org.onap.policy.controlloop.event.Response
                                    eventFilter: [?($.closedLoopControlName == 'example_controlloop_name' && $.action == 'example_action')]
                                    customSerializer: org.onap.policy.controlloop.utils.serializer,gson
                    sinkTopics: 
                        -
                            topicName: POLICY_TO_SDNR
                
           dmaapServer: example_dmaap_server                             serialization:
                                - 
                                    eventCanonicalName: org.onap.policy.controlloop.event.Request
                                    eventFilter: [?($.closedLoopControlName == 'example_controlloop_name' && $.action == 'example_action')]
                                    customSerializer: org.onap.policy.controlloop.utils.serializer,gson

...

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

...