REST Resource: projects.locations.instanceOSPoliciesCompliances

Resource: InstanceOSPoliciesCompliance

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.

JSON representation
{
  "name": string,
  "instance": string,
  "state": enum (OSPolicyComplianceState),
  "detailedState": string,
  "detailedStateReason": string,
  "osPolicyCompliances": [
    {
      object (OSPolicyCompliance)
    }
  ],
  "lastComplianceCheckTime": string,
  "lastComplianceRunId": string
}
Fields
name

string

Output only. The InstanceOSPoliciesCompliance API resource name.

Format: projects/{project_number}/locations/{location}/instanceOSPoliciesCompliances/{instance_id}

instance

string

Output only. The Compute Engine VM instance name.

state

enum (OSPolicyComplianceState)

Output only. Compliance state of the VM.

detailedState

string

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.