Launch a Job Template

get

/api/v2/job_templates/{id}/launch/

Make a GET request to this resource to determine if the job_template can be launched and whether any passwords are required to launch the job_template. The response will include the following fields:

  • ask_variables_on_launch: Flag indicating whether the job_template is configured to prompt for variables upon launch (boolean, read-only)
  • ask_tags_on_launch: Flag indicating whether the job_template is configured to prompt for tags upon launch (boolean, read-only)
  • ask_skip_tags_on_launch: Flag indicating whether the job_template is configured to prompt for skip_tags upon launch (boolean, read-only)
  • ask_job_type_on_launch: Flag indicating whether the job_template is configured to prompt for job_type upon launch (boolean, read-only)
  • ask_limit_on_launch: Flag indicating whether the job_template is configured to prompt for limit upon launch (boolean, read-only)
  • ask_inventory_on_launch: Flag indicating whether the job_template is configured to prompt for inventory upon launch (boolean, read-only)
  • ask_credential_on_launch: Flag indicating whether the job_template is configured to prompt for credential upon launch (boolean, read-only)
  • can_start_without_user_input: Flag indicating if the job_template can be launched without user-input (boolean, read-only)
  • passwords_needed_to_start: Password names required to launch the job_template (array, read-only)
  • variables_needed_to_start: Required variable names required to launch the job_template (array, read-only)
  • survey_enabled: Flag indicating whether the job_template has an enabled survey (boolean, read-only)
  • inventory_needed_to_start: Flag indicating the presence of an inventory associated with the job template. If not then one should be supplied when launching the job (boolean, read-only)

Make a POST request to this resource to launch the job_template. If any passwords, inventory, or extra variables (extra_vars) are required, they must be passed via POST data, with extra_vars given as a YAML or JSON string and escaped parentheses. If the inventory_needed_to_start is True then the inventory is required.

If successful, the response status code will be 201. If any required passwords are not provided, a 400 status code will be returned. If the job cannot be launched, a 405 status code will be returned. If the provided credential or inventory are not allowed to be used by the user, then a 403 status code will be returned.

Request

Supported Media Types
Path Parameters
Query Parameters
Back to Top

Response

Supported Media Types

200 Response

Body
Example Response (application/json)
{
    "ask_credential_on_launch":false,
    "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,
    "can_start_without_user_input":false,
    "credential_needed_to_start":false,
    "defaults":{
        "credentials":[
            {
                "credential_type":"2",
                "id":"4",
                "name":"Vault #1",
                "passwords_needed":[
                    "vault_password.abc"
                ],
                "vault_id":"abc"
            },
            {
                "credential_type":"2",
                "id":"5",
                "name":"Vault #2",
                "passwords_needed":[
                    "vault_password.xyz"
                ],
                "vault_id":"xyz"
            },
            {
                "credential_type":"3",
                "id":"3",
                "name":"test-cred",
                "passwords_needed":[
                ]
            }
        ],
        "diff_mode":false,
        "extra_vars":"",
        "inventory":{
            "id":"1",
            "name":"test-inv"
        },
        "job_tags":"",
        "job_type":"run",
        "limit":"",
        "scm_branch":"",
        "skip_tags":"",
        "verbosity":"0"
    },
    "inventory_needed_to_start":false,
    "job_template_data":{
        "description":"",
        "id":"2",
        "name":"deploy-job-template"
    },
    "passwords_needed_to_start":[
        "vault_password.abc",
        "vault_password.xyz"
    ],
    "survey_enabled":false,
    "variables_needed_to_start":[
    ]
}
Back to Top