Update a Job Template
put
/api/v2/job_templates/{id}/
Make a PUT or PATCH request to this resource to update this job template. The following fields may be modified:
name
: Name of this job template. (string, required)description
: Optional description of this job template. (string, default=""
)job_type
: (choice)run
: Run (default)check
: Check
inventory
: (id, default=``)project
: (id, default=``)playbook
: (string, default=""
)scm_branch
: Branch to use in job run. Project default used if blank. Only allowed if project allow_override field is set to true. (string, default=""
)forks
: (integer, default=0
)limit
: (string, default=""
)verbosity
: (choice)0
: 0 (Normal) (default)1
: 1 (Verbose)2
: 2 (More Verbose)3
: 3 (Debug)4
: 4 (Connection Debug)5
: 5 (WinRM Debug)
extra_vars
: (json, default=``)job_tags
: (string, default=""
)force_handlers
: (boolean, default=False
)skip_tags
: (string, default=""
)start_at_task
: (string, default=""
)timeout
: The amount of time (in seconds) to run before the task is canceled. (integer, default=0
)-
use_fact_cache
: If enabled, the service 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
) -
execution_environment
: The container image to be used for execution. (id, default=``) host_config_key
: (string, default=""
)ask_scm_branch_on_launch
: (boolean, default=False
)ask_diff_mode_on_launch
: (boolean, default=False
)ask_variables_on_launch
: (boolean, default=False
)ask_limit_on_launch
: (boolean, default=False
)ask_tags_on_launch
: (boolean, default=False
)ask_skip_tags_on_launch
: (boolean, default=False
)ask_job_type_on_launch
: (boolean, default=False
)ask_verbosity_on_launch
: (boolean, default=False
)ask_inventory_on_launch
: (boolean, default=False
)ask_credential_on_launch
: (boolean, default=False
)survey_enabled
: (boolean, default=False
)become_enabled
: (boolean, default=False
)diff_mode
: If enabled, textual changes made to any templated files on the host are shown in the standard output (boolean, default=False
)-
allow_simultaneous
: (boolean, default=False
) -
job_slice_count
: The number of jobs to slice into at runtime. Will cause the Job Template to launch a workflow if value is greater than 1. (integer, default=1
) webhook_service
: Service that webhook requests will be accepted from (choice)""
: ---------github
: GitHubgitlab
: GitLab
webhook_credential
: Personal Access Token for posting back the status to the service API (id, default=``)
For a PUT request, include all fields in the request.
Request
Supported Media Types
- application/json
Path Parameters
Query Parameters
-
search: string
A search term.
Root Schema : schema
Example:
{
"allow_simultaneous":false,
"ask_credential_on_launch":true,
"ask_diff_mode_on_launch":false,
"ask_inventory_on_launch":false,
"ask_job_type_on_launch":false,
"ask_limit_on_launch":false,
"ask_scm_branch_on_launch":false,
"ask_skip_tags_on_launch":false,
"ask_tags_on_launch":false,
"ask_variables_on_launch":false,
"ask_verbosity_on_launch":false,
"become_enabled":false,
"created":"2018-02-01T08:00:00.000000Z",
"custom_virtualenv":null,
"description":"",
"diff_mode":false,
"execution_environment":null,
"extra_vars":"",
"force_handlers":false,
"forks":"0",
"host_config_key":"",
"id":"1",
"inventory":"1",
"job_slice_count":"1",
"job_tags":"",
"job_type":"run",
"last_job_failed":false,
"last_job_run":null,
"limit":"",
"modified":"2018-02-01T08:00:00.000000Z",
"name":"test-job_template",
"next_job_run":null,
"organization":"1",
"playbook":"helloworld.yml",
"project":"2",
"related":{
"access_list":"/api/v2/job_templates/1/access_list/",
"activity_stream":"/api/v2/job_templates/1/activity_stream/",
"copy":"/api/v2/job_templates/1/copy/",
"credentials":"/api/v2/job_templates/1/credentials/",
"instance_groups":"/api/v2/job_templates/1/instance_groups/",
"inventory":"/api/v2/inventories/1/",
"jobs":"/api/v2/job_templates/1/jobs/",
"labels":"/api/v2/job_templates/1/labels/",
"launch":"/api/v2/job_templates/1/launch/",
"notification_templates_error":"/api/v2/job_templates/1/notification_templates_error/",
"notification_templates_started":"/api/v2/job_templates/1/notification_templates_started/",
"notification_templates_success":"/api/v2/job_templates/1/notification_templates_success/",
"object_roles":"/api/v2/job_templates/1/object_roles/",
"organization":"/api/v2/organizations/1/",
"project":"/api/v2/projects/2/",
"schedules":"/api/v2/job_templates/1/schedules/",
"slice_workflow_jobs":"/api/v2/job_templates/1/slice_workflow_jobs/",
"survey_spec":"/api/v2/job_templates/1/survey_spec/",
"webhook_key":"/api/v2/job_templates/1/webhook_key/",
"webhook_receiver":""
},
"scm_branch":"",
"skip_tags":"",
"start_at_task":"",
"status":"never updated",
"summary_fields":{
"credentials":[
{
"cloud":false,
"description":"",
"id":"2",
"kind":"vault",
"name":"second-vault"
},
{
"cloud":false,
"description":"",
"id":"1",
"kind":"vault",
"name":"test-cred"
}
],
"inventory":{
"description":"",
"has_active_failures":false,
"has_inventory_sources":false,
"hosts_with_active_failures":"0",
"id":"1",
"inventory_sources_with_failures":"0",
"kind":"",
"name":"test-inv",
"organization_id":"1",
"total_groups":"0",
"total_hosts":"0",
"total_inventory_sources":"0"
},
"labels":{
"count":"0",
"results":[
]
},
"object_roles":{
"admin_role":{
"description":"Can manage all aspects of the job template",
"id":"2",
"name":"Admin"
},
"execute_role":{
"description":"May run the job template",
"id":"3",
"name":"Execute"
},
"read_role":{
"description":"May view settings for the job template",
"id":"4",
"name":"Read"
}
},
"organization":{
"description":"test-org-desc",
"id":"1",
"name":"test-org"
},
"project":{
"allow_override":false,
"description":"test-proj-desc",
"id":"2",
"name":"test-proj",
"scm_type":"git",
"status":"never updated"
},
"recent_jobs":[
],
"user_capabilities":{
"copy":true,
"delete":true,
"edit":true,
"schedule":true,
"start":true
}
},
"survey_enabled":false,
"timeout":"0",
"type":"job_template",
"url":"/api/v2/job_templates/1/",
"use_fact_cache":false,
"verbosity":"0",
"webhook_credential":null,
"webhook_service":""
}
Response
Supported Media Types
- application/json
200 Response
Example Response (application/json)
{
"allow_simultaneous":false,
"ask_credential_on_launch":true,
"ask_diff_mode_on_launch":false,
"ask_inventory_on_launch":false,
"ask_job_type_on_launch":false,
"ask_limit_on_launch":false,
"ask_scm_branch_on_launch":false,
"ask_skip_tags_on_launch":false,
"ask_tags_on_launch":false,
"ask_variables_on_launch":false,
"ask_verbosity_on_launch":false,
"become_enabled":false,
"created":"2018-02-01T08:00:00.000000Z",
"custom_virtualenv":null,
"description":"",
"diff_mode":false,
"execution_environment":null,
"extra_vars":"",
"force_handlers":false,
"forks":"0",
"host_config_key":"",
"id":"1",
"inventory":"1",
"job_slice_count":"1",
"job_tags":"",
"job_type":"run",
"last_job_failed":false,
"last_job_run":null,
"limit":"",
"modified":"2018-02-01T08:00:00.000000Z",
"name":"test-job_template",
"next_job_run":null,
"organization":"1",
"playbook":"helloworld.yml",
"project":"2",
"related":{
"access_list":"/api/v2/job_templates/1/access_list/",
"activity_stream":"/api/v2/job_templates/1/activity_stream/",
"copy":"/api/v2/job_templates/1/copy/",
"credentials":"/api/v2/job_templates/1/credentials/",
"instance_groups":"/api/v2/job_templates/1/instance_groups/",
"inventory":"/api/v2/inventories/1/",
"jobs":"/api/v2/job_templates/1/jobs/",
"labels":"/api/v2/job_templates/1/labels/",
"launch":"/api/v2/job_templates/1/launch/",
"notification_templates_error":"/api/v2/job_templates/1/notification_templates_error/",
"notification_templates_started":"/api/v2/job_templates/1/notification_templates_started/",
"notification_templates_success":"/api/v2/job_templates/1/notification_templates_success/",
"object_roles":"/api/v2/job_templates/1/object_roles/",
"organization":"/api/v2/organizations/1/",
"project":"/api/v2/projects/2/",
"schedules":"/api/v2/job_templates/1/schedules/",
"slice_workflow_jobs":"/api/v2/job_templates/1/slice_workflow_jobs/",
"survey_spec":"/api/v2/job_templates/1/survey_spec/",
"webhook_key":"/api/v2/job_templates/1/webhook_key/",
"webhook_receiver":""
},
"scm_branch":"",
"skip_tags":"",
"start_at_task":"",
"status":"never updated",
"summary_fields":{
"credentials":[
{
"cloud":false,
"description":"",
"id":"2",
"kind":"vault",
"name":"second-vault"
},
{
"cloud":false,
"description":"",
"id":"1",
"kind":"vault",
"name":"test-cred"
}
],
"inventory":{
"description":"",
"has_active_failures":false,
"has_inventory_sources":false,
"hosts_with_active_failures":"0",
"id":"1",
"inventory_sources_with_failures":"0",
"kind":"",
"name":"test-inv",
"organization_id":"1",
"total_groups":"0",
"total_hosts":"0",
"total_inventory_sources":"0"
},
"labels":{
"count":"0",
"results":[
]
},
"object_roles":{
"admin_role":{
"description":"Can manage all aspects of the job template",
"id":"2",
"name":"Admin"
},
"execute_role":{
"description":"May run the job template",
"id":"3",
"name":"Execute"
},
"read_role":{
"description":"May view settings for the job template",
"id":"4",
"name":"Read"
}
},
"organization":{
"description":"test-org-desc",
"id":"1",
"name":"test-org"
},
"project":{
"allow_override":false,
"description":"test-proj-desc",
"id":"2",
"name":"test-proj",
"scm_type":"git",
"status":"never updated"
},
"recent_jobs":[
],
"user_capabilities":{
"copy":true,
"delete":true,
"edit":true,
"schedule":true,
"start":true
}
},
"survey_enabled":false,
"timeout":"0",
"type":"job_template",
"url":"/api/v2/job_templates/1/",
"use_fact_cache":false,
"verbosity":"0",
"webhook_credential":null,
"webhook_service":""
}