Google Cloud OsConfig V1 Client - Class OSPolicyCompliance (1.2.2)

Reference documentation and code samples for the Google Cloud OsConfig V1 Client class OSPolicyCompliance.

Compliance data for an OS policy

Generated from protobuf message google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance

Namespace

Google \ Cloud \ OsConfig \ V1 \ OSPolicyAssignmentReport

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ os_policy_id string

The OS policy id

↳ compliance_state int

The compliance state of the OS policy.

↳ compliance_state_reason string

The reason for the OS policy to be in an unknown compliance state. This field is always populated when compliance_state is UNKNOWN. If populated, the field can contain one of the following values: * vm-not-running: The VM was not running. * os-policies-not-supported-by-agent: The version of the OS Config agent running on the VM does not support running OS policies. * no-agent-detected: The OS Config agent is not detected for the VM. * resource-execution-errors: The OS Config agent encountered errors while executing one or more resources in the policy. See os_policy_resource_compliances for details. * task-timeout: The task sent to the agent to apply the policy timed out. * unexpected-agent-state: The OS Config agent did not report the final status of the task that attempted to apply the policy. Instead, the agent unexpectedly started working on a different task. This mostly happens when the agent or VM unexpectedly restarts while applying OS policies. * internal-service-errors: Internal service errors were encountered while attempting to apply the policy.

↳ os_policy_resource_compliances array<Google\Cloud\OsConfig\V1\OSPolicyAssignmentReport\OSPolicyCompliance\OSPolicyResourceCompliance>

Compliance data for each resource within the policy that is applied to the VM.

getOsPolicyId

The OS policy id

Returns
TypeDescription
string

setOsPolicyId

The OS policy id

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getComplianceState

The compliance state of the OS policy.

Returns
TypeDescription
int

setComplianceState

The compliance state of the OS policy.

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getComplianceStateReason

The reason for the OS policy to be in an unknown compliance state.

This field is always populated when compliance_state is UNKNOWN. If populated, the field can contain one of the following values:

  • vm-not-running: The VM was not running.
  • os-policies-not-supported-by-agent: The version of the OS Config agent running on the VM does not support running OS policies.
  • no-agent-detected: The OS Config agent is not detected for the VM.
  • resource-execution-errors: The OS Config agent encountered errors while executing one or more resources in the policy. See os_policy_resource_compliances for details.
  • task-timeout: The task sent to the agent to apply the policy timed out.
  • unexpected-agent-state: The OS Config agent did not report the final status of the task that attempted to apply the policy. Instead, the agent unexpectedly started working on a different task. This mostly happens when the agent or VM unexpectedly restarts while applying OS policies.
  • internal-service-errors: Internal service errors were encountered while attempting to apply the policy.
Returns
TypeDescription
string

setComplianceStateReason

The reason for the OS policy to be in an unknown compliance state.

This field is always populated when compliance_state is UNKNOWN. If populated, the field can contain one of the following values:

  • vm-not-running: The VM was not running.
  • os-policies-not-supported-by-agent: The version of the OS Config agent running on the VM does not support running OS policies.
  • no-agent-detected: The OS Config agent is not detected for the VM.
  • resource-execution-errors: The OS Config agent encountered errors while executing one or more resources in the policy. See os_policy_resource_compliances for details.
  • task-timeout: The task sent to the agent to apply the policy timed out.
  • unexpected-agent-state: The OS Config agent did not report the final status of the task that attempted to apply the policy. Instead, the agent unexpectedly started working on a different task. This mostly happens when the agent or VM unexpectedly restarts while applying OS policies.
  • internal-service-errors: Internal service errors were encountered while attempting to apply the policy.
Parameter
NameDescription
var string
Returns
TypeDescription
$this

getOsPolicyResourceCompliances

Compliance data for each resource within the policy that is applied to the VM.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setOsPolicyResourceCompliances

Compliance data for each resource within the policy that is applied to the VM.

Parameter
NameDescription
var array<Google\Cloud\OsConfig\V1\OSPolicyAssignmentReport\OSPolicyCompliance\OSPolicyResourceCompliance>
Returns
TypeDescription
$this