...
Code Block | ||
---|---|---|
| ||
tosca_definitions_version: tosca_simple_yaml_1_0_0 topology_template: policies: - operational.opex.energysaving.ericsson: type: onap.policies.controlloop.Operational type_version: 1.0.0 type_impl: onap.policies.controlloop.operational.opex.energysaving.Impl type_impl_version: 1.0.0 version: 1.0.0 metadata: policy-id: operational.opex.energysaving.ericsson properties: null - operational.opex.trafficoffloading: type: onap.policies.controlloop.Operational type_version: 1.0.0 type_impl: onap.policies.controlloop.operational.opex.trafficoffloading.Impl type_impl_version: 1.0.0 version: 1.0.0 metadata: policy-id: operational.opex.trafficoffloading properties: ClosedLoopControlName: traffic-offloading-acute |
flow explanation, role of PAP and PDP-D,
sequence diagramNote that preceding policy type implementation list contains two elements. One is for opex.energysaving rules whereas the other is for opex.trafficoffloading rules. Here, energy saving and traffic offloading are two example use cases which use drools rules for decision making. Let's assume energy saving rules do not have configurable properties while traffic offloading rules contain configurable properties (e.g. ${ClosedLoopControlName}), which justifies that in the corresponding policies created off, we can see "properties: null" for energy saving and "properties: ClosedLoopControlName: xxx" for traffic offloading shown above.
Policy type, type implementation and policy are all stored in policy DB. As a follow-up after POST policy type impl and policy API calls, native policy author needs to call PAP policy deployment API to deploy native policies to PDP engine (e.g. drools). PAP will pull the policy and corresponding type implementation from DB then send them to appropriate PDP engine. Taking drools as one example, after PDP-D receives native policy and its type implementation from PAP, it will first pull necessary dependency artifact JARs from internal nexus based on what specified in "properties.dependencies" then copy them to local m2 repo. Next, PDP-D will package native rules into a new JAR and copy to local m2 as well. At last, PDP-D will instantiate a new drools controller instance based on what provided in "properties.controller" then invoke telemetry API to spin up the new drools controller.
Sequence diagram
TBA
Option 2: Native policy rules being provided through policy design API whereas peripheral configuration (i.e. java dependencies, drools controller configuration) being provided through PAP policy deployment API
In this design option, only native policy rules are being provided in POST policy type implementation payload via custom content-type (e.g. application/drl, application/xacml, application/apex). Other dependencies and configuration are being provided in PAP policy deployment API call. The basic idea of this design option is, in policy design phrase, native policy author just needs to focus on composing native policy rules to realize predefined decision making logic, without worrying about how to setup/configure peripheral stuffs like dmaap server/topics and new drools controller instance. After finishing up policy rule handcrafting and later in policy deployment phrase, policy author can start considering about how to setup/configure other things to make sure native rules can be running correctly in appropriate PDP engine. It implies that when PAP policy deployment API
...
xxx
is invoked, necessary configurations required by PDP engine to correctly execute native rules need to be provided in the payload of this policy deployment POST call. Along with native policy and its type implementation, they will all be sent to PDP engine for execution.
Endpoint paths will remain the same in this option except that content-type will be customized to PDP engine specific one.
HTTP Method | Endpoint | Content-Type | Description |
---|---|---|---|
POST/GET | /policytypes/{policyTypeName}/versions/{policyTypeVersion}/policytypeimpls | application/drl application/xacml application/apex | Create new custom policy type implementation(s) for an existing policy type version Retrieve custom policy type implementation(s) for an existing policy type version |
GET/PUT/DELETE | /policytypes/{policyTypeName}/versions/{policyTypeVersion}/policytypeimpls/{policyTypeImplName}/versions/{policyTypeImplVersion} | application/drl application/xacml application/apex | Retrieve a particular version of policy type implementation for an existing policy type version Update a particular version of policy type implementation for an existing policy type version Delete a particular version of policy type implementation for an existing policy type version |
GET | /policytypes/{policyTypeName}/versions/{policyTypeVersion}/policytypeimpls/{policyTypeImplName}/versions/latest | application/drl application/xacml application/apex | Retrieve the latest version of policy type implementation for an existing policy type version |
POST/GET | /policytypes/{policyTypeName}/versions/{policyTypeVersion}/policytypeimpls/{policyTypeImplName}/versions/{policyTypeImplVersion}/policies | application/yaml application/json | Create new polic(ies) off existing policy type and type implementation Retrieve polic(ies) created off existing policy type and type implementation |
GET/PUT/DELETE | /policytypes/{policyTypeName}/versions/{policyTypeVersion}/policytypeimpls/{policyTypeImplName}/versions/{policyTypeImplVersion}/policies/{policyName}/versions/{policyVersion} | application/yaml application/json | Retrieve a particular version of policy created off existing policy type and type implementation Update a particular version of policy created off existing policy type and type implementation Delee a particular version of policy created off existing policy type and type implementation |
GET | /policytypes/{policyTypeName}/versions/{policyTypeVersion}/policytypeimpls/{policyTypeImplName}/versions/{policyTypeImplVersion}/policies/{policyName}/versions/latest | application/yaml application/json | Retrieve the latest version of policy created off existing policy type and type implementation |
GET | /policytypes/{policyTypeName}/versions/{policyTypeVersion}/policytypeimpls/{policyTypeImplName}/versions/{policyTypeImplVersion}/policies/{policyName}/versions/deployed | application/yaml application/json | Retrieve the deployed version(s) of policy created off existing policy type and type implementation |
Policy payload will remain the same as that in option 1.
Flow explanation
TBA
Sequence diagram
TBA