Skip to main content

access_policies

Creates, updates, deletes, gets or lists a access_policies resource.

Overview

Nameaccess_policies
TypeResource
Idgoogle.accesscontextmanager.access_policies

Fields

NameDatatypeDescription
namestringOutput only. Identifier. Resource name of the AccessPolicy. Format: accessPolicies/{access_policy}
etagstringOutput only. An opaque identifier for the current version of the AccessPolicy. This will always be a strongly validated etag, meaning that two Access Policies will be identical if and only if their etags are identical. Clients should not expect this to be in any specific format.
parentstringRequired. The parent of this AccessPolicy in the Cloud Resource Hierarchy. Currently immutable once created. Format: organizations/{organization_id}
scopesarrayThe scopes of the AccessPolicy. Scopes define which resources a policy can restrict and where its resources can be referenced. For example, policy A with scopes=["folders/123"] has the following behavior: - ServicePerimeter can only restrict projects within folders/123. - ServicePerimeter within policy A can only reference access levels defined within policy A. - Only one policy can include a given scope; thus, attempting to create a second policy which includes folders/123 will result in an error. If no scopes are provided, then any resource within the organization can be restricted. Scopes cannot be modified after a policy is created. Policies can only have a single scope. Format: list of folders/{folder_number} or projects/{project_number}
titlestringRequired. Human readable title. Does not affect behavior.

Methods

NameAccessible byRequired ParamsDescription
getSELECTaccessPoliciesIdReturns an access policy based on the name.
listSELECTLists all access policies in an organization.
createINSERTCreates an access policy. This method fails if the organization already has an access policy. The long-running operation has a successful status after the access policy propagates to long-lasting storage. Syntactic and basic semantic errors are returned in metadata as a BadRequest proto.
deleteDELETEaccessPoliciesIdDeletes an access policy based on the resource name. The long-running operation has a successful status after the access policy is removed from long-lasting storage.
patchUPDATEaccessPoliciesIdUpdates an access policy. The long-running operation from this RPC has a successful status after the changes to the access policy propagate to long-lasting storage.

SELECT examples

Lists all access policies in an organization.

SELECT
name,
etag,
parent,
scopes,
title
FROM google.accesscontextmanager.access_policies
;

INSERT example

Use the following StackQL query and manifest file to create a new access_policies resource.

/*+ create */
INSERT INTO google.accesscontextmanager.access_policies (
name,
parent,
title,
scopes
)
SELECT
'{{ name }}',
'{{ parent }}',
'{{ title }}',
'{{ scopes }}'
;

UPDATE example

Updates a access_policies resource.

/*+ update */
UPDATE google.accesscontextmanager.access_policies
SET
name = '{{ name }}',
parent = '{{ parent }}',
title = '{{ title }}',
scopes = '{{ scopes }}'
WHERE
accessPoliciesId = '{{ accessPoliciesId }}';

DELETE example

Deletes the specified access_policies resource.

/*+ delete */
DELETE FROM google.accesscontextmanager.access_policies
WHERE accessPoliciesId = '{{ accessPoliciesId }}';