Versions Compared

Key

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

...

  • Decision Requests are REST requests sent from ONAP components. Below is the format of Decision API request.

  • API endpoint :- policy/pdpx/v1/decision. Below is the snippet of Decision Request that will be received in Phase-1 .

    Code Block
    Decision Request 
     {
    	"OnapName":      "CDS",
    	"OnapComponent": "CDS",
    	"OnapInstance":  "CDS-component-instance",
    	"Policy":        "role/allow",
    	"input":         
    	  {
    	      "user":"alice",
    	      "action":"read",
    	      "object":"id123",
    	      "type":"dog"
    	  }
    }
    
    curl -u 'policyadmin:zb!XztG34' -H 'Content-Type: application/json' -H 'Accept: application/json'  --header 'X-ONAP-RequestID:8e6f784e-c9cb-42f6-bcc9-edb5d0af1ce1' -d '{"onapName":"CDS","onapComponent":"CDS-component-instance","onapInstance":"CDS","requestIdpolicyName":"8e6f784e-c9cb-42f6-bcc9-edb5d0af1ce1","policy":"role/allow","input":{"user":"alice","action":"read","object":"id123","type":"catdog"}}' -X POST 
    http://0.0.0.0:8282/policy/pdpx/v1/decision
    

Decision Response will contain following parameters

Code Block
{
   "statusCode":"200",
   "statusMessage":"Successful",
   "decision":"PERMIT",
    "policynamepolicyName":"role/allow",
    "errorMessagestatusMessage":"",
   "errorDetails":[""],OPA Allowed"
}

Currently OPA-PDP will respond with either PERMIT, DENY or INDETERMINATE values .

...

Code Block
Request 
curl -u 'policyadmin:zb!XztG34' -H 'Content-Type: application/json' -H 'Accept: application/json' -X GET
http://0.0.0.0:8282/policy/pdpx/v1/healthcheck

Response 
{
  "name": "opa-e007a5f3-28f0-4e0d-84ac-51951550f790",
  "url": "self",
  "healthy": true,
  "code": 200,
  "message": "alive"
}

Statistics :Currently we support only following counters

  • totalErrorCount

  • permitDecisionsCount

  • denyDecisionsCount