This API resource represents the OS policies compliance data for a
Compute Engine virtual machine (VM) instance at a given point in
time.
A Compute Engine VM can have multiple OS policy assignments, and
each assignment can have multiple OS policies. As a result, multiple
OS policies could be applied to a single VM.
You can use this API resource to determine both the compliance state
of your VM as well as the compliance state of an individual OS
policy.
For more information, see View
compliance <https://cloud.google.com/compute/docs/os-configuration-management/view-compliance>__.
Attributes
Name
Description
name
str
Output only. The InstanceOSPoliciesCompliance API
resource name.
Format:
projects/{project_number}/locations/{location}/instanceOSPoliciesCompliances/{instance_id}
instance
str
Output only. The Compute Engine VM instance
name.
str
Output only. Detailed compliance state of the VM. This field
is populated only when compliance state is UNKNOWN.
It may contain one of the following values:
- no-compliance-data: Compliance data is not available
for this VM.
- no-agent-detected: OS Config agent is not detected
for this VM.
- config-not-supported-by-agent: The version of the OS
Config agent running on this VM does not support
configuration management.
- inactive: VM is not running.
- internal-service-errors: There were internal service
errors encountered while enforcing compliance.
- agent-errors: OS config agent encountered errors
while enforcing compliance.
detailed_state_reason
str
Output only. The reason for the detailed_state of the VM
(if any).
google.protobuf.timestamp_pb2.Timestamp
Output only. Timestamp of the last compliance
check for the VM.
last_compliance_run_id
str
Output only. Unique identifier for the last
compliance run. This id will be logged by the OS
config agent during a compliance run and can be
used for debugging and tracing purpose.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-11 UTC."],[],[],null,["# Class InstanceOSPoliciesCompliance (1.21.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.21.0 (latest)](/python/docs/reference/osconfig/latest/google.cloud.osconfig_v1alpha.types.InstanceOSPoliciesCompliance)\n- [1.20.2](/python/docs/reference/osconfig/1.20.2/google.cloud.osconfig_v1alpha.types.InstanceOSPoliciesCompliance)\n- [1.19.0](/python/docs/reference/osconfig/1.19.0/google.cloud.osconfig_v1alpha.types.InstanceOSPoliciesCompliance)\n- [1.18.1](/python/docs/reference/osconfig/1.18.1/google.cloud.osconfig_v1alpha.types.InstanceOSPoliciesCompliance)\n- [1.17.5](/python/docs/reference/osconfig/1.17.5/google.cloud.osconfig_v1alpha.types.InstanceOSPoliciesCompliance)\n- [1.16.0](/python/docs/reference/osconfig/1.16.0/google.cloud.osconfig_v1alpha.types.InstanceOSPoliciesCompliance)\n- [1.15.3](/python/docs/reference/osconfig/1.15.3/google.cloud.osconfig_v1alpha.types.InstanceOSPoliciesCompliance)\n- [1.14.1](/python/docs/reference/osconfig/1.14.1/google.cloud.osconfig_v1alpha.types.InstanceOSPoliciesCompliance)\n- [1.13.0](/python/docs/reference/osconfig/1.13.0/google.cloud.osconfig_v1alpha.types.InstanceOSPoliciesCompliance)\n- [1.12.4](/python/docs/reference/osconfig/1.12.4/google.cloud.osconfig_v1alpha.types.InstanceOSPoliciesCompliance)\n- [1.11.2](/python/docs/reference/osconfig/1.11.2/google.cloud.osconfig_v1alpha.types.InstanceOSPoliciesCompliance)\n- [1.10.0](/python/docs/reference/osconfig/1.10.0/google.cloud.osconfig_v1alpha.types.InstanceOSPoliciesCompliance)\n- [1.9.0](/python/docs/reference/osconfig/1.9.0/google.cloud.osconfig_v1alpha.types.InstanceOSPoliciesCompliance)\n- [1.8.0](/python/docs/reference/osconfig/1.8.0/google.cloud.osconfig_v1alpha.types.InstanceOSPoliciesCompliance)\n- [1.7.1](/python/docs/reference/osconfig/1.7.1/google.cloud.osconfig_v1alpha.types.InstanceOSPoliciesCompliance)\n- [1.6.0](/python/docs/reference/osconfig/1.6.0/google.cloud.osconfig_v1alpha.types.InstanceOSPoliciesCompliance)\n- [1.5.2](/python/docs/reference/osconfig/1.5.2/google.cloud.osconfig_v1alpha.types.InstanceOSPoliciesCompliance)\n- [1.4.0](/python/docs/reference/osconfig/1.4.0/google.cloud.osconfig_v1alpha.types.InstanceOSPoliciesCompliance)\n- [1.3.2](/python/docs/reference/osconfig/1.3.2/google.cloud.osconfig_v1alpha.types.InstanceOSPoliciesCompliance)\n- [1.2.0](/python/docs/reference/osconfig/1.2.0/google.cloud.osconfig_v1alpha.types.InstanceOSPoliciesCompliance)\n- [1.1.0](/python/docs/reference/osconfig/1.1.0/google.cloud.osconfig_v1alpha.types.InstanceOSPoliciesCompliance)\n- [1.0.0](/python/docs/reference/osconfig/1.0.0/google.cloud.osconfig_v1alpha.types.InstanceOSPoliciesCompliance)\n- [0.1.2](/python/docs/reference/osconfig/0.1.2/google.cloud.osconfig_v1alpha.types.InstanceOSPoliciesCompliance) \n\n InstanceOSPoliciesCompliance(\n mapping=None, *, ignore_unknown_fields=False, **kwargs\n )\n\nThis API resource represents the OS policies compliance data for a\nCompute Engine virtual machine (VM) instance at a given point in\ntime.\n\nA Compute Engine VM can have multiple OS policy assignments, and\neach assignment can have multiple OS policies. As a result, multiple\nOS policies could be applied to a single VM.\n\nYou can use this API resource to determine both the compliance state\nof your VM as well as the compliance state of an individual OS\npolicy.\n\nFor more information, see `View\ncompliance \u003chttps://cloud.google.com/compute/docs/os-configuration-management/view-compliance\u003e`__.\n\nClasses\n-------\n\n### OSPolicyCompliance\n\n OSPolicyCompliance(mapping=None, *, ignore_unknown_fields=False, **kwargs)\n\nCompliance data for an OS policy"]]