# Google Cloud OS Config v1alpha API - Class InstanceOSPoliciesCompliance (2.0.0-alpha07)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.0.0-alpha07 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.InstanceOSPoliciesCompliance)
- [2.0.0-alpha06](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/2.0.0-alpha06/Google.Cloud.OsConfig.V1Alpha.InstanceOSPoliciesCompliance)
- [1.0.0-alpha04](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/1.0.0-alpha04/Google.Cloud.OsConfig.V1Alpha.InstanceOSPoliciesCompliance)

    [Obsolete]
    public sealed class InstanceOSPoliciesCompliance : IMessage<InstanceOSPoliciesCompliance>, IEquatable<InstanceOSPoliciesCompliance>, IDeepCloneable<InstanceOSPoliciesCompliance>, IBufferMessage, IMessage

Reference documentation and code samples for the Google Cloud OS Config v1alpha API class 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](https://cloud.google.com/compute/docs/os-configuration-management/view-compliance).

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> InstanceOSPoliciesCompliance

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[InstanceOSPoliciesCompliance](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.InstanceOSPoliciesCompliance), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[InstanceOSPoliciesCompliance](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.InstanceOSPoliciesCompliance), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[InstanceOSPoliciesCompliance](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.InstanceOSPoliciesCompliance), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html)

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.OsConfig.V1Alpha](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha)

## Assembly

Google.Cloud.OsConfig.V1Alpha.dll

## Constructors

### InstanceOSPoliciesCompliance()

    public InstanceOSPoliciesCompliance()

### InstanceOSPoliciesCompliance(InstanceOSPoliciesCompliance)

    public InstanceOSPoliciesCompliance(InstanceOSPoliciesCompliance other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.InstanceOSPoliciesCompliance` |

## Properties

### DetailedState

    public string DetailedState { get; set; }

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.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### DetailedStateReason

    public string DetailedStateReason { get; set; }

Output only. The reason for the `detailed_state` of the VM (if any).

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### Instance

    public string Instance { get; set; }

Output only. The Compute Engine VM instance name.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### InstanceOSPoliciesComplianceName

    [Obsolete]
    public InstanceOSPoliciesComplianceName InstanceOSPoliciesComplianceName { get; set; }

[InstanceOSPoliciesComplianceName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.InstanceOSPoliciesComplianceName)-typed view over the [Name](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.InstanceOSPoliciesCompliance#Google_Cloud_OsConfig_V1Alpha_InstanceOSPoliciesCompliance_Name) resource name
property.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.InstanceOSPoliciesComplianceName` |   |

### LastComplianceCheckTime

    public Timestamp LastComplianceCheckTime { get; set; }

Output only. Timestamp of the last compliance check for the VM.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WellKnownTypes.Timestamp.html` |   |

### LastComplianceRunId

    public string LastComplianceRunId { get; set; }

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.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### Name

    public string Name { get; set; }

Output only. The `InstanceOSPoliciesCompliance` API resource name.

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

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### OsPolicyCompliances

    [Obsolete]
    public RepeatedField<InstanceOSPoliciesCompliance.Types.OSPolicyCompliance> OsPolicyCompliances { get; }

Output only. Compliance data for each `OSPolicy` that is applied to the VM.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.InstanceOSPoliciesCompliancehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.InstanceOSPoliciesCompliance.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.InstanceOSPoliciesCompliance.Types.OSPolicyCompliance` |   |

### State

    public OSPolicyComplianceState State { get; set; }

Output only. Compliance state of the VM.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicyComplianceState` |   |