»Tasks
The /tasks endpoints modify the tasks that Consul-Terraform-Sync is responsible for running.
»Update Task
This endpoint allows patch updates to specifically supported fields for existing tasks. Currently only supports updating a task's enabled value.
| Method | Path | Produces |
|---|---|---|
PATCH |
/tasks/:task_name |
application/json |
»Request Parameters
-
run- (string) Values can be only be "inspect" and "now".- "inspect": Does not update the task but returns information on if/how resources would be changed for the proposed task update.
- "now": Updates the task accordingly and immediately runs the task, rather than allowing the task to run at the natural daemon cadence
»Response Fields
-
inspect- Information on how resources would be changed given a proposed task update, similar to inspect-mode. This is only returned when passed therun=inspectrequest parameter-
changes_present- (bool) Whether or not changes were detected for running the proposed task update -
plan- (string) The Terraform plan generated for the proposed task update . Note: a non-empty string does not necessarily indicate changes were detected.
-
»Example: Disable a task
Request:
Response:
»Example: Inspect enabling a task
Request:
Response if no changes present:
Response if changes present: