From b61eae4bacca749c0b8542d322fbc6f9fb46e45b Mon Sep 17 00:00:00 2001 From: Chris Church Date: Tue, 12 Aug 2014 23:34:18 -0400 Subject: [PATCH] Updated API docs to reflect new features in 2.0. --- awx/api/templates/api/_list_common.md | 6 +++--- awx/api/templates/api/_new_in_awx.md | 2 +- awx/api/templates/api/api_v1_config_view.md | 8 ++++---- awx/api/templates/api/dashboard_inventory_graph_view.md | 2 ++ awx/api/templates/api/dashboard_jobs_graph_view.md | 2 ++ awx/api/templates/api/dashboard_view.md | 4 +++- awx/api/templates/api/inventory_script_view.md | 4 ++-- awx/api/templates/api/job_job_plays_list.md | 2 ++ awx/api/templates/api/job_job_tasks_list.md | 2 ++ awx/api/templates/api/unified_job_stdout.md | 5 +++++ awx/api/views.py | 1 + 11 files changed, 27 insertions(+), 11 deletions(-) diff --git a/awx/api/templates/api/_list_common.md b/awx/api/templates/api/_list_common.md index e80e14b98e..e355421de3 100644 --- a/awx/api/templates/api/_list_common.md +++ b/awx/api/templates/api/_list_common.md @@ -54,7 +54,7 @@ within all designated text fields of a model. ?search=findme -_New since AWX 1.4_ +_Added in AWX 1.4_ ## Filtering @@ -75,7 +75,7 @@ To exclude results matching certain criteria, prefix the field parameter with ?not__field=value -(_New since AWX 1.4_) By default, all query string filters are AND'ed together, so +(_Added in AWX 1.4_) By default, all query string filters are AND'ed together, so only the results matching *all* filters will be returned. To combine results matching *any* one of multiple criteria, prefix each query string parameter with `or__`: @@ -83,7 +83,7 @@ with `or__`: ?or__field=value&or__field=othervalue ?or__not__field=value&or__field=othervalue -(_New in Ansible Tower 1.4.5_) The default AND filtering applies all filters +(_Added in Ansible Tower 1.4.5_) The default AND filtering applies all filters simultaneously to each related object being filtered across database relationships. The chain filter instead applies filters separately for each related object. To use, prefix the query string parameter with `chain__`: diff --git a/awx/api/templates/api/_new_in_awx.md b/awx/api/templates/api/_new_in_awx.md index 35bdcc2e58..a33bbece82 100644 --- a/awx/api/templates/api/_new_in_awx.md +++ b/awx/api/templates/api/_new_in_awx.md @@ -1,5 +1,5 @@ {% if new_in_13 %}> _Added in AWX 1.3_{% endif %} {% if new_in_14 %}> _Added in AWX 1.4_{% endif %} {% if new_in_145 %}> _Added in Ansible Tower 1.4.5_{% endif %} -{% if new_in_148 %}> _New in Ansible Tower 1.4.8_{% endif %} +{% if new_in_148 %}> _Added in Ansible Tower 1.4.8_{% endif %} {% if new_in_200 %}> _New in Ansible Tower 2.0.0_{% endif %} diff --git a/awx/api/templates/api/api_v1_config_view.md b/awx/api/templates/api/api_v1_config_view.md index d731d6ee1d..61eb1a5ae1 100644 --- a/awx/api/templates/api/api_v1_config_view.md +++ b/awx/api/templates/api/api_v1_config_view.md @@ -9,8 +9,8 @@ the following fields (some fields may not be visible to all users): use when creating/editing a project. * `time_zone`: The configured time zone for the server. * `license_info`: Information about the current license. -* `version`: Version of Ansible Tower (AWX) package installed. +* `version`: Version of Ansible Tower package installed. -Make a POST request to this resource as a super user to install or update the -existing license. The license data itself can be POSTed as a normal json data -structure. \ No newline at end of file +(_New in Ansible Tower 2.0.0_) Make a POST request to this resource as a super +user to install or update the existing license. The license data itself can +be POSTed as a normal json data structure. diff --git a/awx/api/templates/api/dashboard_inventory_graph_view.md b/awx/api/templates/api/dashboard_inventory_graph_view.md index 7353bf5006..ab31a13887 100644 --- a/awx/api/templates/api/dashboard_inventory_graph_view.md +++ b/awx/api/templates/api/dashboard_inventory_graph_view.md @@ -38,3 +38,5 @@ Data about failed and successfull hosts by inventory will be given as: "id": 2, "name": "Test Inventory" }, + +{% include "api/_new_in_awx.md" %} diff --git a/awx/api/templates/api/dashboard_jobs_graph_view.md b/awx/api/templates/api/dashboard_jobs_graph_view.md index 378508d1f5..cab9a25a2c 100644 --- a/awx/api/templates/api/dashboard_jobs_graph_view.md +++ b/awx/api/templates/api/dashboard_jobs_graph_view.md @@ -33,3 +33,5 @@ Data will be returned in the following format: Each element contains an epoch timestamp represented in seconds and a numerical value indicating the number of events during that time period + +{% include "api/_new_in_awx.md" %} diff --git a/awx/api/templates/api/dashboard_view.md b/awx/api/templates/api/dashboard_view.md index af9cb8ad5c..16e16dbcc0 100644 --- a/awx/api/templates/api/dashboard_view.md +++ b/awx/api/templates/api/dashboard_view.md @@ -1 +1,3 @@ -Make a GET request to this resource to retrieve aggregate statistics for Tower \ No newline at end of file +Make a GET request to this resource to retrieve aggregate statistics for Tower. + +{% include "api/_new_in_awx.md" %} diff --git a/awx/api/templates/api/inventory_script_view.md b/awx/api/templates/api/inventory_script_view.md index 2a7553cd48..f47f3ec135 100644 --- a/awx/api/templates/api/inventory_script_view.md +++ b/awx/api/templates/api/inventory_script_view.md @@ -10,7 +10,7 @@ object containing groups, including the hosts, children and variables for each group. The response data is equivalent to that returned by passing the `--list` argument to an inventory script. -_(New since AWX 1.3)_ Specify a query string of `?hostvars=1` to retrieve the JSON +_(Added in AWX 1.3)_ Specify a query string of `?hostvars=1` to retrieve the JSON object above including all host variables. The `['_meta']['hostvars']` object in the response contains an entry for each host with its variables. This response format can be used with Ansible 1.3 and later to avoid making a @@ -18,7 +18,7 @@ separate API request for each host. Refer to [Tuning the External Inventory Script](http://docs.ansible.com/developing_inventory.html#tuning-the-external-inventory-script) for more information on this feature. -_(New since AWX 1.4)_ By default, the inventory script will only return hosts that +_(Added in AWX 1.4)_ By default, the inventory script will only return hosts that are enabled in the inventory. This feature allows disabled hosts to be skipped when running jobs without removing them from the inventory. Specify a query string of `?all=1` to return all hosts, including disabled ones. diff --git a/awx/api/templates/api/job_job_plays_list.md b/awx/api/templates/api/job_job_plays_list.md index 5c1c05e92c..65982e7bf9 100644 --- a/awx/api/templates/api/job_job_plays_list.md +++ b/awx/api/templates/api/job_job_plays_list.md @@ -23,3 +23,5 @@ Will show only failed plays. Alternatively `false` may be used. ?play_icontains=test Will filter plays matching the substring `test` + +{% include "api/_new_in_awx.md" %} diff --git a/awx/api/templates/api/job_job_tasks_list.md b/awx/api/templates/api/job_job_tasks_list.md index 1461151b59..48e2fa773a 100644 --- a/awx/api/templates/api/job_job_tasks_list.md +++ b/awx/api/templates/api/job_job_tasks_list.md @@ -25,3 +25,5 @@ Will show only failed plays. Alternatively `false` may be used. ?task_icontains=test Will filter tasks matching the substring `test` + +{% include "api/_new_in_awx.md" %} diff --git a/awx/api/templates/api/unified_job_stdout.md b/awx/api/templates/api/unified_job_stdout.md index 13f827fc7d..76c1827a9e 100644 --- a/awx/api/templates/api/unified_job_stdout.md +++ b/awx/api/templates/api/unified_job_stdout.md @@ -11,6 +11,11 @@ Use the `format` query string parameter to specify the output format. * HTML: `?format=html` * Plain Text: `?format=txt` * Plain Text with ANSI color codes: `?format=ansi` +* JSON structure: `?format=json` + +(_New in Ansible Tower 2.0.0_) When using the Browsable API, HTML and JSON +formats, the `start_line` and `end_line` query string parameters can be used +to specify a range of line numbers to retrieve. When using the HTML or API formats, use the `scheme` query string parameter to change the output colors. The value must be one of the following (default is diff --git a/awx/api/views.py b/awx/api/views.py index 5fbac6c8b7..92e817ed01 100644 --- a/awx/api/views.py +++ b/awx/api/views.py @@ -402,6 +402,7 @@ class ScheduleUnifiedJobsList(SubListAPIView): parent_model = Schedule relationship = 'unifiedjob_set' view_name = 'Schedule Jobs List' + new_in_148 = True class AuthTokenView(APIView):