Reference documentation and code samples for the Cloud OS Config V1 API class Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport::OSPolicyCompliance::OSPolicyResourceCompliance.
A reason for the resource to be in the given compliance state.
This field is always populated when compliance_state is UNKNOWN.
The following values are supported when compliance_state == UNKNOWN
execution-errors: Errors were encountered by the agent while
executing the resource and the compliance state couldn't be
determined.
execution-skipped-by-agent: Resource execution was skipped by the
agent because errors were encountered while executing prior resources
in the OS policy.
os-policy-execution-attempt-failed: The execution of the OS policy
containing this resource failed and the compliance state couldn't be
determined.
#compliance_state_reason=
defcompliance_state_reason=(value)->::String
Parameter
value (::String) —
A reason for the resource to be in the given compliance state.
This field is always populated when compliance_state is UNKNOWN.
The following values are supported when compliance_state == UNKNOWN
execution-errors: Errors were encountered by the agent while
executing the resource and the compliance state couldn't be
determined.
execution-skipped-by-agent: Resource execution was skipped by the
agent because errors were encountered while executing prior resources
in the OS policy.
os-policy-execution-attempt-failed: The execution of the OS policy
containing this resource failed and the compliance state couldn't be
determined.
Returns
(::String) —
A reason for the resource to be in the given compliance state.
This field is always populated when compliance_state is UNKNOWN.
The following values are supported when compliance_state == UNKNOWN
execution-errors: Errors were encountered by the agent while
executing the resource and the compliance state couldn't be
determined.
execution-skipped-by-agent: Resource execution was skipped by the
agent because errors were encountered while executing prior resources
in the OS policy.
os-policy-execution-attempt-failed: The execution of the OS policy
containing this resource failed and the compliance state couldn't be
determined.
[[["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-09-09 UTC."],[],[],null,["# Cloud OS Config V1 API - Class Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport::OSPolicyCompliance::OSPolicyResourceCompliance (v1.4.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.4.0 (latest)](/ruby/docs/reference/google-cloud-os_config-v1/latest/Google-Cloud-OsConfig-V1-OSPolicyAssignmentReport-OSPolicyCompliance-OSPolicyResourceCompliance)\n- [1.3.0](/ruby/docs/reference/google-cloud-os_config-v1/1.3.0/Google-Cloud-OsConfig-V1-OSPolicyAssignmentReport-OSPolicyCompliance-OSPolicyResourceCompliance)\n- [1.2.1](/ruby/docs/reference/google-cloud-os_config-v1/1.2.1/Google-Cloud-OsConfig-V1-OSPolicyAssignmentReport-OSPolicyCompliance-OSPolicyResourceCompliance)\n- [1.1.0](/ruby/docs/reference/google-cloud-os_config-v1/1.1.0/Google-Cloud-OsConfig-V1-OSPolicyAssignmentReport-OSPolicyCompliance-OSPolicyResourceCompliance)\n- [1.0.1](/ruby/docs/reference/google-cloud-os_config-v1/1.0.1/Google-Cloud-OsConfig-V1-OSPolicyAssignmentReport-OSPolicyCompliance-OSPolicyResourceCompliance)\n- [0.16.0](/ruby/docs/reference/google-cloud-os_config-v1/0.16.0/Google-Cloud-OsConfig-V1-OSPolicyAssignmentReport-OSPolicyCompliance-OSPolicyResourceCompliance)\n- [0.15.2](/ruby/docs/reference/google-cloud-os_config-v1/0.15.2/Google-Cloud-OsConfig-V1-OSPolicyAssignmentReport-OSPolicyCompliance-OSPolicyResourceCompliance)\n- [0.14.0](/ruby/docs/reference/google-cloud-os_config-v1/0.14.0/Google-Cloud-OsConfig-V1-OSPolicyAssignmentReport-OSPolicyCompliance-OSPolicyResourceCompliance)\n- [0.13.0](/ruby/docs/reference/google-cloud-os_config-v1/0.13.0/Google-Cloud-OsConfig-V1-OSPolicyAssignmentReport-OSPolicyCompliance-OSPolicyResourceCompliance)\n- [0.12.0](/ruby/docs/reference/google-cloud-os_config-v1/0.12.0/Google-Cloud-OsConfig-V1-OSPolicyAssignmentReport-OSPolicyCompliance-OSPolicyResourceCompliance)\n- [0.11.0](/ruby/docs/reference/google-cloud-os_config-v1/0.11.0/Google-Cloud-OsConfig-V1-OSPolicyAssignmentReport-OSPolicyCompliance-OSPolicyResourceCompliance)\n- [0.10.0](/ruby/docs/reference/google-cloud-os_config-v1/0.10.0/Google-Cloud-OsConfig-V1-OSPolicyAssignmentReport-OSPolicyCompliance-OSPolicyResourceCompliance)\n- [0.9.1](/ruby/docs/reference/google-cloud-os_config-v1/0.9.1/Google-Cloud-OsConfig-V1-OSPolicyAssignmentReport-OSPolicyCompliance-OSPolicyResourceCompliance) \nReference documentation and code samples for the Cloud OS Config V1 API class Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport::OSPolicyCompliance::OSPolicyResourceCompliance.\n\nCompliance data for an OS policy resource. \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### #compliance_state\n\n def compliance_state() -\u003e ::Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport::OSPolicyCompliance::OSPolicyResourceCompliance::ComplianceState\n\n**Returns**\n\n- ([::Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport::OSPolicyCompliance::OSPolicyResourceCompliance::ComplianceState](./Google-Cloud-OsConfig-V1-OSPolicyAssignmentReport-OSPolicyCompliance-OSPolicyResourceCompliance-ComplianceState)) --- The compliance state of the resource.\n\n### #compliance_state=\n\n def compliance_state=(value) -\u003e ::Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport::OSPolicyCompliance::OSPolicyResourceCompliance::ComplianceState\n\n**Parameter**\n\n- **value** ([::Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport::OSPolicyCompliance::OSPolicyResourceCompliance::ComplianceState](./Google-Cloud-OsConfig-V1-OSPolicyAssignmentReport-OSPolicyCompliance-OSPolicyResourceCompliance-ComplianceState)) --- The compliance state of the resource. \n**Returns**\n\n- ([::Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport::OSPolicyCompliance::OSPolicyResourceCompliance::ComplianceState](./Google-Cloud-OsConfig-V1-OSPolicyAssignmentReport-OSPolicyCompliance-OSPolicyResourceCompliance-ComplianceState)) --- The compliance state of the resource.\n\n### #compliance_state_reason\n\n def compliance_state_reason() -\u003e ::String\n\n**Returns**\n\n- (::String) --- A reason for the resource to be in the given compliance state.\n This field is always populated when `compliance_state` is `UNKNOWN`.\n\n The following values are supported when `compliance_state == UNKNOWN`\n - `execution-errors`: Errors were encountered by the agent while executing the resource and the compliance state couldn't be determined.\n - `execution-skipped-by-agent`: Resource execution was skipped by the agent because errors were encountered while executing prior resources in the OS policy.\n - `os-policy-execution-attempt-failed`: The execution of the OS policy containing this resource failed and the compliance state couldn't be determined.\n\n### #compliance_state_reason=\n\n def compliance_state_reason=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) ---\n\n A reason for the resource to be in the given compliance state.\n This field is always populated when `compliance_state` is `UNKNOWN`.\n\n The following values are supported when `compliance_state == UNKNOWN`\n - `execution-errors`: Errors were encountered by the agent while executing the resource and the compliance state couldn't be determined.\n - `execution-skipped-by-agent`: Resource execution was skipped by the agent because errors were encountered while executing prior resources in the OS policy.\n- `os-policy-execution-attempt-failed`: The execution of the OS policy containing this resource failed and the compliance state couldn't be determined. \n**Returns**\n\n- (::String) --- A reason for the resource to be in the given compliance state.\n This field is always populated when `compliance_state` is `UNKNOWN`.\n\n The following values are supported when `compliance_state == UNKNOWN`\n - `execution-errors`: Errors were encountered by the agent while executing the resource and the compliance state couldn't be determined.\n - `execution-skipped-by-agent`: Resource execution was skipped by the agent because errors were encountered while executing prior resources in the OS policy.\n - `os-policy-execution-attempt-failed`: The execution of the OS policy containing this resource failed and the compliance state couldn't be determined.\n\n### #config_steps\n\n def config_steps() -\u003e ::Array\u003c::Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport::OSPolicyCompliance::OSPolicyResourceCompliance::OSPolicyResourceConfigStep\u003e\n\n**Returns**\n\n- (::Array\\\u003c[::Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport::OSPolicyCompliance::OSPolicyResourceCompliance::OSPolicyResourceConfigStep](./Google-Cloud-OsConfig-V1-OSPolicyAssignmentReport-OSPolicyCompliance-OSPolicyResourceCompliance-OSPolicyResourceConfigStep)\\\u003e) --- Ordered list of configuration completed by the agent for the OS policy resource.\n\n### #config_steps=\n\n def config_steps=(value) -\u003e ::Array\u003c::Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport::OSPolicyCompliance::OSPolicyResourceCompliance::OSPolicyResourceConfigStep\u003e\n\n**Parameter**\n\n- **value** (::Array\\\u003c[::Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport::OSPolicyCompliance::OSPolicyResourceCompliance::OSPolicyResourceConfigStep](./Google-Cloud-OsConfig-V1-OSPolicyAssignmentReport-OSPolicyCompliance-OSPolicyResourceCompliance-OSPolicyResourceConfigStep)\\\u003e) --- Ordered list of configuration completed by the agent for the OS policy resource. \n**Returns**\n\n- (::Array\\\u003c[::Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport::OSPolicyCompliance::OSPolicyResourceCompliance::OSPolicyResourceConfigStep](./Google-Cloud-OsConfig-V1-OSPolicyAssignmentReport-OSPolicyCompliance-OSPolicyResourceCompliance-OSPolicyResourceConfigStep)\\\u003e) --- Ordered list of configuration completed by the agent for the OS policy resource.\n\n### #exec_resource_output\n\n def exec_resource_output() -\u003e ::Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport::OSPolicyCompliance::OSPolicyResourceCompliance::ExecResourceOutput\n\n**Returns**\n\n- ([::Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport::OSPolicyCompliance::OSPolicyResourceCompliance::ExecResourceOutput](./Google-Cloud-OsConfig-V1-OSPolicyAssignmentReport-OSPolicyCompliance-OSPolicyResourceCompliance-ExecResourceOutput)) --- ExecResource specific output.\n\n### #exec_resource_output=\n\n def exec_resource_output=(value) -\u003e ::Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport::OSPolicyCompliance::OSPolicyResourceCompliance::ExecResourceOutput\n\n**Parameter**\n\n- **value** ([::Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport::OSPolicyCompliance::OSPolicyResourceCompliance::ExecResourceOutput](./Google-Cloud-OsConfig-V1-OSPolicyAssignmentReport-OSPolicyCompliance-OSPolicyResourceCompliance-ExecResourceOutput)) --- ExecResource specific output. \n**Returns**\n\n- ([::Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport::OSPolicyCompliance::OSPolicyResourceCompliance::ExecResourceOutput](./Google-Cloud-OsConfig-V1-OSPolicyAssignmentReport-OSPolicyCompliance-OSPolicyResourceCompliance-ExecResourceOutput)) --- ExecResource specific output.\n\n### #os_policy_resource_id\n\n def os_policy_resource_id() -\u003e ::String\n\n**Returns**\n\n- (::String) --- The ID of the OS policy resource.\n\n### #os_policy_resource_id=\n\n def os_policy_resource_id=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- The ID of the OS policy resource. \n**Returns**\n\n- (::String) --- The ID of the OS policy resource."]]