Skip to main content

violations

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

Overview

Nameviolations
TypeResource
Idgoogle.cloudcontrolspartner.violations

Fields

NameDatatypeDescription
namestringIdentifier. Format: organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}
descriptionstringOutput only. Description for the Violation. e.g. OrgPolicy gcp.resourceLocations has non compliant value.
beginTimestringOutput only. Time of the event which triggered the Violation.
categorystringOutput only. Category under which this violation is mapped. e.g. Location, Service Usage, Access, Encryption, etc.
folderIdstringThe folder_id of the violation
nonCompliantOrgPolicystringOutput only. Immutable. Name of the OrgPolicy which was modified with non-compliant change and resulted this violation. Format: projects/{project_number}/policies/{constraint_name} folders/{folder_id}/policies/{constraint_name} organizations/{organization_id}/policies/{constraint_name}
remediationobjectRepresents remediation guidance to resolve compliance violation for AssuredWorkload
resolveTimestringOutput only. Time of the event which fixed the Violation. If the violation is ACTIVE this will be empty.
statestringOutput only. State of the violation
updateTimestringOutput only. The last time when the Violation record was updated.

Methods

NameAccessible byRequired ParamsDescription
getSELECTcustomersId, locationsId, organizationsId, violationsId, workloadsIdGets details of a single Violation.
listSELECTcustomersId, locationsId, organizationsId, workloadsIdLists Violations for a workload Callers may also choose to read across multiple Customers or for a single customer as per AIP-159 by using '-' (the hyphen or dash character) as a wildcard character instead of {customer} & {workload}. Format: organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}

SELECT examples

Lists Violations for a workload Callers may also choose to read across multiple Customers or for a single customer as per AIP-159 by using '-' (the hyphen or dash character) as a wildcard character instead of {customer} & {workload}. Format: organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}

SELECT
name,
description,
beginTime,
category,
folderId,
nonCompliantOrgPolicy,
remediation,
resolveTime,
state,
updateTime
FROM google.cloudcontrolspartner.violations
WHERE customersId = '{{ customersId }}'
AND locationsId = '{{ locationsId }}'
AND organizationsId = '{{ organizationsId }}'
AND workloadsId = '{{ workloadsId }}';