Docs: Include REST API reference content from swagger.json (#14607)

This commit is contained in:
Don Naro
2023-11-11 13:33:41 +00:00
committed by GitHub
parent d8a28b3c06
commit 0057c8daf6
6 changed files with 18 additions and 5 deletions

View File

@@ -0,0 +1,13 @@
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}")

View File

@@ -1,5 +1,3 @@
:orphan:
.. _api_reference:
AWX API Reference Guide
@@ -48,7 +46,7 @@ The API Reference Manual provides in-depth documentation for the AWX REST API, i
<script>
window.onload = function() {
$('head').append('<link rel="stylesheet" href="../_static/swagger-ui.css" type="text/css"></link>');
$('head').append('<link rel="stylesheet" href="../_static/tower.css" type="text/css"></link>');
$('head').append('<link rel="stylesheet" href="../_static/awx-rest-api.css" type="text/css"></link>');
$('#swagger-ui').on('click', function(e) {
// By default, swagger-ui has a show/hide toggle for headers, and
// there's no way to turn it off; this code intercepts the click event

View File

@@ -31,7 +31,7 @@ You can also find lots of AWX discussion and get answers to questions at `forum.
access_resources
read_only_fields
authentication
.. api_ref
api_ref
.. intro
.. auth_token