Reference documentation and code samples for the Cloud OS Config V1alpha API class Google::Cloud::OsConfig::V1alpha::InstanceOSPoliciesCompliance::OSPolicyCompliance.
Compliance data for an OS policy
Inherits
Object
Extended By
Google::Protobuf::MessageExts::ClassMethods
Includes
Google::Protobuf::MessageExts
Methods
#os_policy_assignment
defos_policy_assignment()->::String
Returns
(::String) — Reference to the OSPolicyAssignment API resource that the OSPolicy
belongs to.
[[["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-28 UTC."],[],[],null,["# Cloud OS Config V1alpha API - Class Google::Cloud::OsConfig::V1alpha::InstanceOSPoliciesCompliance::OSPolicyCompliance (v0.12.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.12.0 (latest)](/ruby/docs/reference/google-cloud-os_config-v1alpha/latest/Google-Cloud-OsConfig-V1alpha-InstanceOSPoliciesCompliance-OSPolicyCompliance)\n- [0.11.1](/ruby/docs/reference/google-cloud-os_config-v1alpha/0.11.1/Google-Cloud-OsConfig-V1alpha-InstanceOSPoliciesCompliance-OSPolicyCompliance)\n- [0.10.0](/ruby/docs/reference/google-cloud-os_config-v1alpha/0.10.0/Google-Cloud-OsConfig-V1alpha-InstanceOSPoliciesCompliance-OSPolicyCompliance)\n- [0.9.1](/ruby/docs/reference/google-cloud-os_config-v1alpha/0.9.1/Google-Cloud-OsConfig-V1alpha-InstanceOSPoliciesCompliance-OSPolicyCompliance)\n- [0.8.2](/ruby/docs/reference/google-cloud-os_config-v1alpha/0.8.2/Google-Cloud-OsConfig-V1alpha-InstanceOSPoliciesCompliance-OSPolicyCompliance)\n- [0.7.0](/ruby/docs/reference/google-cloud-os_config-v1alpha/0.7.0/Google-Cloud-OsConfig-V1alpha-InstanceOSPoliciesCompliance-OSPolicyCompliance)\n- [0.6.0](/ruby/docs/reference/google-cloud-os_config-v1alpha/0.6.0/Google-Cloud-OsConfig-V1alpha-InstanceOSPoliciesCompliance-OSPolicyCompliance)\n- [0.5.0](/ruby/docs/reference/google-cloud-os_config-v1alpha/0.5.0/Google-Cloud-OsConfig-V1alpha-InstanceOSPoliciesCompliance-OSPolicyCompliance)\n- [0.4.0](/ruby/docs/reference/google-cloud-os_config-v1alpha/0.4.0/Google-Cloud-OsConfig-V1alpha-InstanceOSPoliciesCompliance-OSPolicyCompliance)\n- [0.3.0](/ruby/docs/reference/google-cloud-os_config-v1alpha/0.3.0/Google-Cloud-OsConfig-V1alpha-InstanceOSPoliciesCompliance-OSPolicyCompliance)\n- [0.2.2](/ruby/docs/reference/google-cloud-os_config-v1alpha/0.2.2/Google-Cloud-OsConfig-V1alpha-InstanceOSPoliciesCompliance-OSPolicyCompliance) \nReference documentation and code samples for the Cloud OS Config V1alpha API class Google::Cloud::OsConfig::V1alpha::InstanceOSPoliciesCompliance::OSPolicyCompliance.\n\nCompliance data for an OS policy \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #os_policy_assignment\n\n def os_policy_assignment() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Reference to the `OSPolicyAssignment` API resource that the `OSPolicy` belongs to.\n\n\n Format:\n `projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id@revision_id}`\n\n### #os_policy_assignment=\n\n def os_policy_assignment=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Reference to the `OSPolicyAssignment` API resource that the `OSPolicy` belongs to.\n\n\n Format:\n`projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id@revision_id}` \n**Returns**\n\n- (::String) --- Reference to the `OSPolicyAssignment` API resource that the `OSPolicy` belongs to.\n\n\n Format:\n `projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id@revision_id}`\n\n### #os_policy_id\n\n def os_policy_id() -\u003e ::String\n\n**Returns**\n\n- (::String) --- The OS policy id\n\n### #os_policy_id=\n\n def os_policy_id=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- The OS policy id \n**Returns**\n\n- (::String) --- The OS policy id\n\n### #os_policy_resource_compliances\n\n def os_policy_resource_compliances() -\u003e ::Array\u003c::Google::Cloud::OsConfig::V1alpha::OSPolicyResourceCompliance\u003e\n\n**Returns**\n\n- (::Array\\\u003c[::Google::Cloud::OsConfig::V1alpha::OSPolicyResourceCompliance](./Google-Cloud-OsConfig-V1alpha-OSPolicyResourceCompliance)\\\u003e) --- Compliance data for each `OSPolicyResource` that is applied to the VM.\n\n### #os_policy_resource_compliances=\n\n def os_policy_resource_compliances=(value) -\u003e ::Array\u003c::Google::Cloud::OsConfig::V1alpha::OSPolicyResourceCompliance\u003e\n\n**Parameter**\n\n- **value** (::Array\\\u003c[::Google::Cloud::OsConfig::V1alpha::OSPolicyResourceCompliance](./Google-Cloud-OsConfig-V1alpha-OSPolicyResourceCompliance)\\\u003e) --- Compliance data for each `OSPolicyResource` that is applied to the VM. \n**Returns**\n\n- (::Array\\\u003c[::Google::Cloud::OsConfig::V1alpha::OSPolicyResourceCompliance](./Google-Cloud-OsConfig-V1alpha-OSPolicyResourceCompliance)\\\u003e) --- Compliance data for each `OSPolicyResource` that is applied to the VM.\n\n### #state\n\n def state() -\u003e ::Google::Cloud::OsConfig::V1alpha::OSPolicyComplianceState\n\n**Returns**\n\n- ([::Google::Cloud::OsConfig::V1alpha::OSPolicyComplianceState](./Google-Cloud-OsConfig-V1alpha-OSPolicyComplianceState)) --- Compliance state of the OS policy.\n\n### #state=\n\n def state=(value) -\u003e ::Google::Cloud::OsConfig::V1alpha::OSPolicyComplianceState\n\n**Parameter**\n\n- **value** ([::Google::Cloud::OsConfig::V1alpha::OSPolicyComplianceState](./Google-Cloud-OsConfig-V1alpha-OSPolicyComplianceState)) --- Compliance state of the OS policy. \n**Returns**\n\n- ([::Google::Cloud::OsConfig::V1alpha::OSPolicyComplianceState](./Google-Cloud-OsConfig-V1alpha-OSPolicyComplianceState)) --- Compliance state of the OS policy."]]