diff options
author | lapentafd <francesco.lapenta@est.tech> | 2023-03-27 13:46:04 +0100 |
---|---|---|
committer | Francesco Davide Lapenta <francesco.lapenta@est.tech> | 2023-04-04 14:31:45 +0000 |
commit | a43eb545dded63e1f21b7f14105ae0ed093b54db (patch) | |
tree | 54d965ae22f9ed6c39a2d978632ecb0158c3ca16 /docs/offeredapis.rst | |
parent | a174cadc174377c9c38df860d7e37b5799067bc7 (diff) |
Update Policy Offered APIs
Swagger documentation rendered in ReDoc webpage.
The html page is generated during the Sphinx build.
The sphinx.builders.linkcheck reports as false positives
the links that are generated dynamically, such as with the sphinxcontrib-redoc extension.
Issue-ID: POLICY-4581
Change-Id: I9b720b961332689b144d5fe9d8be82be436d1c16
Signed-off-by: lapentafd <francesco.lapenta@est.tech>
Diffstat (limited to 'docs/offeredapis.rst')
-rw-r--r-- | docs/offeredapis.rst | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/docs/offeredapis.rst b/docs/offeredapis.rst index ee90751a..fb265d45 100644 --- a/docs/offeredapis.rst +++ b/docs/offeredapis.rst @@ -16,13 +16,19 @@ The Policy Framework supports the public APIs listed in the links below: api/api pap/pap xacml/decision-api + clamp/acm/api-protocol/acm-rest-apis Postman Environment for API Testing ----------------------------------- The following environment file from postman can be used for testing API's. All you need to do is fill in the IP and Port information for the installation that you have created. -:download:`link <PolicyAPI.postman_environment.json>` +:download:`Postman Environment <PolicyAPI.postman_environment.json>` + +.. note:: + If you are testing on a Docker Installation use *http* as **protocol**, *localhost* as **IP**, + and the values set in the `export-ports.sh <https://raw.githubusercontent.com/onap/policy-docker/master/compose/export-ports.sh>`_ as **PORT**. + More information in: :ref:`Docker Installation <docker-label>` Postman Collection for API Testing ---------------------------------- @@ -33,16 +39,32 @@ Postman collection for `Policy Framework Administration API <https://github.com/ Postman collection for `Policy Framework Decision API <https://github.com/onap/policy-xacml-pdp/blob/master/postman/decision-api-collection.json>`_ -API Swagger Generation ----------------------- +API Swagger +----------- The standard for API definition in the RESTful API world is the OpenAPI Specification (OAS). The OAS, which is based on the original "Swagger Specification," is being widely used in API developments. -Execute the below curl command for swagger generation by filling in the authorization details, IP and Port information: +OAS 3.0 is used to describe the API contracts, and those documents are added as a source artifacts. + +`Swagger Specification for Policy API <https://github.com/onap/policy-api/blob/master/main/src/main/resources/openapi/openapi.yaml>`_ + +`Swagger Specification for Policy PAP <https://github.com/onap/policy-pap/blob/master/main/src/main/resources/openapi/openapi.yaml>`_ + +`Swagger Specification for Policy XACML-PDP <https://github.com/onap/policy-xacml-pdp/blob/master/main/src/main/resources/openapi/openapi.yaml>`_ + +`Swagger Specification for Policy ACM-R <https://github.com/onap/policy-clamp/blob/master/runtime-acm/src/main/resources/openapi/openapi.yaml>`_ + +`Swagger Specification for Policy DROOLS-PDP <https://github.com/onap/policy-drools-pdp/blob/master/feature-healthcheck/src/main/resources/openapi/openapi.yaml>`_ + -.. code-block:: bash +The YAML document can be imported in an web editor such as `Editor Swagger <https://editor.swagger.io/>`_ - “curl -k --user ‘{user_id}:{password}’ https://{ip}:{port}/swagger.json” +An "OpenApi first" approach is adopted, so starting from the Swagger document we auto-generate interfaces that are implemented in the API controllers. +.. note:: + The Swagger document can still be extracted from the code in the API that uses *Spring-Doc* dependency at the endpoint "../v3/api-docs/" + For Example ACM-Runtime endpoint + + ``http://<IP>:<PORT>/onap/policy/clamp/acm/v3/api-docs`` |