mirror of
https://github.com/ansible/awx.git
synced 2026-04-10 20:49:24 -02:30
Publish open api spec on AWX for community use (#16221)
* Added link and ref to openAPI spec for community * Update docs/docsite/rst/contributor/openapi_link.rst Co-authored-by: Don Naro <dnaro@redhat.com> * add sphinxcontrib-redoc to requirements * sphinxcontrib.redoc configuration * create openapi directory and files * update download script for both schema files * suppress warning for redoc * update labels * fix extra closing parenthesis * update schema url * exclude doc config and download script The Sphinx configuration (conf.py) and schema download script (download-json.py) are not application logic and used only for building documentation. Coverage requirements for these files are overkill. * exclude only the sphinx config file --------- Co-authored-by: Don Naro <dnaro@redhat.com>
This commit is contained in:
@@ -18,9 +18,11 @@ Ansible AWX helps teams manage complex multi-tier deployments by adding control,
|
||||
contributor/DJANGO_REQUIREMENTS
|
||||
contributor/API_REQUIREMENTS
|
||||
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: Developers
|
||||
|
||||
rest_api/index
|
||||
open_api/index
|
||||
|
||||
|
||||
1
docs/docsite/rst/open_api/explorer.rst
Normal file
1
docs/docsite/rst/open_api/explorer.rst
Normal file
@@ -0,0 +1 @@
|
||||
:orphan:
|
||||
10
docs/docsite/rst/open_api/index.rst
Normal file
10
docs/docsite/rst/open_api/index.rst
Normal file
@@ -0,0 +1,10 @@
|
||||
===================
|
||||
AWX OpenAPI Schema
|
||||
===================
|
||||
|
||||
This document describes the OpenAPI 3.0.3 specification for the AWX API (version v2).
|
||||
|
||||
This schema serves as the complete API documentation and contract for interacting programmatically with AWX, which is used for managing Ansible automation workflows, inventories, credentials, and job execution.
|
||||
|
||||
* `Explore the AWX OpenAPI Schema <explorer.html>`_
|
||||
* `Download the AWX OpenAPI Schema <https://s3.amazonaws.com/awx-public-ci-files/awx/devel/schema.json>`_
|
||||
@@ -1,13 +0,0 @@
|
||||
import requests
|
||||
|
||||
url = "https://awx-public-ci-files.s3.amazonaws.com/community-docs/swagger.json"
|
||||
swagger_json = "./docs/docsite/rst/rest_api/_swagger/swagger.json"
|
||||
|
||||
response = requests.get(url)
|
||||
|
||||
if response.status_code == 200:
|
||||
with open(swagger_json, 'wb') as file:
|
||||
file.write(response.content)
|
||||
print(f"JSON file downloaded to {swagger_json}")
|
||||
else:
|
||||
print(f"Request failed with status code: {response.status_code}")
|
||||
Reference in New Issue
Block a user