Interface IAMAccessPolicies

All Known Implementing Classes:
IAMAccessPoliciesImpl

public interface IAMAccessPolicies
Client interface for project-scoped IAM access policies and their grants (/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 Details

    • list

      AccessPolicyList list(String projectId)
      Lists the access policies of a project (first page).
      Parameters:
      projectId - the IAM project id, project:<id> (for example project:abc-123); a bare Resource Manager UUID is rejected, convert it with ProjectIds.of(String). Project-scoped endpoints need an STS access-policy token (new IAM(BearerTokenProvider))
      Returns:
      the first page of access policies
    • list

      AccessPolicyList list(String projectId, String pageToken, Integer pageSize)
      Lists the access policies of a project, controlling pagination.
      Parameters:
      projectId - the IAM project id, project:<id> (for example project:abc-123); a bare Resource Manager UUID is rejected, convert it with ProjectIds.of(String). Project-scoped endpoints need an STS access-policy token (new IAM(BearerTokenProvider))
      pageToken - the opaque page token from a prior response, or null for the first page
      pageSize - the maximum number of results per page, or null for the server default
      Returns:
      the requested page of access policies
    • create

      AccessPolicy create(String projectId, CreateAccessPolicyRequest request)
      Creates a new access policy in a project.
      Parameters:
      projectId - the IAM project id, project:<id> (for example project:abc-123); a bare Resource Manager UUID is rejected, convert it with ProjectIds.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

      AccessPolicy getByUuid(String projectId, String accessPolicyId)
      Retrieves a single access policy by id.
      Parameters:
      projectId - the IAM project id, project:<id> (for example project:abc-123); a bare Resource Manager UUID is rejected, convert it with ProjectIds.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

      AccessPolicy update(String projectId, String accessPolicyId, UpdateAccessPolicyRequest request)
      Updates an access policy.
      Parameters:
      projectId - the IAM project id, project:<id> (for example project:abc-123); a bare Resource Manager UUID is rejected, convert it with ProjectIds.of(String). Project-scoped endpoints need an STS access-policy token (new IAM(BearerTokenProvider))
      accessPolicyId - the access policy identifier
      request - the update (the request's lastRev guards against concurrent updates)
      Returns:
      the updated access policy
    • delete

      Boolean delete(String projectId, String accessPolicyId, String lastRev)
      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 example project:abc-123); a bare Resource Manager UUID is rejected, convert it with ProjectIds.of(String). Project-scoped endpoints need an STS access-policy token (new IAM(BearerTokenProvider))
      accessPolicyId - the access policy identifier
      lastRev - the last-known revision of the policy (required; from AccessPolicy.getRev())
      Returns:
      true if the deletion request was accepted
    • enable

      AccessPolicy enable(String projectId, String accessPolicyId, String lastRev)
      Enables a previously disabled access policy.
      Parameters:
      projectId - the IAM project id, project:<id> (for example project:abc-123); a bare Resource Manager UUID is rejected, convert it with ProjectIds.of(String). Project-scoped endpoints need an STS access-policy token (new IAM(BearerTokenProvider))
      accessPolicyId - the access policy identifier
      lastRev - the last-known revision of the policy (for concurrency control), or null
      Returns:
      the updated access policy
    • disable

      AccessPolicy disable(String projectId, String accessPolicyId, String lastRev)
      Disables an access policy.
      Parameters:
      projectId - the IAM project id, project:<id> (for example project:abc-123); a bare Resource Manager UUID is rejected, convert it with ProjectIds.of(String). Project-scoped endpoints need an STS access-policy token (new IAM(BearerTokenProvider))
      accessPolicyId - the access policy identifier
      lastRev - the last-known revision of the policy (for concurrency control), or null
      Returns:
      the updated access policy
    • listGrants

      AccessPolicyGrantList listGrants(String projectId, String accessPolicyId)
      Lists the grants of an access policy (first page).
      Parameters:
      projectId - the IAM project id, project:<id> (for example project:abc-123); a bare Resource Manager UUID is rejected, convert it with ProjectIds.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 example project:abc-123); a bare Resource Manager UUID is rejected, convert it with ProjectIds.of(String). Project-scoped endpoints need an STS access-policy token (new IAM(BearerTokenProvider))
      accessPolicyId - the access policy identifier
      pageToken - the opaque page token from a prior response, or null for the first page
      pageSize - the maximum number of results per page, or null for the server default
      Returns:
      the requested page of grants
    • addGrant

      AccessPolicyGrant addGrant(String projectId, String accessPolicyId, AddGrantRequest request)
      Adds a grant to an access policy.
      Parameters:
      projectId - the IAM project id, project:<id> (for example project:abc-123); a bare Resource Manager UUID is rejected, convert it with ProjectIds.of(String). Project-scoped endpoints need an STS access-policy token (new IAM(BearerTokenProvider))
      accessPolicyId - the access policy identifier
      request - the grant to add (the grantee and optional lastRev)
      Returns:
      the created grant
    • removeGrant

      Boolean removeGrant(String projectId, String accessPolicyId, String grantId)
      Removes a grant from an access policy.
      Parameters:
      projectId - the IAM project id, project:<id> (for example project:abc-123); a bare Resource Manager UUID is rejected, convert it with ProjectIds.of(String). Project-scoped endpoints need an STS access-policy token (new IAM(BearerTokenProvider))
      accessPolicyId - the access policy identifier
      grantId - the grant identifier
      Returns:
      true if the removal request was accepted