Skip to content

Instantly share code, notes, and snippets.

@AlanCoding
Created April 16, 2018 11:39
Show Gist options
  • Save AlanCoding/57e9f3d40cd373db561f3fc417766935 to your computer and use it in GitHub Desktop.
Save AlanCoding/57e9f3d40cd373db561f3fc417766935 to your computer and use it in GitHub Desktop.
{
"name": "Job Template List",
"description": "# List Job Templates:\n\nMake a GET request to this resource to retrieve the list of\njob templates.\n\nThe resulting data structure contains:\n\n {\n \"count\": 99,\n \"next\": null,\n \"previous\": null,\n \"results\": [\n ...\n ]\n }\n\nThe `count` field indicates the total number of job templates\nfound for the given query. The `next` and `previous` fields provides links to\nadditional results if there are more than will fit on a single page. The\n`results` list contains zero or more job template records. \n\n## Results\n\nEach job template data structure includes the following fields:\n\n* `id`: Database ID for this job template. (integer)\n* `type`: Data type for this job template. (choice)\n* `url`: URL for this job template. (string)\n* `related`: Data structure with URLs of related resources. (object)\n* `summary_fields`: Data structure with name/description for related resources. (object)\n* `created`: Timestamp when this job template was created. (datetime)\n* `modified`: Timestamp when this job template was last modified. (datetime)\n* `name`: Name of this job template. (string)\n* `description`: Optional description of this job template. (string)\n* `job_type`: (choice)\n - `run`: Run\n - `check`: Check\n* `inventory`: (field)\n* `project`: (field)\n* `playbook`: (string)\n* `forks`: (integer)\n* `limit`: (string)\n* `verbosity`: (choice)\n - `0`: 0 (Normal)\n - `1`: 1 (Verbose)\n - `2`: 2 (More Verbose)\n - `3`: 3 (Debug)\n - `4`: 4 (Connection Debug)\n - `5`: 5 (WinRM Debug)\n* `extra_vars`: (string)\n* `job_tags`: (string)\n* `force_handlers`: (boolean)\n* `skip_tags`: (string)\n* `start_at_task`: (string)\n* `timeout`: The amount of time (in seconds) to run before the task is canceled. (integer)\n* `use_fact_cache`: If enabled, Tower will act as an Ansible Fact Cache Plugin; persisting facts at the end of a playbook run to the database and caching facts for use by Ansible. (boolean)\n* `last_job_run`: (datetime)\n* `last_job_failed`: (boolean)\n* `next_job_run`: (datetime)\n* `status`: (choice)\n - `new`: New\n - `pending`: Pending\n - `waiting`: Waiting\n - `running`: Running\n - `successful`: Successful\n - `failed`: Failed\n - `error`: Error\n - `canceled`: Canceled\n - `never updated`: Never Updated\n* `host_config_key`: (string)\n* `ask_diff_mode_on_launch`: (boolean)\n* `ask_variables_on_launch`: (boolean)\n* `ask_limit_on_launch`: (boolean)\n* `ask_tags_on_launch`: (boolean)\n* `ask_skip_tags_on_launch`: (boolean)\n* `ask_job_type_on_launch`: (boolean)\n* `ask_verbosity_on_launch`: (boolean)\n* `ask_inventory_on_launch`: (boolean)\n* `ask_credential_on_launch`: (boolean)\n* `survey_enabled`: (boolean)\n* `become_enabled`: (boolean)\n* `diff_mode`: If enabled, textual changes made to any templated files on the host are shown in the standard output (boolean)\n* `allow_simultaneous`: (boolean)\n* `custom_virtualenv`: (string)\n* `credential`: This resource has been deprecated and will be removed in a future release (integer)\n* `vault_credential`: This resource has been deprecated and will be removed in a future release (integer)\n\n\n\n## Sorting\n\nTo specify that job templates are returned in a particular\norder, use the `order_by` query string parameter on the GET request.\n\n ?order_by=name\n\nPrefix the field name with a dash `-` to sort in reverse:\n\n ?order_by=-name\n\nMultiple sorting fields may be specified by separating the field names with a\ncomma `,`:\n\n ?order_by=name,some_other_field\n\n## Pagination\n\nUse the `page_size` query string parameter to change the number of results\nreturned for each request. Use the `page` query string parameter to retrieve\na particular page of results.\n\n ?page_size=100&page=2\n\nThe `previous` and `next` links returned with the results will set these query\nstring parameters automatically.\n\n## Searching\n\nUse the `search` query string parameter to perform a case-insensitive search\nwithin all designated text fields of a model.\n\n ?search=findme\n\n_Added in AWX 1.4_\n\n(_Added in Ansible Tower 3.1.0_) Search across related fields:\n\n ?related__search=findme\n\nNote: If you want to provide more than one search terms, please use multiple\nsearch fields with the same key, like `?related__search=foo&related__search=bar`,\nAll search terms with the same key will be ORed together.\n\n## Filtering\n\nAny additional query string parameters may be used to filter the list of\nresults returned to those matching a given value. Only fields and relations\nthat exist in the database may be used for filtering. Any special characters\nin the specified value should be url-encoded. For example:\n\n ?field=value%20xyz\n\nFields may also span relations, only for fields and relationships defined in\nthe database:\n\n ?other__field=value\n\nTo exclude results matching certain criteria, prefix the field parameter with\n`not__`:\n\n ?not__field=value\n\n(_Added in AWX 1.4_) By default, all query string filters are AND'ed together, so\nonly the results matching *all* filters will be returned. To combine results\nmatching *any* one of multiple criteria, prefix each query string parameter\nwith `or__`:\n\n ?or__field=value&or__field=othervalue\n ?or__not__field=value&or__field=othervalue\n\n(_Added in Ansible Tower 1.4.5_) The default AND filtering applies all filters\nsimultaneously to each related object being filtered across database\nrelationships. The chain filter instead applies filters separately for each\nrelated object. To use, prefix the query string parameter with `chain__`:\n\n ?chain__related__field=value&chain__related__field2=othervalue\n ?chain__not__related__field=value&chain__related__field2=othervalue\n\nIf the first query above were written as\n`?related__field=value&related__field2=othervalue`, it would return only the\nprimary objects where the *same* related object satisfied both conditions. As\nwritten using the chain filter, it would return the intersection of primary\nobjects matching each condition.\n\nField lookups may also be used for more advanced queries, by appending the\nlookup to the field name:\n\n ?field__lookup=value\n\nThe following field lookups are supported:\n\n* `exact`: Exact match (default lookup if not specified).\n* `iexact`: Case-insensitive version of `exact`.\n* `contains`: Field contains value.\n* `icontains`: Case-insensitive version of `contains`.\n* `startswith`: Field starts with value.\n* `istartswith`: Case-insensitive version of `startswith`.\n* `endswith`: Field ends with value.\n* `iendswith`: Case-insensitive version of `endswith`.\n* `regex`: Field matches the given regular expression.\n* `iregex`: Case-insensitive version of `regex`.\n* `gt`: Greater than comparison.\n* `gte`: Greater than or equal to comparison.\n* `lt`: Less than comparison.\n* `lte`: Less than or equal to comparison.\n* `isnull`: Check whether the given field or related object is null; expects a\n boolean value.\n* `in`: Check whether the given field's value is present in the list provided;\n expects a list of items.\n\nBoolean values may be specified as `True` or `1` for true, `False` or `0` for\nfalse (both case-insensitive).\n\nNull values may be specified as `None` or `Null` (both case-insensitive),\nthough it is preferred to use the `isnull` lookup to explicitly check for null\nvalues.\n\nLists (for the `in` lookup) may be specified as a comma-separated list of\nvalues.\n\n(_Added in Ansible Tower 3.1.0_) Filtering based on the requesting user's\nlevel of access by query string parameter.\n\n* `role_level`: Level of role to filter on, such as `admin_role`\n\n\n\n\n# Create a Job Template:\n\nMake a POST request to this resource with the following job template\nfields to create a new job template:\n\n\n\n\n\n\n\n\n\n* `name`: Name of this job template. (string, required)\n* `description`: Optional description of this job template. (string, default=`\"\"`)\n* `job_type`: (choice)\n - `run`: Run (default)\n - `check`: Check\n* `inventory`: (field, default=`None`)\n* `project`: (field, default=`None`)\n* `playbook`: (string, default=`\"\"`)\n* `forks`: (integer, default=`0`)\n* `limit`: (string, default=`\"\"`)\n* `verbosity`: (choice)\n - `0`: 0 (Normal) (default)\n - `1`: 1 (Verbose)\n - `2`: 2 (More Verbose)\n - `3`: 3 (Debug)\n - `4`: 4 (Connection Debug)\n - `5`: 5 (WinRM Debug)\n* `extra_vars`: (string, default=`\"\"`)\n* `job_tags`: (string, default=`\"\"`)\n* `force_handlers`: (boolean, default=`False`)\n* `skip_tags`: (string, default=`\"\"`)\n* `start_at_task`: (string, default=`\"\"`)\n* `timeout`: The amount of time (in seconds) to run before the task is canceled. (integer, default=`0`)\n* `use_fact_cache`: If enabled, Tower will act as an Ansible Fact Cache Plugin; persisting facts at the end of a playbook run to the database and caching facts for use by Ansible. (boolean, default=`False`)\n\n\n\n\n* `host_config_key`: (string, default=`\"\"`)\n* `ask_diff_mode_on_launch`: (boolean, default=`False`)\n* `ask_variables_on_launch`: (boolean, default=`False`)\n* `ask_limit_on_launch`: (boolean, default=`False`)\n* `ask_tags_on_launch`: (boolean, default=`False`)\n* `ask_skip_tags_on_launch`: (boolean, default=`False`)\n* `ask_job_type_on_launch`: (boolean, default=`False`)\n* `ask_verbosity_on_launch`: (boolean, default=`False`)\n* `ask_inventory_on_launch`: (boolean, default=`False`)\n* `ask_credential_on_launch`: (boolean, default=`False`)\n* `survey_enabled`: (boolean, default=`False`)\n* `become_enabled`: (boolean, default=`False`)\n* `diff_mode`: If enabled, textual changes made to any templated files on the host are shown in the standard output (boolean, default=`False`)\n* `allow_simultaneous`: (boolean, default=`False`)\n* `custom_virtualenv`: (string, default=`\"\"`)\n* `credential`: This resource has been deprecated and will be removed in a future release (integer, default=`None`)\n* `vault_credential`: This resource has been deprecated and will be removed in a future release (integer, default=`None`)",
"renders": [
"application/json",
"text/html"
],
"parses": [
"application/json"
],
"actions": {
"POST": {
"name": {
"type": "string",
"required": true,
"label": "Name",
"max_length": 512,
"help_text": "Name of this job template."
},
"description": {
"type": "string",
"required": false,
"label": "Description",
"help_text": "Optional description of this job template.",
"default": ""
},
"job_type": {
"type": "choice",
"required": false,
"label": "Job type",
"default": "run",
"choices": [
[
"run",
"Run"
],
[
"check",
"Check"
]
]
},
"inventory": {
"type": "field",
"required": false,
"label": "Inventory"
},
"project": {
"type": "field",
"required": false,
"label": "Project"
},
"playbook": {
"type": "string",
"required": false,
"label": "Playbook",
"max_length": 1024,
"default": ""
},
"forks": {
"type": "integer",
"required": false,
"label": "Forks",
"min_value": 0,
"max_value": 2147483647,
"default": 0
},
"limit": {
"type": "string",
"required": false,
"label": "Limit",
"max_length": 1024,
"default": ""
},
"verbosity": {
"type": "choice",
"required": false,
"label": "Verbosity",
"default": 0,
"choices": [
[
0,
"0 (Normal)"
],
[
1,
"1 (Verbose)"
],
[
2,
"2 (More Verbose)"
],
[
3,
"3 (Debug)"
],
[
4,
"4 (Connection Debug)"
],
[
5,
"5 (WinRM Debug)"
]
]
},
"extra_vars": {
"type": "string",
"required": false,
"label": "Extra vars",
"default": ""
},
"job_tags": {
"type": "string",
"required": false,
"label": "Job tags",
"max_length": 1024,
"default": ""
},
"force_handlers": {
"type": "boolean",
"required": false,
"label": "Force handlers",
"default": false
},
"skip_tags": {
"type": "string",
"required": false,
"label": "Skip tags",
"max_length": 1024,
"default": ""
},
"start_at_task": {
"type": "string",
"required": false,
"label": "Start at task",
"max_length": 1024,
"default": ""
},
"timeout": {
"type": "integer",
"required": false,
"label": "Timeout",
"help_text": "The amount of time (in seconds) to run before the task is canceled.",
"min_value": -2147483648,
"max_value": 2147483647,
"default": 0
},
"use_fact_cache": {
"type": "boolean",
"required": false,
"label": "Use fact cache",
"help_text": "If enabled, Tower will act as an Ansible Fact Cache Plugin; persisting facts at the end of a playbook run to the database and caching facts for use by Ansible.",
"default": false
},
"host_config_key": {
"type": "string",
"required": false,
"label": "Host config key",
"max_length": 1024,
"default": ""
},
"ask_diff_mode_on_launch": {
"type": "boolean",
"required": false,
"label": "Ask diff mode on launch",
"default": false
},
"ask_variables_on_launch": {
"type": "boolean",
"required": false,
"label": "Ask variables on launch",
"default": false
},
"ask_limit_on_launch": {
"type": "boolean",
"required": false,
"label": "Ask limit on launch",
"default": false
},
"ask_tags_on_launch": {
"type": "boolean",
"required": false,
"label": "Ask tags on launch",
"default": false
},
"ask_skip_tags_on_launch": {
"type": "boolean",
"required": false,
"label": "Ask skip tags on launch",
"default": false
},
"ask_job_type_on_launch": {
"type": "boolean",
"required": false,
"label": "Ask job type on launch",
"default": false
},
"ask_verbosity_on_launch": {
"type": "boolean",
"required": false,
"label": "Ask verbosity on launch",
"default": false
},
"ask_inventory_on_launch": {
"type": "boolean",
"required": false,
"label": "Ask inventory on launch",
"default": false
},
"ask_credential_on_launch": {
"type": "boolean",
"required": false,
"label": "Ask credential on launch",
"default": false
},
"survey_enabled": {
"type": "boolean",
"required": false,
"label": "Survey enabled",
"default": false
},
"become_enabled": {
"type": "boolean",
"required": false,
"label": "Become enabled",
"default": false
},
"diff_mode": {
"type": "boolean",
"required": false,
"label": "Diff mode",
"help_text": "If enabled, textual changes made to any templated files on the host are shown in the standard output",
"default": false
},
"allow_simultaneous": {
"type": "boolean",
"required": false,
"label": "Allow simultaneous",
"default": false
},
"custom_virtualenv": {
"type": "string",
"required": false,
"label": "Custom virtualenv",
"max_length": 100,
"default": null
},
"credential": {
"type": "integer",
"required": false,
"label": "Credential",
"help_text": "This resource has been deprecated and will be removed in a future release",
"min_value": 1,
"filterable": false,
"default": null
},
"vault_credential": {
"type": "integer",
"required": false,
"label": "Vault credential",
"help_text": "This resource has been deprecated and will be removed in a future release",
"min_value": 1,
"filterable": false,
"default": null
}
},
"GET": {
"id": {
"type": "integer",
"label": "ID",
"help_text": "Database ID for this job template."
},
"type": {
"type": "choice",
"label": "Type",
"help_text": "Data type for this job template.",
"choices": [
[
"job_template",
"Job Template"
]
]
},
"url": {
"type": "string",
"label": "Url",
"help_text": "URL for this job template."
},
"related": {
"type": "object",
"label": "Related",
"help_text": "Data structure with URLs of related resources."
},
"summary_fields": {
"type": "object",
"label": "Summary fields",
"help_text": "Data structure with name/description for related resources."
},
"created": {
"type": "datetime",
"label": "Created",
"help_text": "Timestamp when this job template was created."
},
"modified": {
"type": "datetime",
"label": "Modified",
"help_text": "Timestamp when this job template was last modified."
},
"name": {
"type": "string",
"label": "Name",
"help_text": "Name of this job template."
},
"description": {
"type": "string",
"label": "Description",
"help_text": "Optional description of this job template."
},
"job_type": {
"type": "choice",
"label": "Job type",
"choices": [
[
"run",
"Run"
],
[
"check",
"Check"
]
]
},
"inventory": {
"type": "field",
"label": "Inventory"
},
"project": {
"type": "field",
"label": "Project"
},
"playbook": {
"type": "string",
"label": "Playbook"
},
"forks": {
"type": "integer",
"label": "Forks",
"min_value": 0,
"max_value": 2147483647
},
"limit": {
"type": "string",
"label": "Limit"
},
"verbosity": {
"type": "choice",
"label": "Verbosity",
"choices": [
[
0,
"0 (Normal)"
],
[
1,
"1 (Verbose)"
],
[
2,
"2 (More Verbose)"
],
[
3,
"3 (Debug)"
],
[
4,
"4 (Connection Debug)"
],
[
5,
"5 (WinRM Debug)"
]
]
},
"extra_vars": {
"type": "string",
"label": "Extra vars"
},
"job_tags": {
"type": "string",
"label": "Job tags"
},
"force_handlers": {
"type": "boolean",
"label": "Force handlers"
},
"skip_tags": {
"type": "string",
"label": "Skip tags"
},
"start_at_task": {
"type": "string",
"label": "Start at task"
},
"timeout": {
"type": "integer",
"label": "Timeout",
"help_text": "The amount of time (in seconds) to run before the task is canceled.",
"min_value": -2147483648,
"max_value": 2147483647
},
"use_fact_cache": {
"type": "boolean",
"label": "Use fact cache",
"help_text": "If enabled, Tower will act as an Ansible Fact Cache Plugin; persisting facts at the end of a playbook run to the database and caching facts for use by Ansible."
},
"last_job_run": {
"type": "datetime",
"label": "Last job run"
},
"last_job_failed": {
"type": "boolean",
"label": "Last job failed"
},
"next_job_run": {
"type": "datetime",
"label": "Next job run"
},
"status": {
"type": "choice",
"label": "Status",
"choices": [
[
"new",
"New"
],
[
"pending",
"Pending"
],
[
"waiting",
"Waiting"
],
[
"running",
"Running"
],
[
"successful",
"Successful"
],
[
"failed",
"Failed"
],
[
"error",
"Error"
],
[
"canceled",
"Canceled"
],
[
"never updated",
"Never Updated"
]
]
},
"host_config_key": {
"type": "string",
"label": "Host config key"
},
"ask_diff_mode_on_launch": {
"type": "boolean",
"label": "Ask diff mode on launch"
},
"ask_variables_on_launch": {
"type": "boolean",
"label": "Ask variables on launch"
},
"ask_limit_on_launch": {
"type": "boolean",
"label": "Ask limit on launch"
},
"ask_tags_on_launch": {
"type": "boolean",
"label": "Ask tags on launch"
},
"ask_skip_tags_on_launch": {
"type": "boolean",
"label": "Ask skip tags on launch"
},
"ask_job_type_on_launch": {
"type": "boolean",
"label": "Ask job type on launch"
},
"ask_verbosity_on_launch": {
"type": "boolean",
"label": "Ask verbosity on launch"
},
"ask_inventory_on_launch": {
"type": "boolean",
"label": "Ask inventory on launch"
},
"ask_credential_on_launch": {
"type": "boolean",
"label": "Ask credential on launch"
},
"survey_enabled": {
"type": "boolean",
"label": "Survey enabled"
},
"become_enabled": {
"type": "boolean",
"label": "Become enabled"
},
"diff_mode": {
"type": "boolean",
"label": "Diff mode",
"help_text": "If enabled, textual changes made to any templated files on the host are shown in the standard output"
},
"allow_simultaneous": {
"type": "boolean",
"label": "Allow simultaneous"
},
"custom_virtualenv": {
"type": "string",
"label": "Custom virtualenv"
},
"credential": {
"type": "integer",
"label": "Credential",
"help_text": "This resource has been deprecated and will be removed in a future release",
"min_value": 1,
"filterable": false
},
"vault_credential": {
"type": "integer",
"label": "Vault credential",
"help_text": "This resource has been deprecated and will be removed in a future release",
"min_value": 1,
"filterable": false
}
}
},
"types": [
"job_template"
],
"search_fields": [
"description",
"name"
],
"related_search_fields": [
"instance_groups__search",
"modified_by__search",
"workflowjobnodes__search",
"project__search",
"last_job__search",
"inventory__search",
"notification_templates_any__search",
"labels__search",
"notification_templates_error__search",
"unifiedjob_unified_jobs__search",
"notification_templates_success__search",
"next_schedule__search",
"current_job__search",
"workflowjobtemplatenodes__search",
"jobs__search",
"created_by__search",
"credentials__search",
"unifiedjobtemplate_ptr__search",
"schedules__search"
],
"max_page_size": 200
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment