Run Tasks

class terrasnek.run_tasks.TFCRunTasks(instance_url, org_name, headers, well_known_paths, verify, log_level)

Run Tasks API Docs

attach_task_to_workspace(workspace_id, payload)

POST /workspaces/:workspace_id/tasks

Run Tasks Attach To Workspace API Doc Reference

Attach Sample Payload

create(payload)

POST /organizations/:organization_name/tasks

Run Tasks Create API Doc Reference

Run Tasks Create Sample Payload

destroy(task_id)

DELETE /tasks/:id

Run Tasks Destroy API Doc Reference

list(page=None, page_size=None, include=None)

GET /organizations/:organization_name/tasks

Run Tasks List API Doc Reference

Query Parameter(s) Details

list_all()

This function does not correlate to an endpoint in the TFC API Docs specifically, but rather is a helper function to wrap the list endpoint, which enumerates out every page so users do not have to implement the paging logic every time they just want to list every run trigger for a workspace.

Returns an object with two arrays of objects.

list_all_tasks_on_workspace(workspace_id)

This function does not correlate to an endpoint in the TFC API Docs specifically, but rather is a helper function to wrap the list endpoint, which enumerates out every page so users do not have to implement the paging logic every time they just want to list every policy for an organization.

Returns an object with two arrays of objects.

list_tasks_on_workspace(workspace_id, page=None, page_size=None)

GET /workspaces/:workspace_id/tasks

Run Tasks List On Workspace API Doc Reference

Query Parameter(s) Details

remove_task_from_workspace(workspace_id, task_id)

DELETE /workspaces/:workspace_id/tasks/:id

Run Tasks Remove From Workspace API Doc Reference

required_entitlements()

Terraform Cloud Entitlements required for endpoint to work.

show(task_id, include=None)

GET /tasks/:id

Run Tasks Show API Doc Reference

show_task_on_workspace(workspace_id, task_id)

GET /workspaces/:workspace_id/tasks/:id

Run Tasks Show On Workspace API Doc Reference

terraform_cloud_only()

Return True if this endpoint is only for Terraform Cloud, else False.

terraform_enterprise_only()

Return True if this endpoint is only for Terraform Enterprise, else False.

update(task_id, payload)

PATCH /tasks/:id

Run Tasks Update API Doc Reference

Update Sample Payload

update_task_on_workspace(workspace_id, task_id, payload)

PATCH /workspaces/:workspace_id/tasks/:id

Run Tasks Update On Workspace API Doc Reference

Update On Workspace Sample Payload