Skip to content

Commit 98964dd

Browse files
committed
Adding OpenAPI specification info to docs (ansible#4918)
DOCS: Document Access and Distribution of Platform Gateway OpenAPI Specification https://issues.redhat.com/browse/AAP-57300 Affects `titles/central-auth`
1 parent d2644cd commit 98964dd

File tree

4 files changed

+84
-0
lines changed

4 files changed

+84
-0
lines changed

downstream/assemblies/platform/assembly-gw-settings.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,10 @@ include::platform/proc-settings-gw-authentication.adoc[leveloffset=+2]
3737

3838
include::platform/proc-gw-settings-insights-settings.adoc[leveloffset=+2]
3939

40+
include::platform/con-gw-openAPI-specification.adoc[leveloffset=+1]
41+
42+
include::platform/proc-gw-download-openAPI.adoc[leveloffset=+2]
43+
44+
include::platform/proc-gw-access-interactive-docs.adoc[leveloffset=+2]
45+
4046
include::platform/proc-settings-user-preferences.adoc[leveloffset=+1]
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
:_mod-docs-content-type: CONCEPT
2+
3+
[id="gw-openAPI-specification"]
4+
5+
= Understanding the {Gateway} OpenAPI specification
6+
7+
[role="_abstract"]
8+
{GatewayStart} serves as the single entry point for {PlatformNameShort}, unifying the user interface and routing all API traffic to services such as {ControllerName}, {EDAName}, and {HubName}.
9+
10+
The OpenAPI specification provides a standardized, machine-readable definition of the unified API endpoints available through {Gateway}.
11+
It is essential for external developers and automation engineers building reliable custom integrations.
12+
13+
*Key roles of the specification*
14+
15+
The OpenAPI specification ensures successful integration by fulfilling the following roles:
16+
17+
* *Enables custom integrations*: Developers use the specification to understand endpoint structures, required parameters, and response schemas, which is needed for building custom applications and third-party tools.
18+
* *Ensures API longevity*: Integration with the {Gateway} API future-proofs custom applications against disruptions that might occur when legacy, direct-access component APIs are retired.
19+
* *Defines core functions*: The specification details endpoints that support fundamental operational and administrative functions, including:
20+
** Platform health, such as `/api/gateway/v1/status/`.
21+
** Activity monitoring, such as `/api/gateway/v1/activitystream/`.
22+
** Configuration management, such as authentication configuration and role-based access control assignments.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
:_mod-docs-content-type: PROCEDURE
2+
3+
[id="gw-access-interactive-docs"]
4+
5+
= Accessing the interactive documentation (Rendered access)
6+
7+
[role="_abstract"]
8+
{GatewayStart} provides an interactive, rendered version of the OpenAPI specification accessible directly in a web browser.
9+
10+
.Procedure
11+
12+
. Go to the documentation endpoint by using the following URL structure, replacing `$AAP_INSTANCE` with your hostname:
13+
+
14+
[literal, options="nowrap" subs="+attributes"]
15+
----
16+
https://$AAP_INSTANCE/api/gateway/v1/docs/
17+
----
18+
. Explore the available API endpoints, view required parameters, and test interactions with the resources exposed by {Gateway}.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
:_mod-docs-content-type: PROCEDURE
2+
3+
[id="gw-download-openAPI"]
4+
5+
= Downloading the {Gateway} OpenAPI specification
6+
7+
[role="_abstract"]
8+
You can download the OpenAPI specification by using the `curl` command from the schema endpoint.
9+
10+
.Prerequisites
11+
12+
Token authentication is the recommended method for programmatic API use.
13+
14+
. Create a Personal Access Token (PAT): From the navigation panel, select menu:{MenuAM}[Users], select your user, go to the *Tokens* tab, and click btn:[Create token].
15+
. Copy the generated token value.
16+
Use this value as the `<OAUTH2_TOKEN_VALUE>` in the following commands.
17+
18+
.Procedure
19+
20+
* Retrieve the OpenAPI specification from the schema endpoint located at `https://$AAP_INSTANCE/api/gateway/v1/docs/schema/`, using one of the following methods:
21+
** Get the YAML specification (Default format): To download the specification as a YAML file, run the following command:
22+
+
23+
[literal, options="nowrap" subs="+attributes"]
24+
----
25+
curl -o "gateway_openapi_spec.yaml" "https://$AAP_INSTANCE/api/gateway/v1/docs/schema/"
26+
----
27+
+
28+
** Get the JSON specification (Optional format): To explicitly request the specification in JSON format, append `?format=json` to the URL path and run the following command:
29+
+
30+
[literal, options="nowrap" subs="+attributes"]
31+
----
32+
curl -o "gateway_openapi_spec.json" "https://$AAP_INSTANCE/api/gateway/v1/docs/schema/?format=json"
33+
----
34+
+
35+
[IMPORTANT]
36+
====
37+
Replace `$AAP_INSTANCE` with your {PlatformNameShort} hostname in the commands.
38+
====

0 commit comments

Comments
 (0)