GET /scheduled_jobs/environment_jobs/<job-id>
Retrieve information about a specific scheduled environment job, which is deployment, task, or plan that runs in a specific environment.
Request format
When Forming orchestrator API requests to this endpoint, the URI
path must include the ID of the scheduled job you want to query. For example, this
request queries a scheduled job with ID 81
:
https://orchestrator.example.com:8143/orchestrator/v1/scheduled_jobs/environment_jobs/81
You can use the GET /scheduled_jobs/environment_jobs endpoint to get scheduled job IDs.
Response format
The response is a JSON object that uses these keys to provide the scheduled job's details:
Key | Definition |
---|---|
id
|
The job's absolute URL. |
name
|
A stringified number identifying the job. |
enabled
|
A Boolean indicating whether the job is enabled. |
environment
|
The environment that the job operates in. |
owner
|
The subject ID, email, and other details of the user that requested the job. |
description
|
A user-provided description of the job. This can be empty. |
type
|
The job's type, such as plan , task , or
deploy . |
input
|
An object describing options supplied to the
job, including:
|
userdata
|
An object containing arbitrary key-value pairs supplied by the initiating user, if any were supplied. |
schedule
|
An object describing the job's schedule, including:
|
next_run
|
An object containing an ISO-8601 timestamp indicating the scheduled job's next run time. |
last_run
|
If the job has not yet run, this is null . If the job has run, this is an
object containing an ISO-8601 timestamp of the scheduled job's
most recent run time and a job
object.The |
For example:
{ "name": "https://host.example.com:8143/orchestrator/v1/scheduled_jobs/environment_jobs/2", "id": "2", "environment": "production", "owner": { "email": "fred@example.com", "login": "fred", "display_name": "Fred", "id": "784beba4-8cc8-414f-aab0-e9a29c9b65c2", "is_revoked": false, "last_login": "2020-05-08T15:57:28.444Z", "is_remote": true, "is_group": false, "is_superuser": false, "role_ids": [ 1 ], "inherited_role_ids": [ 2 ], "group_ids": [ "9a588fd8-3daa-4fc2-a396-bf88945def1e" ] }, "description": "Fred's scheduled environment plan", "type": "plan", "next_run": { "time": "2021-12-12T19:50:08Z" }, "last_run": { "time": "2021-11-12T19:50:08Z", "job": { "id": "https://host.example.com:8143/orchestrator/v1/plan_jobs/42", "name": 42 } }, "schedule": { "start_time": "2018-10-05T19:50:08Z", "interval": { "value": 3600, "units": "seconds" } }, "input": { "name": "example_module::example_plan", "parameters": { "param_1": "foo" }, "sensitive_parameters" : ["password"] }, "userdata": { "ticket": "TICKET-123" } }
Error responses
This endpoint's error responses follow the usual format for Orchestrator API error responses.
The endpoint returns a 400 puppetlabs.orchestrator/query-error response if you don't have permission to run queries or the job ID is invalid.