Skip to main content

service_perimeters

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

Overview

Nameservice_perimeters
TypeResource
Idgoogle.accesscontextmanager.service_perimeters

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringIdentifier. Resource name for the ServicePerimeter. Format: accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}. The service_perimeter component must begin with a letter, followed by alphanumeric characters or _. After you create a ServicePerimeter, you cannot change its name.
descriptionstringDescription of the ServicePerimeter and its use. Does not affect behavior.
etagstringOptional. An opaque identifier for the current version of the ServicePerimeter. This identifier does not follow any specific format. If an etag is not provided, the operation will be performed as if a valid etag is provided.
perimeterTypestringPerimeter type indicator. A single project or VPC network is allowed to be a member of single regular perimeter, but multiple service perimeter bridges. A project cannot be a included in a perimeter bridge without being included in regular perimeter. For perimeter bridges, the restricted service list as well as access level lists must be empty.
specobjectProposed (or dry run) ServicePerimeter configuration. This configuration allows to specify and test ServicePerimeter configuration without enforcing actual access restrictions. Only allowed to be set when the "use_explicit_dry_run_spec" flag is set. (id: ServicePerimeterConfig)
statusobjectCurrent ServicePerimeter configuration. Specifies sets of resources, restricted services and access levels that determine perimeter content and boundaries. (id: ServicePerimeterConfig)
titlestringHuman readable title. Must be unique within the Policy.
useExplicitDryRunSpecbooleanUse explicit dry run spec flag. Ordinarily, a dry-run spec implicitly exists for all Service Perimeters, and that spec is identical to the status for those Service Perimeters. When this flag is set, it inhibits the generation of the implicit spec, thereby allowing the user to explicitly provide a configuration ("spec") to use in a dry-run version of the Service Perimeter. This allows the user to test changes to the enforced config ("status") without actually enforcing them. This testing is done through analyzing the differences between currently enforced and suggested restrictions. use_explicit_dry_run_spec must bet set to True if any of the fields in the spec are set to non-default values.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectaccessPoliciesId, servicePerimetersIdGets a service perimeter based on the resource name.
listselectaccessPoliciesIdpageSize, pageTokenLists all service perimeters for an access policy.
createinsertaccessPoliciesIdCreates a service perimeter. The long-running operation from this RPC has a successful status after the service perimeter propagates to long-lasting storage. If a service perimeter contains errors, an error response is returned for the first error encountered.
patchupdateaccessPoliciesId, servicePerimetersIdupdateMaskUpdates a service perimeter. The long-running operation from this RPC has a successful status after the service perimeter propagates to long-lasting storage. If a service perimeter contains errors, an error response is returned for the first error encountered.
replace_allreplaceaccessPoliciesIdReplace all existing service perimeters in an access policy with the service perimeters provided. This is done atomically. The long-running operation from this RPC has a successful status after all replacements propagate to long-lasting storage. Replacements containing errors result in an error response for the first error encountered. Upon an error, replacement are cancelled and existing service perimeters are not affected. The Operation.response field contains ReplaceServicePerimetersResponse.
deletedeleteaccessPoliciesId, servicePerimetersIdDeletes a service perimeter based on the resource name. The long-running operation from this RPC has a successful status after the service perimeter is removed from long-lasting storage.
commitexecaccessPoliciesIdCommits the dry-run specification for all the service perimeters in an access policy. A commit operation on a service perimeter involves copying its spec field to the status field of the service perimeter. Only service perimeters with use_explicit_dry_run_spec field set to true are affected by a commit operation. The long-running operation from this RPC has a successful status after the dry-run specifications for all the service perimeters have been committed. If a commit fails, it causes the long-running operation to return an error response and the entire commit operation is cancelled. When successful, the Operation.response field contains CommitServicePerimetersResponse. The dry_run and the spec fields are cleared after a successful commit operation.

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
accessPoliciesIdstring
servicePerimetersIdstring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets a service perimeter based on the resource name.

SELECT
name,
description,
etag,
perimeterType,
spec,
status,
title,
useExplicitDryRunSpec
FROM google.accesscontextmanager.service_perimeters
WHERE accessPoliciesId = '{{ accessPoliciesId }}' -- required
AND servicePerimetersId = '{{ servicePerimetersId }}' -- required;

INSERT examples

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

INSERT INTO google.accesscontextmanager.service_perimeters (
data__name,
data__title,
data__description,
data__perimeterType,
data__status,
data__spec,
data__useExplicitDryRunSpec,
data__etag,
accessPoliciesId
)
SELECT
'{{ name }}',
'{{ title }}',
'{{ description }}',
'{{ perimeterType }}',
'{{ status }}',
'{{ spec }}',
{{ useExplicitDryRunSpec }},
'{{ etag }}',
'{{ accessPoliciesId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates a service perimeter. The long-running operation from this RPC has a successful status after the service perimeter propagates to long-lasting storage. If a service perimeter contains errors, an error response is returned for the first error encountered.

UPDATE google.accesscontextmanager.service_perimeters
SET
data__name = '{{ name }}',
data__title = '{{ title }}',
data__description = '{{ description }}',
data__perimeterType = '{{ perimeterType }}',
data__status = '{{ status }}',
data__spec = '{{ spec }}',
data__useExplicitDryRunSpec = {{ useExplicitDryRunSpec }},
data__etag = '{{ etag }}'
WHERE
accessPoliciesId = '{{ accessPoliciesId }}' --required
AND servicePerimetersId = '{{ servicePerimetersId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;

REPLACE examples

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

REPLACE google.accesscontextmanager.service_perimeters
SET
data__servicePerimeters = '{{ servicePerimeters }}',
data__etag = '{{ etag }}'
WHERE
accessPoliciesId = '{{ accessPoliciesId }}' --required
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a service perimeter based on the resource name. The long-running operation from this RPC has a successful status after the service perimeter is removed from long-lasting storage.

DELETE FROM google.accesscontextmanager.service_perimeters
WHERE accessPoliciesId = '{{ accessPoliciesId }}' --required
AND servicePerimetersId = '{{ servicePerimetersId }}' --required;

Lifecycle Methods

Commits the dry-run specification for all the service perimeters in an access policy. A commit operation on a service perimeter involves copying its spec field to the status field of the service perimeter. Only service perimeters with use_explicit_dry_run_spec field set to true are affected by a commit operation. The long-running operation from this RPC has a successful status after the dry-run specifications for all the service perimeters have been committed. If a commit fails, it causes the long-running operation to return an error response and the entire commit operation is cancelled. When successful, the Operation.response field contains CommitServicePerimetersResponse. The dry_run and the spec fields are cleared after a successful commit operation.

EXEC google.accesscontextmanager.service_perimeters.commit 
@accessPoliciesId='{{ accessPoliciesId }}' --required
@@json=
'{
"etag": "{{ etag }}"
}';