Interface IAMAccessPolicies
- All Known Implementing Classes:
IAMAccessPoliciesImpl
/v1/projects/{projectId}/accessPolicies).
Provides the access policy lifecycle - list / create / get / update / delete and the
enable/disable lifecycle toggles - plus management of the policy's grants (which principals,
groups or projects the policy is granted to). All operations are scoped to a projectId.
ERN addressing. The single-policy operations (get / update / enable / disable / grants)
additionally accept the spec's ERN-addressing form, where projectId is the literal
"*" and accessPolicyId is an Equinix Resource Name (ERN) - or a managed-policy id
- rather than a local accesspolicy: id. Because an ERN contains reserved characters
(: and /), the API requires it to be URL-encoded when used as a path segment.
This SDK does not provide a dedicated byErn overload: the shared core path-substitution
layer does not percent-encode individual path segments, and adding that encoding would require a
core change. Callers needing ERN addressing must therefore pass a pre-URL-encoded ERN as the
accessPolicyId argument together with projectId == "*".
-
Method Summary
Modifier and TypeMethodDescriptionaddGrant(String projectId, String accessPolicyId, AddGrantRequest request) Adds a grant to an access policy.create(String projectId, CreateAccessPolicyRequest request) Creates a new access policy in a project.Deletes an access policy.Disables an access policy.Enables a previously disabled access policy.Retrieves a single access policy by id.Lists the access policies of a project (first page).Lists the access policies of a project, controlling pagination.listGrants(String projectId, String accessPolicyId) Lists the grants of an access policy (first page).listGrants(String projectId, String accessPolicyId, String pageToken, Integer pageSize) Lists the grants of an access policy, controlling pagination.removeGrant(String projectId, String accessPolicyId, String grantId) Removes a grant from an access policy.update(String projectId, String accessPolicyId, UpdateAccessPolicyRequest request) Updates an access policy.
-
Method Details
-
list
Lists the access policies of a project (first page).- Parameters:
projectId- the IAM project id,project:<id>(for exampleproject:abc-123); a bare Resource Manager UUID is rejected, convert it withProjectIds.of(String). Project-scoped endpoints need an STS access-policy token (new IAM(BearerTokenProvider))- Returns:
- the first page of access policies
-
list
Lists the access policies of a project, controlling pagination.- Parameters:
projectId- the IAM project id,project:<id>(for exampleproject:abc-123); a bare Resource Manager UUID is rejected, convert it withProjectIds.of(String). Project-scoped endpoints need an STS access-policy token (new IAM(BearerTokenProvider))pageToken- the opaque page token from a prior response, ornullfor the first pagepageSize- the maximum number of results per page, ornullfor the server default- Returns:
- the requested page of access policies
-
create
Creates a new access policy in a project.- Parameters:
projectId- the IAM project id,project:<id>(for exampleproject:abc-123); a bare Resource Manager UUID is rejected, convert it withProjectIds.of(String). Project-scoped endpoints need an STS access-policy token (new IAM(BearerTokenProvider))request- the access policy to create- Returns:
- the created access policy
-
getByUuid
Retrieves a single access policy by id.- Parameters:
projectId- the IAM project id,project:<id>(for exampleproject:abc-123); a bare Resource Manager UUID is rejected, convert it withProjectIds.of(String). Project-scoped endpoints need an STS access-policy token (new IAM(BearerTokenProvider))accessPolicyId- the access policy identifier- Returns:
- the matching access policy
-
update
Updates an access policy.- Parameters:
projectId- the IAM project id,project:<id>(for exampleproject:abc-123); a bare Resource Manager UUID is rejected, convert it withProjectIds.of(String). Project-scoped endpoints need an STS access-policy token (new IAM(BearerTokenProvider))accessPolicyId- the access policy identifierrequest- the update (the request'slastRevguards against concurrent updates)- Returns:
- the updated access policy
-
delete
Deletes an access policy.The spec requires the policy's last-known revision in the request body for optimistic-concurrency-controlled deletion.
- Parameters:
projectId- the IAM project id,project:<id>(for exampleproject:abc-123); a bare Resource Manager UUID is rejected, convert it withProjectIds.of(String). Project-scoped endpoints need an STS access-policy token (new IAM(BearerTokenProvider))accessPolicyId- the access policy identifierlastRev- the last-known revision of the policy (required; fromAccessPolicy.getRev())- Returns:
trueif the deletion request was accepted
-
enable
Enables a previously disabled access policy.- Parameters:
projectId- the IAM project id,project:<id>(for exampleproject:abc-123); a bare Resource Manager UUID is rejected, convert it withProjectIds.of(String). Project-scoped endpoints need an STS access-policy token (new IAM(BearerTokenProvider))accessPolicyId- the access policy identifierlastRev- the last-known revision of the policy (for concurrency control), ornull- Returns:
- the updated access policy
-
disable
Disables an access policy.- Parameters:
projectId- the IAM project id,project:<id>(for exampleproject:abc-123); a bare Resource Manager UUID is rejected, convert it withProjectIds.of(String). Project-scoped endpoints need an STS access-policy token (new IAM(BearerTokenProvider))accessPolicyId- the access policy identifierlastRev- the last-known revision of the policy (for concurrency control), ornull- Returns:
- the updated access policy
-
listGrants
Lists the grants of an access policy (first page).- Parameters:
projectId- the IAM project id,project:<id>(for exampleproject:abc-123); a bare Resource Manager UUID is rejected, convert it withProjectIds.of(String). Project-scoped endpoints need an STS access-policy token (new IAM(BearerTokenProvider))accessPolicyId- the access policy identifier- Returns:
- the first page of grants
-
listGrants
AccessPolicyGrantList listGrants(String projectId, String accessPolicyId, String pageToken, Integer pageSize) Lists the grants of an access policy, controlling pagination.- Parameters:
projectId- the IAM project id,project:<id>(for exampleproject:abc-123); a bare Resource Manager UUID is rejected, convert it withProjectIds.of(String). Project-scoped endpoints need an STS access-policy token (new IAM(BearerTokenProvider))accessPolicyId- the access policy identifierpageToken- the opaque page token from a prior response, ornullfor the first pagepageSize- the maximum number of results per page, ornullfor the server default- Returns:
- the requested page of grants
-
addGrant
Adds a grant to an access policy.- Parameters:
projectId- the IAM project id,project:<id>(for exampleproject:abc-123); a bare Resource Manager UUID is rejected, convert it withProjectIds.of(String). Project-scoped endpoints need an STS access-policy token (new IAM(BearerTokenProvider))accessPolicyId- the access policy identifierrequest- the grant to add (the grantee and optionallastRev)- Returns:
- the created grant
-
removeGrant
Removes a grant from an access policy.- Parameters:
projectId- the IAM project id,project:<id>(for exampleproject:abc-123); a bare Resource Manager UUID is rejected, convert it withProjectIds.of(String). Project-scoped endpoints need an STS access-policy token (new IAM(BearerTokenProvider))accessPolicyId- the access policy identifiergrantId- the grant identifier- Returns:
trueif the removal request was accepted
-