Skip to main content

violations

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

Overview​

Nameviolations
TypeResource
Idgoogle.cloudcontrolspartner.violations

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringIdentifier. Format: organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}
beginTimestring (google-datetime)Output 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.
descriptionstringOutput only. Description for the Violation. e.g. OrgPolicy gcp.resourceLocations has non compliant value.
folderIdstring (int64)The 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}
remediationobjectOutput only. Compliance violation remediation (id: Remediation)
resolveTimestring (google-datetime)Output only. Time of the event which fixed the Violation. If the violation is ACTIVE this will be empty.
statestringOutput only. State of the violation (STATE_UNSPECIFIED, RESOLVED, UNRESOLVED, EXCEPTION)
updateTimestring (google-datetime)Output only. The last time when the Violation record was updated.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectorganizationsId, locationsId, customersId, workloadsId, violationsIdGets details of a single Violation.
listselectorganizationsId, locationsId, customersId, workloadsIdfilter, interval.endTime, interval.startTime, orderBy, pageSize, pageTokenLists 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}

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
customersIdstring
locationsIdstring
organizationsIdstring
violationsIdstring
workloadsIdstring
filterstring
interval.endTimestring (google-datetime)
interval.startTimestring (google-datetime)
orderBystring
pageSizeinteger (int32)
pageTokenstring

SELECT examples​

Gets details of a single Violation.

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