Retrieve a Job Template
get
/api/v2/job_templates/{id}/
Make GET request to this resource to retrieve a single job template record containing the following fields:
id
: Database ID for this job template. (integer)type
: Data type for this job template. (choice)url
: URL for this job template. (string)related
: Data structure with URLs of related resources. (object)summary_fields
: Data structure with name/description for related resources. The output for some objects may be limited for performance reasons. (object)created
: Timestamp when this job template was created. (datetime)modified
: Timestamp when this job template was last modified. (datetime)name
: Name of this job template. (string)description
: Optional description of this job template. (string)job_type
: (choice)run
: Runcheck
: Check
inventory
: (id)project
: (id)playbook
: (string)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)forks
: (integer)limit
: (string)verbosity
: (choice)0
: 0 (Normal)1
: 1 (Verbose)2
: 2 (More Verbose)3
: 3 (Debug)4
: 4 (Connection Debug)5
: 5 (WinRM Debug)
extra_vars
: (json)job_tags
: (string)force_handlers
: (boolean)skip_tags
: (string)start_at_task
: (string)timeout
: The amount of time (in seconds) to run before the task is canceled. (integer)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)organization
: The organization used to determine access to this template. (id)last_job_run
: (datetime)last_job_failed
: (boolean)next_job_run
: (datetime)status
: (choice)new
: Newpending
: Pendingwaiting
: Waitingrunning
: Runningsuccessful
: Successfulfailed
: Failederror
: Errorcanceled
: Cancelednever updated
: Never Updated
execution_environment
: The container image to be used for execution. (id)host_config_key
: (string)ask_scm_branch_on_launch
: (boolean)ask_diff_mode_on_launch
: (boolean)ask_variables_on_launch
: (boolean)ask_limit_on_launch
: (boolean)ask_tags_on_launch
: (boolean)ask_skip_tags_on_launch
: (boolean)ask_job_type_on_launch
: (boolean)ask_verbosity_on_launch
: (boolean)ask_inventory_on_launch
: (boolean)ask_credential_on_launch
: (boolean)survey_enabled
: (boolean)become_enabled
: (boolean)diff_mode
: If enabled, textual changes made to any templated files on the host are shown in the standard output (boolean)allow_simultaneous
: (boolean)custom_virtualenv
: Local absolute file path containing a custom Python virtualenv to use (string)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)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)
Request
Supported Media Types
- application/json
Path Parameters
Query Parameters
-
search: string
A search term.
Response
Supported Media Types
- application/json
200 Response
Example Response (application/json)
{
"allow_simultaneous":false,
"ask_credential_on_launch":false,
"ask_diff_mode_on_launch":false,
"ask_inventory_on_launch":true,
"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":"2",
"inventory":null,
"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":"copy-edit-job-template",
"next_job_run":null,
"organization":"1",
"playbook":"helloworld.yml",
"project":"1",
"related":{
"access_list":"/api/v2/job_templates/2/access_list/",
"activity_stream":"/api/v2/job_templates/2/activity_stream/",
"copy":"/api/v2/job_templates/2/copy/",
"credentials":"/api/v2/job_templates/2/credentials/",
"instance_groups":"/api/v2/job_templates/2/instance_groups/",
"jobs":"/api/v2/job_templates/2/jobs/",
"labels":"/api/v2/job_templates/2/labels/",
"launch":"/api/v2/job_templates/2/launch/",
"notification_templates_error":"/api/v2/job_templates/2/notification_templates_error/",
"notification_templates_started":"/api/v2/job_templates/2/notification_templates_started/",
"notification_templates_success":"/api/v2/job_templates/2/notification_templates_success/",
"object_roles":"/api/v2/job_templates/2/object_roles/",
"organization":"/api/v2/organizations/1/",
"project":"/api/v2/projects/1/",
"schedules":"/api/v2/job_templates/2/schedules/",
"slice_workflow_jobs":"/api/v2/job_templates/2/slice_workflow_jobs/",
"survey_spec":"/api/v2/job_templates/2/survey_spec/",
"webhook_key":"/api/v2/job_templates/2/webhook_key/",
"webhook_receiver":""
},
"scm_branch":"",
"skip_tags":"",
"start_at_task":"",
"status":"never updated",
"summary_fields":{
"credentials":[
],
"labels":{
"count":"0",
"results":[
]
},
"object_roles":{
"admin_role":{
"description":"Can manage all aspects of the job template",
"id":"20",
"name":"Admin"
},
"execute_role":{
"description":"May run the job template",
"id":"21",
"name":"Execute"
},
"read_role":{
"description":"May view settings for the job template",
"id":"22",
"name":"Read"
}
},
"organization":{
"description":"test-org-desc",
"id":"1",
"name":"test-org"
},
"project":{
"allow_override":false,
"description":"test-proj-desc",
"id":"1",
"name":"test-proj",
"scm_type":"git",
"status":"never updated"
},
"recent_jobs":[
],
"user_capabilities":{
"copy":false,
"delete":true,
"edit":true,
"schedule":true,
"start":true
}
},
"survey_enabled":false,
"timeout":"0",
"type":"job_template",
"url":"/api/v2/job_templates/2/",
"use_fact_cache":false,
"verbosity":"0",
"webhook_credential":null,
"webhook_service":""
}