Policies¶
-
class
terrasnek.policies.TFCPolicies(instance_url, org_name, headers, well_known_paths, verify, log_level)¶ -
-
create(payload)¶ POST /organizations/:organization_name/policies
-
destroy(policy_id)¶ DELETE /policies/:policy_id
-
get_policy_text(policy_id)¶ GET /policies/:policy_id/downloadThis endpoint is currently not documented in the offical TFC API docs. You can find a reference to it in the sample response <https://www.terraform.io/docs/cloud/api/policies.html#sample-response-1> for the show function.
-
list(page=None, page_size=None, search=None)¶ GET /organizations/:organization_name/policiesPolicies List API Doc Reference
- Query Parameter(s) (details):
page(Optional)page_size(Optional)search(Optional)
-
list_all(search=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 policy for an organization.
Returns an array of objects.
-
required_entitlements()¶ Terraform Cloud Entitlements required for endpoint to work.
-
show(policy_id)¶ GET /policies/:policy_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.
-
update(policy_id, payload)¶ PATCH /policies/:policy_id
-
upload(policy_id, payload)¶ PUT /policies/:policy_id/upload
-