PUT /scheduled_jobs/environment_jobs/<job-id>

Edit or delete scheduled environment jobs.

Request format

When Forming orchestrator API requests to this endpoint, the content type is application/json, the URI path must contain the ID of the job you want to edit, and the body must be a JSON object. The body can contain any of these top-level keys: input, environment, schedule, description, userdata, and enabled. Top-level keys specified in your request completely overwrite existing values for those keys. Omitted top-level keys are unchanged.

If you supply a top-level key, the supplied value completely replaces the key's existing value for the scheduled job.

If you want to add new content to an existing value, such as adding a parameter to the input object, you must supply the key's entire current value and your additional new content.

For descriptions of keys and their contents, refer to POST /scheduled_jobs/environment_jobs. Pay particular attention to the input object, which can have a lot of nested values.

To make sure you aren't missing any values, you can use GET /scheduled_jobs/environment_jobs/<job-id> to get the job's current configuration.

While you can't delete a scheduled job, you can disable the job as a form of soft deletion. To disable a job, supply the following body in your request:

{
  "enabled": false
}

Response format

If the job is successfully edited, the server returns 200 and a JSON object containing the edited job's id and name. For example:

{
  "scheduled_job" : {
    "id" : "https://orchestrator.example.com:8143/orchestrator/v1/scheduled_jobs/environment_jobs/2",
    "name" : "2"
  }
}

Error responses

If there is an error, Orchestrator API error responses provide error information in the kind key. Possible errors include errors described on POST /scheduled_jobs/environment_jobs and 400 puppetlabs.orchestrator/disabled-scheduled-job if you try to edit a disabled job (where "enabled": false).