Skip to main content

constraints

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

Overview

Nameconstraints
TypeResource
Idgoogle.orgpolicy.constraints

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringImmutable. The resource name of the constraint. Must be in one of the following forms: * projects/{project_number}/constraints/{constraint_name} * folders/{folder_id}/constraints/{constraint_name} * organizations/{organization_id}/constraints/{constraint_name} For example, "/projects/123/constraints/compute.disableSerialPortAccess".
booleanConstraintobjectDefines this constraint as being a boolean constraint. (id: GoogleCloudOrgpolicyV2ConstraintBooleanConstraint)
constraintDefaultstringThe evaluation behavior of this constraint in the absence of a policy.
descriptionstringDetailed description of what this constraint controls as well as how and where it is enforced. Mutable.
displayNamestringThe human readable name. Mutable.
equivalentConstraintstringManaged constraint and canned constraint sometimes can have equivalents. This field is used to store the equivalent constraint name.
listConstraintobjectDefines this constraint as being a list constraint. (id: GoogleCloudOrgpolicyV2ConstraintListConstraint)
supportsDryRunbooleanShows if dry run is supported for this constraint or not.
supportsSimulationbooleanShows if simulation is supported for this constraint or not.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_constraints_listselectprojectsIdpageSize, pageTokenLists constraints that could be applied on the specified resource.
folders_constraints_listselectfoldersIdpageSize, pageTokenLists constraints that could be applied on the specified resource.
organizations_constraints_listselectorganizationsIdpageSize, pageTokenLists constraints that could be applied on the specified resource.

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
foldersIdstring
organizationsIdstring
projectsIdstring
pageSizeinteger (int32)
pageTokenstring

SELECT examples

Lists constraints that could be applied on the specified resource.

SELECT
name,
booleanConstraint,
constraintDefault,
description,
displayName,
equivalentConstraint,
listConstraint,
supportsDryRun,
supportsSimulation
FROM google.orgpolicy.constraints
WHERE projectsId = '{{ projectsId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';