Documentation

21. System Job List API Endpoint

Make a GET request to this resource to retrieve the list of system jobs.

GET /api/v1/system_jobs/
HTTP 200 OK
Content-Type: application/json
Vary: Accept
Allow: GET, POST, HEAD, OPTIONS
X-API-Time: 0.049s

The resulting data structure contains:

{
    "count": 99,
    "next": null,
    "previous": null,
    "results": [
        ...
    ]
}

The count field indicates the total number of system jobs found for the given query. The next and previous fields provides links to additional results if there are more than will fit on a single page. The results list contains zero or more system job records.

21.1. Results

Each system job data structure includes the following fields:

  • id: Database ID for this system job. (integer)
  • type: Data type for this system job. (multiple choice)
    • system_job: Management Job
  • url: URL for this system job. (string)
  • related: Data structure with URLs of related resources. (object)
  • summary_fields: Data structure with name/description for related resources. (object)
  • created: Timestamp when this system job was created. (datetime)
  • modified: Timestamp when this system job was last modified. (datetime)
  • name: (string)
  • description: (string)
  • unified_job_template: (field)
  • launch_type: (multiple choice)
    • manual: Manual
    • callback: Callback
    • scheduled: Scheduled
    • dependency: Dependency
  • status: (multiple choice)
    • new: New
    • pending: Pending
    • waiting: Waiting
    • running: Running
    • successful: Successful
    • failed: Failed
    • error: Error
    • canceled: Canceled
  • failed: (boolean)
  • started: (datetime)
  • finished: (datetime)
  • elapsed: (decimal)
  • job_explanation: (string)
  • system_job_template: (field)
  • job_type: (multiple choice)
    • "": ———
    • cleanup_jobs: Remove jobs older than a certain number of days
    • cleanup_activitystream: Remove activity stream entries older than a certain number of days
    • cleanup_deleted: Purge previously deleted items from the database
    • cleanup_facts: Purge and/or reduce the granularity of system tracking data
  • extra_vars: (string)

21.2. Create System Jobs

Make a POST request to this resource with the following system job fields to create a new system job:

  • name: (string, required)
  • description: (string, default=””)
  • system_job_template: (field, default=None)
  • job_type: (multiple choice)
    • "": ——— (default)
    • cleanup_jobs: Remove jobs older than a certain number of days
    • cleanup_activitystream: Remove activity stream entries older than a certain number of days
    • cleanup_deleted: Purge previously deleted items from the database
    • cleanup_facts: Purge and/or reduce the granularity of system tracking data
  • extra_vars: (string, default=””)

21.3. Reviewing the Options Endpoint

The Options Endpoint table offers a view of the Options for this endpoint. When viewing the endpoint in the browsable API, clicking the “Options” button gives you the raw JSON for the following:

name System Job List
description # List System Jobs: Make a GET request to this resource to retrieve the list of system jobs.
renders
0 application/json
1 text/html
parses
0 application/json
added_in_version 1.2
actions
POST
name
type string
required
true
label name
max_length 512
description
type string
required
false
label description
default (Empty Text)
system_job_template
type field
required
false
default null
job_type
type multiple choice
required
false
label job type
default (Empty Text)
choices
0
0 (Empty Text)
1 ---------
1
0 cleanup_jobs
1 Remove jobs older than a certain number of days
2
0 cleanup_activitystream
1 Remove activity stream entries older than a certain number of days
3
0 cleanup_deleted
1 Purge previously deleted items from the database
4
0 cleanup_facts
1 Purge and/or reduce the granularity of system tracking data
extra_vars
type string
required
false
label extra vars
default (Empty Text)
GET
id
type integer
label ID
help_text Database ID for this system job.
type
type multiple choice
help_text Data type for this system job.
choices
0
0 system_job
1 Management Job
url
type string
help_text URL for this system job.
related
type object
help_text Data structure with URLs of related resources.
summary_fields
type object
help_text Data structure with name/description for related resources.
created
type datetime
help_text Timestamp when this system job was created.
modified
type datetime
help_text Timestamp when this system job was last modified.
name
type string
label name
description
type string
label description
unified_job_template
type field
label unified job template
launch_type
type multiple choice
label launch type
choices
0
0 manual
1 Manual
1
0 callback
1 Callback
2
0 scheduled
1 Scheduled
3
0 dependency
1 Dependency
status
type multiple choice
label status
choices
0
0 new
1 New
1
0 pending
1 Pending
2
0 waiting
1 Waiting
3
0 running
1 Running
4
0 successful
1 Successful
5
0 failed
1 Failed
6
0 error
1 Error
7
0 canceled
1 Canceled
failed
type boolean
label failed
started
type datetime
label started
finished
type datetime
label finished
elapsed
type decimal
label elapsed
job_explanation
type string
label job explanation
system_job_template
type field
job_type
type multiple choice
label job type
choices
0
0 (Empty Text)
1 ---------
1
0 cleanup_jobs
1 Remove jobs older than a certain number of days
2
0 cleanup_activitystream
1 Remove activity stream entries older than a certain number of days
3
0 cleanup_deleted
1 Purge previously deleted items from the database
4
0 cleanup_facts
1 Purge and/or reduce the granularity of system tracking data
extra_vars
type string
label extra vars
types
0 system_job
search_fields
0 description
1 name