- Resource: OrgPolicyViolationsPreview
- PreviewState
- OrgPolicyOverlay
- PolicyOverlay
- Policy
- PolicySpec
- PolicyRule
- StringValues
- AlternatePolicySpec
- CustomConstraintOverlay
- ResourceCounts
- Methods
Resource: 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.
JSON representation |
---|
{ "name": string, "state": enum ( |
Fields | |
---|---|
name |
Output only. The resource name of the
Example: |
state |
Output only. The state of the |
overlay |
Required. The proposed changes we are previewing violations for. |
violationsCount |
Output only. The number of [OrgPolicyViolations][] in this |
resourceCounts |
Output only. A summary of the state of all resources scanned for compliance with the changed OrgPolicy. |
customConstraints[] |
Output only. The names of the constraints against which all If Format: Example: |
createTime |
Output only. Time when this A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
PreviewState
The current state of an OrgPolicyViolationsPreview
.
Enums | |
---|---|
PREVIEW_STATE_UNSPECIFIED |
The state is unspecified. |
PREVIEW_PENDING |
The OrgPolicyViolationsPreview has not been created yet. |
PREVIEW_RUNNING |
The OrgPolicyViolationsPreview is currently being created. |
PREVIEW_SUCCEEDED |
The OrgPolicyViolationsPreview creation finished successfully. |
PREVIEW_FAILED |
The OrgPolicyViolationsPreview creation failed with an error. |
OrgPolicyOverlay
The proposed changes to OrgPolicy.
JSON representation |
---|
{ "policies": [ { object ( |
Fields | |
---|---|
policies[] |
Optional. The OrgPolicy changes to preview violations for. Any existing OrgPolicies with the same name will be overridden in the simulation. That is, violations will be determined as if all policies in the overlay were created or updated. |
customConstraints[] |
Optional. The OrgPolicy CustomConstraint changes to preview violations for. Any existing CustomConstraints with the same name will be overridden in the simulation. That is, violations will be determined as if all custom constraints in the overlay were instantiated. Only a single customConstraint is supported in the overlay at a time. For evaluating multiple constraints, multiple |
PolicyOverlay
A change to an OrgPolicy.
JSON representation |
---|
{
"policyParent": string,
"policy": {
object ( |
Fields | |
---|---|
policyParent |
Optional. The parent of the policy we are attaching to. Example: "projects/123456" |
policy |
Optional. The new or updated OrgPolicy. |
Policy
Defines an organization policy which is used to specify constraints for configurations of Google Cloud resources.
JSON representation |
---|
{ "name": string, "spec": { object ( |
Fields | |
---|---|
name |
Immutable. The resource name of the policy. Must be one of the following forms, where
For example, Note: |
spec |
Basic information about the Organization Policy. |
alternate |
Deprecated. |
dryRunSpec |
Dry-run policy. Audit-only policy, can be used to monitor how the policy would have impacted the existing and future resources if it's enforced. |
etag |
Optional. An opaque tag indicating the current state of the policy, used for concurrency control. This 'etag' is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding. |
PolicySpec
Defines a Google Cloud policy specification which is used to specify constraints for configurations of Google Cloud resources.
JSON representation |
---|
{
"etag": string,
"updateTime": string,
"rules": [
{
object ( |
Fields | |
---|---|
etag |
An opaque tag indicating the current version of the policySpec, used for concurrency control. This field is ignored if used in a When the policy is returned from either a When the policy is returned from a |
updateTime |
Output only. The time stamp this was previously updated. This represents the last time a call to A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
rules[] |
In policies for boolean constraints, the following requirements apply:
|
inheritFromParent |
Determines the inheritance behavior for this policy. If |
reset |
Ignores policies set above this resource and restores the |
PolicyRule
A rule used to express this policy.
JSON representation |
---|
{ "condition": { object ( |
Fields | |
---|---|
condition |
A condition which determines whether this rule is used in the evaluation of the policy. When set, the |
Union field
|
|
values |
List of values to be used for this policy rule. This field can be set only in policies for list constraints. |
allowAll |
Setting this to true means that all values are allowed. This field can be set only in policies for list constraints. |
denyAll |
Setting this to true means that all values are denied. This field can be set only in policies for list constraints. |
enforce |
If |
StringValues
A message that holds specific allowed and denied values. This message can define specific values and subtrees of the Resource Manager resource hierarchy (Organizations
, Folders
, Projects
) that are allowed or denied. This is achieved by using the under:
and optional is:
prefixes. The under:
prefix is used to denote resource subtree values. The is:
prefix is used to denote specific values, and is required only if the value contains a ":". Values prefixed with "is:" are treated the same as values with no prefix. Ancestry subtrees must be in one of the following formats:
projects/<project-id>
(for example,projects/tokyo-rain-123
)folders/<folder-id>
(for example,folders/1234
)organizations/<organization-id>
(for example,organizations/1234
)
The supportsUnder
field of the associated Constraint
defines whether ancestry prefixes can be used.
JSON representation |
---|
{ "allowedValues": [ string ], "deniedValues": [ string ] } |
Fields | |
---|---|
allowedValues[] |
List of values allowed at this resource. |
deniedValues[] |
List of values denied at this resource. |
AlternatePolicySpec
Similar to PolicySpec but with an extra 'launch' field for launch reference. The PolicySpec here is specific for dry-run/darklaunch.
JSON representation |
---|
{
"launch": string,
"spec": {
object ( |
Fields | |
---|---|
launch |
Reference to the launch that will be used while audit logging and to control the launch. Should be set only in the alternate policy. |
spec |
Specify constraint for configurations of Google Cloud resources. |
CustomConstraintOverlay
A change to an OrgPolicy custom constraint.
JSON representation |
---|
{
"customConstraintParent": string,
"customConstraint": {
object ( |
Fields | |
---|---|
customConstraintParent |
Optional. Resource the constraint is attached to. Example: "organization/987654" |
customConstraint |
Optional. The new or updated custom constraint. |
ResourceCounts
A summary of the state of all resources scanned for compliance with the changed OrgPolicy.
JSON representation |
---|
{ "scanned": integer, "noncompliant": integer, "compliant": integer, "unenforced": integer, "errors": integer } |
Fields | |
---|---|
scanned |
Output only. Number of resources checked for compliance. Must equal: unenforced + noncompliant + compliant + error |
noncompliant |
Output only. Number of scanned resources with at least one violation. |
compliant |
Output only. Number of scanned resources with zero violations. |
unenforced |
Output only. Number of resources where the constraint was not enforced, i.e. the Policy set |
errors |
Output only. Number of resources that returned an error when scanned. |
Methods |
|
---|---|
|
CreateOrgPolicyViolationsPreview creates an OrgPolicyViolationsPreview for the proposed changes in the provided [OrgPolicyViolationsPreview.OrgPolicyOverlay][]. |
|
GenerateOrgPolicyViolationsPreview generates an OrgPolicyViolationsPreview for the proposed changes in the provided [OrgPolicyViolationsPreview.OrgPolicyOverlay][]. |
|
GetOrgPolicyViolationsPreview gets the specified OrgPolicyViolationsPreview . |
|
ListOrgPolicyViolationsPreviews lists each OrgPolicyViolationsPreview in an organization. |