Skip to main content

access_levels

Creates, updates, deletes, gets or lists an access_levels resource.

Overview

Nameaccess_levels
TypeResource
Idgoogle.accesscontextmanager.access_levels

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringIdentifier. Resource name for the AccessLevel. Format: accessPolicies/{access_policy}/accessLevels/{access_level}. The access_level component must begin with a letter, followed by alphanumeric characters or _. Its maximum length is 50 characters. After you create an AccessLevel, you cannot change its name.
basicobjectA BasicLevel composed of Conditions. (id: BasicLevel)
customobjectA CustomLevel written in the Common Expression Language. (id: CustomLevel)
descriptionstringDescription of the AccessLevel and its use. Does not affect behavior.
titlestringHuman readable title. Must be unique within the Policy.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectaccessPoliciesId, accessLevelsIdaccessLevelFormatGets an access level based on the resource name.
listselectaccessPoliciesIdpageSize, pageToken, accessLevelFormatLists all access levels for an access policy.
createinsertaccessPoliciesIdCreates an access level. The long-running operation from this RPC has a successful status after the access level propagates to long-lasting storage. If access levels contain errors, an error response is returned for the first error encountered.
patchupdateaccessPoliciesId, accessLevelsIdupdateMaskUpdates an access level. The long-running operation from this RPC has a successful status after the changes to the access level propagate to long-lasting storage. If access levels contain errors, an error response is returned for the first error encountered.
replace_allreplaceaccessPoliciesIdReplaces all existing access levels in an access policy with the access levels provided. This is done atomically. The long-running operation from this RPC has a successful status after all replacements propagate to long-lasting storage. If the replacement contains errors, an error response is returned for the first error encountered. Upon error, the replacement is cancelled, and existing access levels are not affected. The Operation.response field contains ReplaceAccessLevelsResponse. Removing access levels contained in existing service perimeters result in an error.
deletedeleteaccessPoliciesId, accessLevelsIdDeletes an access level based on the resource name. The long-running operation from this RPC has a successful status after the access level has been removed from long-lasting storage.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
accessLevelsIdstring
accessPoliciesIdstring
accessLevelFormatstring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets an access level based on the resource name.

SELECT
name,
basic,
custom,
description,
title
FROM google.accesscontextmanager.access_levels
WHERE accessPoliciesId = '{{ accessPoliciesId }}' -- required
AND accessLevelsId = '{{ accessLevelsId }}' -- required
AND accessLevelFormat = '{{ accessLevelFormat }}';

INSERT examples

Creates an access level. The long-running operation from this RPC has a successful status after the access level propagates to long-lasting storage. If access levels contain errors, an error response is returned for the first error encountered.

INSERT INTO google.accesscontextmanager.access_levels (
data__name,
data__title,
data__description,
data__basic,
data__custom,
accessPoliciesId
)
SELECT
'{{ name }}',
'{{ title }}',
'{{ description }}',
'{{ basic }}',
'{{ custom }}',
'{{ accessPoliciesId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates an access level. The long-running operation from this RPC has a successful status after the changes to the access level propagate to long-lasting storage. If access levels contain errors, an error response is returned for the first error encountered.

UPDATE google.accesscontextmanager.access_levels
SET
data__name = '{{ name }}',
data__title = '{{ title }}',
data__description = '{{ description }}',
data__basic = '{{ basic }}',
data__custom = '{{ custom }}'
WHERE
accessPoliciesId = '{{ accessPoliciesId }}' --required
AND accessLevelsId = '{{ accessLevelsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;

REPLACE examples

Replaces all existing access levels in an access policy with the access levels provided. This is done atomically. The long-running operation from this RPC has a successful status after all replacements propagate to long-lasting storage. If the replacement contains errors, an error response is returned for the first error encountered. Upon error, the replacement is cancelled, and existing access levels are not affected. The Operation.response field contains ReplaceAccessLevelsResponse. Removing access levels contained in existing service perimeters result in an error.

REPLACE google.accesscontextmanager.access_levels
SET
data__accessLevels = '{{ accessLevels }}',
data__etag = '{{ etag }}'
WHERE
accessPoliciesId = '{{ accessPoliciesId }}' --required
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes an access level based on the resource name. The long-running operation from this RPC has a successful status after the access level has been removed from long-lasting storage.

DELETE FROM google.accesscontextmanager.access_levels
WHERE accessPoliciesId = '{{ accessPoliciesId }}' --required
AND accessLevelsId = '{{ accessLevelsId }}' --required;