Reference documentation and code samples for the Google Cloud Policy Simulator V1 Client class OrgPolicyViolationsPreview.
OrgPolicyViolationsPreview is a resource providing a preview of the violations that will exist if an OrgPolicy change is made.
The list of violations are modeled as child resources and retrieved via a ListOrgPolicyViolations API call. There are potentially more OrgPolicyViolations than could fit in an embedded field. Thus, the use of a child resource instead of a field.
Generated from protobuf message google.cloud.policysimulator.v1.OrgPolicyViolationsPreview
Namespace
Google \ Cloud \ PolicySimulator \ V1Methods
__construct
Constructor.
Parameters | |
---|---|
Name | Description |
data |
array
Optional. Data for populating the Message object. |
↳ name |
string
Output only. The resource name of the |
↳ state |
int
Output only. The state of the |
↳ overlay |
OrgPolicyOverlay
Required. The proposed changes we are previewing violations for. |
↳ violations_count |
int
Output only. The number of OrgPolicyViolations in this |
↳ resource_counts |
OrgPolicyViolationsPreview\ResourceCounts
Output only. A summary of the state of all resources scanned for compliance with the changed OrgPolicy. |
↳ custom_constraints |
array
Output only. The names of the constraints against which all |
↳ create_time |
Google\Protobuf\Timestamp
Output only. Time when this |
getName
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
Returns | |
---|---|
Type | Description |
string |
setName
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
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getState
Output only. The state of the OrgPolicyViolationsPreview
.
Returns | |
---|---|
Type | Description |
int |
setState
Output only. The state of the OrgPolicyViolationsPreview
.
Parameter | |
---|---|
Name | Description |
var |
int
|
Returns | |
---|---|
Type | Description |
$this |
getOverlay
Required. The proposed changes we are previewing violations for.
Returns | |
---|---|
Type | Description |
OrgPolicyOverlay|null |
hasOverlay
clearOverlay
setOverlay
Required. The proposed changes we are previewing violations for.
Parameter | |
---|---|
Name | Description |
var |
OrgPolicyOverlay
|
Returns | |
---|---|
Type | Description |
$this |
getViolationsCount
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.
Returns | |
---|---|
Type | Description |
int |
setViolationsCount
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.
Parameter | |
---|---|
Name | Description |
var |
int
|
Returns | |
---|---|
Type | Description |
$this |
getResourceCounts
Output only. A summary of the state of all resources scanned for compliance with the changed OrgPolicy.
Returns | |
---|---|
Type | Description |
OrgPolicyViolationsPreview\ResourceCounts|null |
hasResourceCounts
clearResourceCounts
setResourceCounts
Output only. A summary of the state of all resources scanned for compliance with the changed OrgPolicy.
Parameter | |
---|---|
Name | Description |
var |
OrgPolicyViolationsPreview\ResourceCounts
|
Returns | |
---|---|
Type | Description |
$this |
getCustomConstraints
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
Returns | |
---|---|
Type | Description |
Google\Protobuf\Internal\RepeatedField |
setCustomConstraints
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
Parameter | |
---|---|
Name | Description |
var |
string[]
|
Returns | |
---|---|
Type | Description |
$this |
getCreateTime
Output only. Time when this OrgPolicyViolationsPreview
was created.
Returns | |
---|---|
Type | Description |
Google\Protobuf\Timestamp|null |
hasCreateTime
clearCreateTime
setCreateTime
Output only. Time when this OrgPolicyViolationsPreview
was created.
Parameter | |
---|---|
Name | Description |
var |
Google\Protobuf\Timestamp
|
Returns | |
---|---|
Type | Description |
$this |