Workspaces¶
-
class
terrasnek.workspaces.TFCWorkspaces(instance_url, org_name, headers, well_known_paths, verify, log_level)¶ -
-
add_remote_state_consumers(workspace_id, payload)¶ POST /workspaces/:workspace_id/relationships/remote-state-consumers
POST /workspaces/:workspace_id/relationships/tags
-
assign_ssh_key(workspace_id, payload)¶ PATCH /workspaces/:workspace_id/relationships/ssh-key
-
create(payload)¶ POST /organizations/:organization_name/workspaces
-
delete_remote_state_consumers(workspace_id, payload)¶ DELETE /workspaces/:workspace_id/relationships/remote-state-consumers
-
destroy(workspace_id=None, workspace_name=None)¶ DELETE /organizations/:organization_name/workspaces/:nameDELETE /workspaces/:workspace_id
-
force_unlock(workspace_id)¶ POST /workspaces/:workspace_id/actions/force-unlock
-
get_remote_state_consumers(workspace_id, page=None, page_size=None)¶ GET /workspaces/:workspace_id/relationships/remote-state-consumers
-
list(page=None, page_size=None, include=None, search=None, filters=None)¶ GET /organizations/:organization_name/workspaces
-
list_all(search=None, include=None, filters=None)¶ 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 workspace in an organization.
Returns an object with two arrays of objects.
-
list_all_resources(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 workspace in an organization.
Returns an object with two arrays of objects.
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 workspace in an organization.
Returns an object with two arrays of objects.
-
list_resources(workspace_id, page=None, page_size=None)¶ GET /workspaces/:workspace_id/resources
GET /workspaces/:workspace_id/relationships/tags
-
lock(workspace_id, payload)¶ POST /workspaces/:workspace_id/actions/lock
DELETE /workspaces/:workspace_id/relationships/tags
-
replace_remote_state_consumers(workspace_id, payload)¶ PATCH /workspaces/:workspace_id/relationships/remote-state-consumers
-
required_entitlements()¶ Terraform Cloud Entitlements required for endpoint to work.
-
safe_destroy(workspace_id=None, workspace_name=None)¶ POST /workspaces/:workspace_id/actions/safe-deleteDELETE /organizations/:organization_name/workspaces/:name/actions/safe-deleteTODO / NOTE: the above DELETE should really be a POST, the docs don’t match reality, so need to leave it as DELETE for now since our API comparison script relies on those strings.
-
show(workspace_name=None, workspace_id=None, include=None)¶ GET /organizations/:organization_name/workspaces/:nameGET /workspaces/:workspace_id
-
terraform_cloud_only()¶ Return
Trueif this endpoint is only for Terraform Cloud, elseFalse.
-
terraform_enterprise_only()¶ Return
Trueif this endpoint is only for Terraform Enterprise, elseFalse.
-
unassign_ssh_key(workspace_id, payload)¶ PATCH /workspaces/:workspace_id/relationships/ssh-key
-
unlock(workspace_id)¶ POST /workspaces/:workspace_id/actions/unlock
-
update(payload, workspace_name=None, workspace_id=None)¶ PATCH /organizations/:organization_name/workspaces/:namePATCH /workspaces/:workspace_id
-