Versions Compared

Key

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

...

PDP EngineContent-TypeDescription
PDP-D: Drools

application/vnd.onap.drools+text

application/vnd.onap.drools.mvn+xml

Drools DRL text files. Question: Does Drools have a custom content-type already??

Maven XML dependency specification for a java artifact containing drools rules. Does maven have a custom content-type??

PDP-X: XACMLapplication/xacml+xml; version=3.0

PerĀ http://docs.oasis-open.org/xacml/xacml-rest/v1.0/cos01/xacml-rest-v1.0-cos01.html

PDP-A: Apexapplication/vnd.onap.apex+jsonApex JSON policy files. TBC with Apex team

2.1 PDP-D Content-Types

Two Content-Types can be used by policy authors to create native drools rules - "application/vnd.onap.drools+text" and "application/vnd.onap.drools.mvn+xml".

...

Code Block
languagexml
titleExample payload with "application/vnd.onap.drools.mvn+xml" Content-Type
linenumberstrue
<project xmlns="http://maven.apache.org/POM/4.0.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>

  <dependencies>
    <dependency>
      <groupId>org.onap.policy.controlloop</groupId>
      <artifactId>policy-ran-optimization</artifactId>
      <version>1.0.0-SNAPSHOT</version>
    </dependency>
  </dependencies>

</project>

2.2 PDP-X Content-Types

pam


2.3 PDP-A Content-Types

TBA


2.4 Endpoint Details

The Policy Lifecycle API will need to support new endpoints that consume these PDP specific Content-Type's as well as the ability to save them to the database.

/nativesReturns a list of ID/Version of natives policieschenfei finish
HTTP MethodEndpointContent-TypeDescriptionExample
POST/natives/{policy-id}*see aboveapplication/vnd.onap.drools.mvn+xml

Creates a native drools policy

using the given id

.

Returns the id, version and

version.

created drl contents.

Note: policy-id is the same as <artifactId> specified in the payload; policy-version is the same as <version> specified in the payload

200

Code Block
{
    "policy-id": "id-1",
    "policy-version" : "1.0.0"
}
GET
,
    "policy-body": "xxxxxxx", 
    "pdp-type": "drools"
}


PUT/natives/{policy-id}application/vnd.onap.drools+text

Updates a native drools policy.

Return the id, version and updated drl contents.

Note: policy-version is an auto-increased version on the original one. For example. the original version is "1.0.0". After this PUT call, the version returned could be "1.0.1".

200

Code Block
{
    "policy-id": "id-1",
    "policy-version": "1.0.1",
    "policy-body": "xxxxxxx",
    "pdp-type": "drools" 
}


GET/natives

application/json

application/yaml

Returns a list of ID/Version of native policies

200

Code Block
{
  "policies": [
    { "policy-id": "id-1",
      "policy-version": "1.0.0",
      "pdp-type": "drools"
    },
    {
      "policy-id": "id-2",
      "policy-version": "1.1.0",
      "pdp-type": "xacml"
    },
    {
      "policy-id": "id-3",
      "policy-version": "1.2.0",
      "pdp-type": "apex"
    }
  ]
}


GET/natives/{policy-id}

application/json

application/yaml

Get a list of versions

200

Code Block
{
  "policies": [
    { "policy-id": "id-1",
      "policy-version": "1.0.0",
      "pdp-type": "drools"
    },
    {
      "policy-id": "id-1",
      "policy-version": "1.0.1",
      "pdp-type": "drools"
    },
    {
      "policy-id": "id-1",
      "policy-version": "1.0.2",
      "pdp-type": "drools"
    }
  ]
}


GET/natives/{policy-id}/versions/{policy-version}

application/json

application/yaml

Get a particular version

200

Code Block
{
    "policy-id": "id-1",
    "policy-version": "1.0.1",
    "policy-body": "xxxxxxx",
    "pdp-type": "drools" 
}


DELETE/natives/{policy-id}/versions/{policy-version}

application/json

application/yaml

Delete a particular version

200

Code Block
{
  "policies": [

   { "policy-id" : "id-1",
      "policy-version" : "1.0.01",
    } "policy-body": "xxxxxxx",
   ]
}
GET/natives/{policy-id}Get a list of versions
 "pdp-type": "drools" 
}



3. PAP Enhancements

PDP Engines must now register with the PAP the native Content-Type's they support in order for policies to be deployed by the PAP engine to the PDP's. This will require an additional parameter in the Group Deploy/Undeploy to list the supported Content-Type's for the PDP engine. The proposal is to add a field "supportedContentTypes".

...