mirror of
https://github.com/ansible/awx.git
synced 2026-02-01 09:38:10 -03:30
Docs: Include REST API reference content from swagger.json (#14607)
This commit is contained in:
13
docs/docsite/rst/rest_api/_swagger/download-json.py
Normal file
13
docs/docsite/rst/rest_api/_swagger/download-json.py
Normal 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}")
|
||||
Reference in New Issue
Block a user