...
Code Block |
---|
{ "messageName": "PDP_STATUS", "pdpType": "opa", "state": "ACTIVE", "healthy": "HEALTHY", "description": "Pdp Status Response Message to Pdp State Change", "response": { "responseTo": "3edbb47c-b015-4fd9-9572-26cde97cc23c", "responseStatus": "SUCCESS", "responseMessage": "PDP State Changed From PASSIVE TO Active" }, "policies": null, "name": "opa-949018d3-cc9b-429b-96ae-46ca9c314e42", "requestId": "02b186a6-485d-4392-90fa-d4cac34be97a", "pdpGroup": "defaultGroup", "pdpSubgroup": "opa", "timestampMs": "1731335550069" } |
Currently OPA policies are pre-loaded in the docker setup.
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", "RequestId": "8e6f784e-c9cb-42f6-bcc9-edb5d0af1ce1", "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' -d '{"onapName":"CDS","onapComponent":"CDS-component-instance","onapInstance":"CDS","requestId":"8e6f784e-c9cb-42f6-bcc9-edb5d0af1ce1","policy":"role/allow","input":{"user":"alice","action":"read","object":"id123","type":"cat"}}' -X POST http://0.0.0.0:8282/policy/pdpx/v1/decision
...
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" } |
Currently