org_policy_violations_previews
Creates, updates, deletes, gets or lists an org_policy_violations_previews
resource.
Overview
Name | org_policy_violations_previews |
Type | Resource |
Id | google.policysimulator.org_policy_violations_previews |
Fields
The following fields are returned by SELECT
queries:
- organizations_locations_org_policy_violations_previews_get
- organizations_locations_org_policy_violations_previews_list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output only. The resource name of the OrgPolicyViolationsPreview . It has the following format: organizations/{organization}/locations/{location}/orgPolicyViolationsPreviews/{orgPolicyViolationsPreview} Example: organizations/my-example-org/locations/global/orgPolicyViolationsPreviews/506a5f7f |
createTime | string (google-datetime) | Output only. Time when this OrgPolicyViolationsPreview was created. |
customConstraints | array | Output only. The names of the constraints against which all OrgPolicyViolations were evaluated. If OrgPolicyOverlay only contains PolicyOverlay then it contains the name of the configured custom constraint, applicable to the specified policies. Otherwise it contains the name of the constraint specified in CustomConstraintOverlay . Format: organizations/{organization_id}/customConstraints/{custom_constraint_id} Example: organizations/123/customConstraints/custom.createOnlyE2TypeVms |
overlay | object | Required. The proposed changes we are previewing violations for. (id: GoogleCloudPolicysimulatorV1OrgPolicyOverlay) |
resourceCounts | object | Output only. A summary of the state of all resources scanned for compliance with the changed OrgPolicy. (id: GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreviewResourceCounts) |
state | string | Output only. The state of the OrgPolicyViolationsPreview . |
violationsCount | integer (int32) | Output only. The number of OrgPolicyViolations in this OrgPolicyViolationsPreview . This count may differ from resource_summary.noncompliant_count because each OrgPolicyViolation is specific to a resource and constraint. If there are multiple constraints being evaluated (i.e. multiple policies in the overlay), a single resource may violate multiple constraints. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output only. The resource name of the OrgPolicyViolationsPreview . It has the following format: organizations/{organization}/locations/{location}/orgPolicyViolationsPreviews/{orgPolicyViolationsPreview} Example: organizations/my-example-org/locations/global/orgPolicyViolationsPreviews/506a5f7f |
createTime | string (google-datetime) | Output only. Time when this OrgPolicyViolationsPreview was created. |
customConstraints | array | Output only. The names of the constraints against which all OrgPolicyViolations were evaluated. If OrgPolicyOverlay only contains PolicyOverlay then it contains the name of the configured custom constraint, applicable to the specified policies. Otherwise it contains the name of the constraint specified in CustomConstraintOverlay . Format: organizations/{organization_id}/customConstraints/{custom_constraint_id} Example: organizations/123/customConstraints/custom.createOnlyE2TypeVms |
overlay | object | Required. The proposed changes we are previewing violations for. (id: GoogleCloudPolicysimulatorV1OrgPolicyOverlay) |
resourceCounts | object | Output only. A summary of the state of all resources scanned for compliance with the changed OrgPolicy. (id: GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreviewResourceCounts) |
state | string | Output only. The state of the OrgPolicyViolationsPreview . |
violationsCount | integer (int32) | Output only. The number of OrgPolicyViolations in this OrgPolicyViolationsPreview . This count may differ from resource_summary.noncompliant_count because each OrgPolicyViolation is specific to a resource and constraint. If there are multiple constraints being evaluated (i.e. multiple policies in the overlay), a single resource may violate multiple constraints. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
organizations_locations_org_policy_violations_previews_get | select | organizationsId , locationsId , orgPolicyViolationsPreviewsId | GetOrgPolicyViolationsPreview gets the specified OrgPolicyViolationsPreview. Each OrgPolicyViolationsPreview is available for at least 7 days. | |
organizations_locations_org_policy_violations_previews_list | select | organizationsId , locationsId | pageSize , pageToken | ListOrgPolicyViolationsPreviews lists each OrgPolicyViolationsPreview in an organization. Each OrgPolicyViolationsPreview is available for at least 7 days. |
organizations_locations_org_policy_violations_previews_create | insert | organizationsId , locationsId | orgPolicyViolationsPreviewId | CreateOrgPolicyViolationsPreview creates an OrgPolicyViolationsPreview for the proposed changes in the provided OrgPolicyViolationsPreview.OrgPolicyOverlay. The changes to OrgPolicy are specified by this OrgPolicyOverlay . The resources to scan are inferred from these specified changes. |
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.
Name | Datatype | Description |
---|---|---|
locationsId | string | |
orgPolicyViolationsPreviewsId | string | |
organizationsId | string | |
orgPolicyViolationsPreviewId | string | |
pageSize | integer (int32) | |
pageToken | string |
SELECT
examples
- organizations_locations_org_policy_violations_previews_get
- organizations_locations_org_policy_violations_previews_list
GetOrgPolicyViolationsPreview gets the specified OrgPolicyViolationsPreview. Each OrgPolicyViolationsPreview is available for at least 7 days.
SELECT
name,
createTime,
customConstraints,
overlay,
resourceCounts,
state,
violationsCount
FROM google.policysimulator.org_policy_violations_previews
WHERE organizationsId = '{{ organizationsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND orgPolicyViolationsPreviewsId = '{{ orgPolicyViolationsPreviewsId }}' -- required;
ListOrgPolicyViolationsPreviews lists each OrgPolicyViolationsPreview in an organization. Each OrgPolicyViolationsPreview is available for at least 7 days.
SELECT
name,
createTime,
customConstraints,
overlay,
resourceCounts,
state,
violationsCount
FROM google.policysimulator.org_policy_violations_previews
WHERE organizationsId = '{{ organizationsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';
INSERT
examples
- organizations_locations_org_policy_violations_previews_create
- Manifest
CreateOrgPolicyViolationsPreview creates an OrgPolicyViolationsPreview for the proposed changes in the provided OrgPolicyViolationsPreview.OrgPolicyOverlay. The changes to OrgPolicy are specified by this OrgPolicyOverlay
. The resources to scan are inferred from these specified changes.
INSERT INTO google.policysimulator.org_policy_violations_previews (
data__overlay,
organizationsId,
locationsId,
orgPolicyViolationsPreviewId
)
SELECT
'{{ overlay }}',
'{{ organizationsId }}',
'{{ locationsId }}',
'{{ orgPolicyViolationsPreviewId }}'
RETURNING
name,
done,
error,
metadata,
response
;
# Description fields are for documentation purposes
- name: org_policy_violations_previews
props:
- name: organizationsId
value: string
description: Required parameter for the org_policy_violations_previews resource.
- name: locationsId
value: string
description: Required parameter for the org_policy_violations_previews resource.
- name: overlay
value: object
description: >
Required. The proposed changes we are previewing violations for.
- name: orgPolicyViolationsPreviewId
value: string