Pamela Dragosh | b4a8ef2 | 2020-04-21 15:30:35 -0400 | [diff] [blame] | 1 | .. This work is licensed under a Creative Commons Attribution 4.0 International License. |
| 2 | |
| 3 | .. _decision-api-label: |
| 4 | |
| 5 | Decision API |
Pamela Dragosh | f65c8ff | 2020-04-29 08:23:12 -0400 | [diff] [blame] | 6 | ############ |
Pamela Dragosh | b4a8ef2 | 2020-04-21 15:30:35 -0400 | [diff] [blame] | 7 | |
Pamela Dragosh | f65c8ff | 2020-04-29 08:23:12 -0400 | [diff] [blame] | 8 | The Decision API is used by ONAP components that enforce policies and need a decision on which policy to enforce for a |
| 9 | specific situation. The Decision API mimics closely the XACML request standard in that it supports a subject, action |
| 10 | and resource. |
Pamela Dragosh | b4a8ef2 | 2020-04-21 15:30:35 -0400 | [diff] [blame] | 11 | |
liamfallon | a91dcf9 | 2021-09-29 13:44:34 +0100 | [diff] [blame] | 12 | When the PAP activates an xacml-pdp, the decision API becomes available. Conversely, when the PAP deactivates an xacml-pdp, the |
| 13 | decision API is disabled. The decision API is enabled/disabled by the PDP-STATE-CHANGE messages from PAP. If a request is made |
| 14 | to the decision API while it is deactivated, a "404 - Not Found" error will be returned. |
| 15 | |
Pamela Dragosh | b4a8ef2 | 2020-04-21 15:30:35 -0400 | [diff] [blame] | 16 | .. csv-table:: |
| 17 | :header: "Field", "Required", "XACML equivalent", "Description" |
| 18 | |
| 19 | "ONAPName", "True", "subject", "The name of the ONAP project making the call" |
| 20 | "ONAPComponent", "True", "subject", "The name of the ONAP sub component making the call" |
| 21 | "ONAPInstance", "False", "subject", "An optional instance ID for that sub component" |
| 22 | "action", "True", "action", "The action being performed" |
| 23 | "resource", "True", "resource", "An object specific to the action that contains properties describing the resource" |
| 24 | |
| 25 | It is worth noting that we use basic authorization for API access with username and password set to *healthcheck* and *zb!XztG34* respectively. |
| 26 | Also, the new APIs support both *http* and *https*. |
| 27 | |
| 28 | For every API call, the client is encouraged to insert an uuid-type requestID as parameter. It is helpful for tracking each http transaction |
| 29 | and facilitates debugging. Most importantly, it complies with Logging requirements v1.2. If the client does not provide the requestID in the API call, |
| 30 | one will be randomly generated and attached to the response header *x-onap-requestid*. |
| 31 | |
| 32 | In accordance with `ONAP API Common Versioning Strategy Guidelines <https://wiki.onap.org/display/DW/ONAP+API+Common+Versioning+Strategy+%28CVS%29+Guidelines>`_, |
| 33 | in the response of each API call, several custom headers are added:: |
| 34 | |
| 35 | x-latestversion: 1.0.0 |
| 36 | x-minorversion: 0 |
| 37 | x-patchversion: 0 |
| 38 | x-onap-requestid: e1763e61-9eef-4911-b952-1be1edd9812b |
| 39 | |
| 40 | x-latestversion is used only to communicate an API's latest version. |
| 41 | |
| 42 | x-minorversion is used to request or communicate a MINOR version back from the client to the server, and from the server back to the client. |
| 43 | |
| 44 | x-patchversion is used only to communicate a PATCH version in a response for troubleshooting purposes only, and will be provided to the client on request. |
| 45 | |
| 46 | x-onap-requestid is used to track REST transactions for logging purpose, as described above. |
| 47 | |
Pamela Dragosh | 1d101d2 | 2020-07-09 13:46:16 -0400 | [diff] [blame] | 48 | :download:`Download the Decision API Swagger <swagger.json>` |
| 49 | |
Pamela Dragosh | b4a8ef2 | 2020-04-21 15:30:35 -0400 | [diff] [blame] | 50 | .. swaggerv2doc:: swagger.json |
| 51 | |
| 52 | |
| 53 | End of Document |