GET /api/job_invocations
List job invocations

Examples

GET /api/job_invocations
200
{
  "total": 9,
  "subtotal": 9,
  "page": 1,
  "per_page": 20,
  "search": null,
  "sort": {
    "by": null,
    "order": null
  },
  "results": [
    {
      "id": 149,
      "description": null,
      "job_category": "Job name 131",
      "targeting_id": 152,
      "status": 0,
      "start_at": null,
      "status_label": "succeeded",
      "ssh_user": null,
      "time_to_pickup": null,
      "concurrency_level": null,
      "execution_timeout_interval": null,
      "dynflow_task": {
        "id": "b6f33b97-3cd7-4f88-afe2-d1e7edd268a1",
        "state": "stopped"
      },
      "template_id": 1007981928,
      "template_name": "Job template 131",
      "effective_user": "root",
      "succeeded": 0,
      "failed": 0,
      "pending": 0,
      "cancelled": 0,
      "total": "N/A",
      "missing": 0,
      "total_hosts": "N/A"
    },
    {
      "id": 148,
      "description": null,
      "job_category": "Job name 133",
      "targeting_id": 154,
      "status": 2,
      "start_at": null,
      "status_label": "queued",
      "ssh_user": null,
      "time_to_pickup": null,
      "concurrency_level": null,
      "execution_timeout_interval": null,
      "dynflow_task": null,
      "template_id": null,
      "template_name": null,
      "effective_user": null,
      "succeeded": 0,
      "failed": 0,
      "pending": 0,
      "cancelled": 0,
      "total": "N/A",
      "missing": 0,
      "total_hosts": "N/A"
    },
    {
      "id": 147,
      "description": null,
      "job_category": "Job name 132",
      "targeting_id": 153,
      "status": 2,
      "start_at": null,
      "status_label": "queued",
      "ssh_user": null,
      "time_to_pickup": null,
      "concurrency_level": null,
      "execution_timeout_interval": null,
      "dynflow_task": null,
      "template_id": null,
      "template_name": null,
      "effective_user": null,
      "succeeded": 0,
      "failed": 0,
      "pending": 0,
      "cancelled": 0,
      "total": "N/A",
      "missing": 0,
      "total_hosts": "N/A"
    },
    {
      "id": 146,
      "description": null,
      "job_category": "Job name 128",
      "targeting_id": 149,
      "status": 0,
      "start_at": null,
      "status_label": "succeeded",
      "ssh_user": null,
      "time_to_pickup": null,
      "concurrency_level": null,
      "execution_timeout_interval": null,
      "dynflow_task": {
        "id": "ad344a31-ff03-4a49-b0ce-bddf005382b5",
        "state": "stopped"
      },
      "template_id": 1007981926,
      "template_name": "Job template 129",
      "effective_user": "root",
      "succeeded": 0,
      "failed": 0,
      "pending": 0,
      "cancelled": 0,
      "total": "N/A",
      "missing": 0,
      "total_hosts": "N/A"
    },
    {
      "id": 145,
      "description": null,
      "job_category": "Job name 130",
      "targeting_id": 151,
      "status": 2,
      "start_at": null,
      "status_label": "queued",
      "ssh_user": null,
      "time_to_pickup": null,
      "concurrency_level": null,
      "execution_timeout_interval": null,
      "dynflow_task": null,
      "template_id": null,
      "template_name": null,
      "effective_user": null,
      "succeeded": 0,
      "failed": 0,
      "pending": 0,
      "cancelled": 0,
      "total": "N/A",
      "missing": 0,
      "total_hosts": "N/A"
    },
    {
      "id": 144,
      "description": null,
      "job_category": "Job name 129",
      "targeting_id": 150,
      "status": 2,
      "start_at": null,
      "status_label": "queued",
      "ssh_user": null,
      "time_to_pickup": null,
      "concurrency_level": null,
      "execution_timeout_interval": null,
      "dynflow_task": null,
      "template_id": null,
      "template_name": null,
      "effective_user": null,
      "succeeded": 0,
      "failed": 0,
      "pending": 0,
      "cancelled": 0,
      "total": "N/A",
      "missing": 0,
      "total_hosts": "N/A"
    },
    {
      "id": 143,
      "description": null,
      "job_category": "Job name 121",
      "targeting_id": 146,
      "status": 0,
      "start_at": null,
      "status_label": "succeeded",
      "ssh_user": null,
      "time_to_pickup": null,
      "concurrency_level": null,
      "execution_timeout_interval": null,
      "dynflow_task": {
        "id": "94769594-122a-43f0-9fa0-c5a2a3a643e6",
        "state": "stopped"
      },
      "template_id": 1007981923,
      "template_name": "Job template 126",
      "effective_user": "root",
      "succeeded": 0,
      "failed": 0,
      "pending": 0,
      "cancelled": 0,
      "total": "N/A",
      "missing": 0,
      "total_hosts": "N/A"
    },
    {
      "id": 142,
      "description": null,
      "job_category": "Job name 127",
      "targeting_id": 148,
      "status": 2,
      "start_at": null,
      "status_label": "queued",
      "ssh_user": null,
      "time_to_pickup": null,
      "concurrency_level": null,
      "execution_timeout_interval": null,
      "dynflow_task": null,
      "template_id": null,
      "template_name": null,
      "effective_user": null,
      "succeeded": 0,
      "failed": 0,
      "pending": 0,
      "cancelled": 0,
      "total": "N/A",
      "missing": 0,
      "total_hosts": "N/A"
    },
    {
      "id": 141,
      "description": null,
      "job_category": "Job name 126",
      "targeting_id": 147,
      "status": 2,
      "start_at": null,
      "status_label": "queued",
      "ssh_user": null,
      "time_to_pickup": null,
      "concurrency_level": null,
      "execution_timeout_interval": null,
      "dynflow_task": null,
      "template_id": null,
      "template_name": null,
      "effective_user": null,
      "succeeded": 0,
      "failed": 0,
      "pending": 0,
      "cancelled": 0,
      "total": "N/A",
      "missing": 0,
      "total_hosts": "N/A"
    }
  ]
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Integer

search
optional

filter results

Validations:

  • String

order
optional

Sort and order by a searchable field, e.g. '<field> DESC'

Validations:

  • String

page
optional

Page number, starting at 1

Validations:

  • Must be a number.

per_page
optional

Number of results per page to return, 'all' to return all results

Validations:

  • Must match regular expression /\A([1-9]\d*|all)\Z$/.


GET /api/job_invocations/:id
Show job invocation

Examples

GET /api/job_invocations/158
200
{
  "id": 158,
  "description": null,
  "job_category": "Job name 140",
  "targeting_id": 161,
  "status": 0,
  "start_at": null,
  "status_label": "succeeded",
  "ssh_user": null,
  "time_to_pickup": null,
  "concurrency_level": null,
  "execution_timeout_interval": null,
  "dynflow_task": {
    "id": "80591701-191c-46c1-b2d7-f1f68101ec82",
    "state": "stopped"
  },
  "template_id": 1007981935,
  "template_name": "Job template 138",
  "effective_user": "root",
  "succeeded": 0,
  "failed": 0,
  "pending": 0,
  "cancelled": 0,
  "total": "N/A",
  "missing": 0,
  "total_hosts": "N/A",
  "targeting": {
    "bookmark_id": null,
    "bookmark_name": null,
    "search_query": "name = foo",
    "targeting_type": "static_query",
    "user_id": 988725830,
    "randomized_ordering": false,
    "hosts": [
      {
        "name": "host110",
        "id": 105,
        "display_name": "host110"
      }
    ]
  },
  "task": {
    "id": "80591701-191c-46c1-b2d7-f1f68101ec82",
    "state": "stopped"
  },
  "mode": "immediate",
  "pattern_template_invocations": [
    {
      "template_id": 1007981935,
      "template_name": "Job template 138",
      "host_id": null,
      "template_invocation_input_values": []
    }
  ],
  "job_organization": null,
  "job_location": null
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Integer

id
required

Validations:

  • string from 2 to 128 characters containing only alphanumeric characters, space, '_', '-' with no leading or trailing space..

host_status
optional

Show Job status for the hosts

Validations:

  • Must be one of: true, false, 1, 0.


POST /api/job_invocations
Create a job invocation

Examples

POST /api/job_invocations
{
  "job_invocation": {
    "job_category": "Job name 14",
    "name": "RandomName",
    "job_template_id": 1007981748,
    "targeting_type": "static_query",
    "search_query": "foobar",
    "recurrence": {
      "cron_line": "5 * * * *"
    }
  }
}
201
{
  "id": 21,
  "description": "Job template 16 with inputs Template input 8=\"''\"",
  "job_category": "Job name 14",
  "targeting_id": 23,
  "status": 2,
  "start_at": "2025-02-24 15:05:00 UTC",
  "status_label": "queued",
  "ssh_user": null,
  "time_to_pickup": null,
  "concurrency_level": null,
  "execution_timeout_interval": null,
  "dynflow_task": {
    "id": "041b3496-ec53-4f9e-92ba-e285153c8c21",
    "state": "scheduled"
  },
  "template_id": 1007981748,
  "template_name": "Job template 16",
  "effective_user": "root",
  "succeeded": 0,
  "failed": 0,
  "pending": 0,
  "cancelled": 0,
  "total": "N/A",
  "missing": 0,
  "total_hosts": 0,
  "targeting": {
    "bookmark_id": null,
    "bookmark_name": null,
    "search_query": "foobar",
    "targeting_type": "static_query",
    "user_id": 135138680,
    "randomized_ordering": null,
    "hosts": []
  },
  "task": {
    "id": "041b3496-ec53-4f9e-92ba-e285153c8c21",
    "state": "scheduled"
  },
  "mode": "recurring",
  "recurrence": {
    "id": 1,
    "cron_line": "5 * * * *",
    "end_time": null,
    "iteration": 1,
    "task_group_id": 8,
    "state": "active",
    "max_iteration": null,
    "purpose": null,
    "task_count": 1,
    "action": "Run hosts job:",
    "last_occurence": null,
    "next_occurence": "2025-02-24 15:05:00 UTC"
  },
  "pattern_template_invocations": null,
  "job_organization": null,
  "job_location": null
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Integer

job_invocation
required

Validations:

  • Hash

job_invocation[job_template_id]
optional , nil allowed

The job template to use, parameter is required unless feature was specified

Validations:

  • String

job_invocation[targeting_type]
required

Invocation type, one of {“static_query”=>“Static Query”, “dynamic_query”=>“Dynamic Query”}

Validations:

  • String

job_invocation[randomized_ordering]
optional , nil allowed

Execute the jobs on hosts in randomized order

Validations:

  • Must be one of: true, false, 1, 0.

job_invocation[inputs]
optional , nil allowed

Inputs to use

Validations:

  • Hash

job_invocation[ssh]
optional , nil allowed

SSH provider specific options

Validations:

  • Hash

job_invocation[ssh][effective_user]
optional , nil allowed

What user should be used to run the script (using sudo-like mechanisms). Defaults to a template parameter or global setting.

Validations:

  • String

job_invocation[ssh][effective_user_password]
optional , nil allowed

Set password for effective user (using sudo-like mechanisms)

Validations:

  • String

job_invocation[ssh_user]
optional , nil allowed

Set SSH user

Validations:

  • String

job_invocation[password]
optional , nil allowed

Set SSH password

Validations:

  • String

job_invocation[key_passphrase]
optional , nil allowed

Set SSH key passphrase

Validations:

  • String

job_invocation[recurrence]
optional , nil allowed

Create a recurring job

Validations:

  • Hash

job_invocation[recurrence][cron_line]
optional , nil allowed

How often the job should occur, in the cron format

Validations:

  • String

job_invocation[recurrence][max_iteration]
optional , nil allowed

Repeat a maximum of N times

Validations:

  • Must be a number.

job_invocation[recurrence][end_time]
optional , nil allowed

Perform no more executions after this time

Validations:

  • DateTime

job_invocation[recurrence][purpose]
optional , nil allowed

Designation of a special purpose

Validations:

  • String

job_invocation[scheduling]
optional , nil allowed

Schedule the job to start at a later time

Validations:

  • Hash

job_invocation[scheduling][start_at]
optional , nil allowed

Schedule the job for a future time

Validations:

  • DateTime

job_invocation[scheduling][start_before]
optional , nil allowed

Indicates that the action should be cancelled if it cannot be started before this time.

Validations:

  • DateTime

job_invocation[concurrency_control]
optional , nil allowed

Control concurrency level and distribution over time

Validations:

  • Hash

job_invocation[concurrency_control][concurrency_level]
optional , nil allowed

Run at most N tasks at a time

Validations:

  • Integer

job_invocation[bookmark_id]
optional , nil allowed

Validations:

  • Integer

job_invocation[search_query]
optional , nil allowed

Validations:

  • String

job_invocation[description_format]
optional , nil allowed

Override the description format from the template for this invocation only

Validations:

  • String

job_invocation[execution_timeout_interval]
optional , nil allowed

Override the timeout interval from the template for this invocation only

Validations:

  • Integer

job_invocation[feature]
optional , nil allowed

Remote execution feature label that should be triggered, job template assigned to this feature will be used

Validations:

  • String

job_invocation[time_to_pickup]
optional , nil allowed

Override the global time to pickup interval for this invocation only

Validations:

  • Integer

job_invocation[ansible]
optional , nil allowed

Ansible provider specific inputs

Validations:

  • Hash

job_invocation[ansible][tags]
optional , nil allowed

A comma separated list of tags to use for Ansible run

Validations:

  • String

job_invocation[ansible][tags_flag]
optional , nil allowed

IncludeExclude tags for Ansible run

Validations:

  • Must be one of: include, exclude.


GET /api/job_invocations/:id/hosts/:host_id
Get output for a host

Examples

GET /api/job_invocations/71/hosts/33
200
{
  "complete": true,
  "refresh": false,
  "output": []
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Integer

id
required

Validations:

  • string from 2 to 128 characters containing only alphanumeric characters, space, '_', '-' with no leading or trailing space..

host_id
required

Validations:

  • string from 2 to 128 characters containing only alphanumeric characters, space, '_', '-' with no leading or trailing space..

since
optional

Validations:

  • String


GET /api/job_invocations/:id/hosts
List hosts belonging to job invocation

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Integer

search
optional

filter results

Validations:

  • String

order
optional

Sort and order by a searchable field, e.g. '<field> DESC'

Validations:

  • String

page
optional

Page number, starting at 1

Validations:

  • Must be a number.

per_page
optional

Number of results per page to return, 'all' to return all results

Validations:

  • Must match regular expression /\A([1-9]\d*|all)\Z$/.

id
required

Validations:

  • string from 2 to 128 characters containing only alphanumeric characters, space, '_', '-' with no leading or trailing space..

Search fields

Field name Type Possible values
description string
ended_at datetime
host string
id integer
job_category string
owner string
pattern_template_name string
recurring true, false
recurring_logic.id integer
recurring_logic.purpose string
start_at datetime
started_at datetime
status succeeded, failed, queued, running, cancelled
targeted_host_id string
user string

GET /api/job_invocations/:id/hosts/:host_id/raw
Get raw output for a host

Examples

GET /api/job_invocations/90/hosts/46/raw
200
{
  "complete": false,
  "refresh": true,
  "output": null,
  "delayed": true,
  "start_at": "2025-02-24T10:01:14.541-05:00"
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Integer

id
required

Validations:

  • string from 2 to 128 characters containing only alphanumeric characters, space, '_', '-' with no leading or trailing space..

host_id
required

Validations:

  • string from 2 to 128 characters containing only alphanumeric characters, space, '_', '-' with no leading or trailing space..


POST /api/job_invocations/:id/cancel
Cancel job invocation

Examples

POST /api/job_invocations/224/cancel
{
  "force": true,
  "job_invocation": {}
}
200
{
  "cancelled": true,
  "id": 224
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Integer

id
required

Validations:

  • string from 2 to 128 characters containing only alphanumeric characters, space, '_', '-' with no leading or trailing space..

force
optional

Validations:

  • Must be one of: true, false, 1, 0.


POST /api/job_invocations/:id/rerun
Rerun job on failed hosts

Examples

POST /api/job_invocations/217/rerun
{
  "failed_only": true,
  "job_invocation": {}
}
201
{
  "id": 218,
  "targeting_id": 230,
  "job_category": "Job name 206",
  "task_id": "8b56d0d5-5b28-4eb1-b77d-db786e2dd437",
  "task_group_id": 19,
  "triggering_id": 17,
  "description": null,
  "concurrency_level": null,
  "execution_timeout_interval": null,
  "password": null,
  "key_passphrase": null,
  "remote_execution_feature_id": null,
  "effective_user_password": null,
  "ssh_user": null,
  "time_to_pickup": null
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Integer

id
required

Validations:

  • string from 2 to 128 characters containing only alphanumeric characters, space, '_', '-' with no leading or trailing space..

failed_only
optional

Validations:

  • Must be one of: true, false, 1, 0.

succeeded_only
optional

Validations:

  • Must be one of: true, false, 1, 0.


GET /api/job_invocations/:id/outputs
Get outputs of hosts in a job

Examples

GET /api/job_invocations/316/outputs
200
{
  "outputs": []
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Integer

id
required

Validations:

  • string from 2 to 128 characters containing only alphanumeric characters, space, '_', '-' with no leading or trailing space..

search_query
optional

Validations:

  • string from 2 to 128 characters containing only alphanumeric characters, space, '_', '-' with no leading or trailing space..

since
optional

Validations:

  • String

raw
optional

Validations:

  • String