OPA-PDP Decision

OPA-PDP Decision

OPA-PDP supports sending structured responses to decision requests. The OPA-PDP response is similar to the output from the Rego playground. The decision response is based on the “policy filter” provided in the decision request, which is mandatory. The “policyFilter” is a list of filter values, allowing multiple filters to be specified for the required output. If the policy filter contains an empty value, all output parameters are displayed. If an incorrect policy filter value is provided, valid input filters are displayed. The policy ID should be mentioned in the “policyName” field. Input field should be populated with json for which decision needs to be validated.

Header

Example value

Description

policyName

cell.consistency

tosca-policy

policyFilter

allow

output parameter

input

{cell:445611193265040128,PCI:2}

input json

/decision

Decision Swagger

This operation performs a decision request on PDP whether PCI value 2 can be modified on cell id 445611193265040128. Here is a sample request:

cell.consistency decision request json
{
  "onapName": "CDS",
  "onapComponent": "CDS",
  "onapInstance": "CDS",
  "currentDateTime": "2025-01-17T08:26:41.857Z",
  "currentDate": "2025-01-17",
  "currentTime": "08:26:41.857Z",
  "timeZone": "UTC",
  "timeOffset": "+08:45",
  "policyName": "cell.consistency",
  "policyFilter": ["allow"],
  "input": {
    "cell": 445611193265040128,
    "PCI": 2
  }
}

As the policy allows changes on cell id 445611193265040128 and the pci is in range change is permitted. Here is a sample response:

cell.consistency decision response
{
  "output": {
    "allow": true
  },
  "policyName": "cell.consistency"
}