...
Some endpoint paths are exemplified in the following table:
HTTP Method | Endpoint | Content-Type | Description |
---|---|---|---|
POST/GET | /policytypes/{policyTypeName}/versions/{policyTypeVersion}/policytypeimpls | application/yaml application/json | 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/yaml application/json | 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/yaml application/json | 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 |
Code Block | ||
---|---|---|
| ||
policy_type_impls: - onap.policies.controlloop.operational.opex.energysavingsampleusecase1.Impl: version: 1.0.0 type: onap.policies.controlloop.Operationaloperational.Sampleusecase1 type_version: 1.0.0 pdp: drools description: Implementation of opexsample energyuse savingcase1 drools rules policy_body: "<policy body>" properties: dependencies: - groupId: org.onap.policy.opexsampledomain artifactId: policy-energysample-savingusecase1 version: 1.20.10-SNAPSHOT controller: name: ericssonsample-cell-sleepusecase1 config_body: "<config body>" - onap.policies.controlloop.operational.opexsampleusecase2.trafficoffloading.Impl: version: 1.0.0 type: onap.policies.controlloop.Operationaloperational.Sampleusecase2 type_version: 1.0.0 pdp: drools description: Implementation of opexsample trafficuse offloadingcase2 drools rules policy_body: "<policy body>" properties: dependencies: - groupId: org.onap.policy.opexsampledomain artifactId: policy-trafficsample-offloadingusecase2 version: 1.0.0-SNAPSHOT controller: name: trafficsample-offloadingusecase2 config_body: "<config body>" |
...
Code Block | ||
---|---|---|
| ||
tosca_definitions_version: tosca_simple_yaml_1_0_0 topology_template: policies: - operational.opex.energysaving.ericssonsampleusecase1: type: onap.policies.controlloop.Operationaloperational.Sampleusecase1 type_version: 1.0.0 type_impl: onap.policies.controlloop.operational.opex.energysavingsampleusecase1.Impl type_impl_version: 1.0.0 version: 1.0.0 metadata: policy-id: operational.opex.energysaving.ericssonsampleusecase1 properties: null - operational.opex.trafficoffloadingsampleusecase2: type: onap.policies.controlloop.Operationaloperational.Sampleusecase2 type_version: 1.0.0 type_impl: onap.policies.controlloop.operational.opex.trafficoffloadingsampleusecase2.Impl type_impl_version: 1.0.0 version: 1.0.0 metadata: policy-id: operational.opex.trafficoffloadingsampleusecase2 properties: ClosedLoopControlName: trafficsample-offloadingusecase-acute1 |
Note that the preceding policy type implementation list contains two elements. One is for opex.energysaving sample use case1 rules whereas the other is for opex.trafficoffloading sample use case2 rules. Here, energy saving and traffic offloading sample use case 1 and 2 are two example use cases which use drools rules for decision making. Let's assume energy saving sample use case1 rules do not have configurable properties while traffic offloading sample use case 2 rules contain configurable properties (e.g. ${ClosedLoopControlName}), which justifies that in the corresponding policies created off, we can see "properties: null" for energy saving use case 1 and "properties: ClosedLoopControlName: xxx" for traffic offloading use case 2 as 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.
...
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