Google Cloud OsConfig V1 Client - Class OSPolicy (2.0.2)

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

An OS policy defines the desired state configuration for a VM.

Generated from protobuf message google.cloud.osconfig.v1.OSPolicy

Namespace

Google \ Cloud \ OsConfig \ V1

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ id string

Required. The id of the OS policy with the following restrictions: * * Must contain only lowercase letters, numbers, and hyphens. * * Must start with a letter. * * Must be between 1-63 characters. * * Must end with a number or a letter. * * Must be unique within the assignment.

↳ description string

Policy description. Length of the description is limited to 1024 characters.

↳ mode int

Required. Policy mode

↳ resource_groups array<OSPolicy\ResourceGroup>

Required. List of resource groups for the policy. For a particular VM, resource groups are evaluated in the order specified and the first resource group that is applicable is selected and the rest are ignored. If none of the resource groups are applicable for a VM, the VM is considered to be non-compliant w.r.t this policy. This behavior can be toggled by the flag allow_no_resource_group_match

↳ allow_no_resource_group_match bool

This flag determines the OS policy compliance status when none of the resource groups within the policy are applicable for a VM. Set this value to true if the policy needs to be reported as compliant even if the policy has nothing to validate or enforce.

getId

Required. The id of the OS policy with the following restrictions:

  • Must contain only lowercase letters, numbers, and hyphens.

  • Must start with a letter.

  • Must be between 1-63 characters.
  • Must end with a number or a letter.
  • Must be unique within the assignment.
Returns
Type Description
string

setId

Required. The id of the OS policy with the following restrictions:

  • Must contain only lowercase letters, numbers, and hyphens.

  • Must start with a letter.

  • Must be between 1-63 characters.
  • Must end with a number or a letter.
  • Must be unique within the assignment.
Parameter
Name Description
var string
Returns
Type Description
$this

getDescription

Policy description.

Length of the description is limited to 1024 characters.

Returns
Type Description
string

setDescription

Policy description.

Length of the description is limited to 1024 characters.

Parameter
Name Description
var string
Returns
Type Description
$this

getMode

Required. Policy mode

Returns
Type Description
int

setMode

Required. Policy mode

Parameter
Name Description
var int
Returns
Type Description
$this

getResourceGroups

Required. List of resource groups for the policy.

For a particular VM, resource groups are evaluated in the order specified and the first resource group that is applicable is selected and the rest are ignored. If none of the resource groups are applicable for a VM, the VM is considered to be non-compliant w.r.t this policy. This behavior can be toggled by the flag allow_no_resource_group_match

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setResourceGroups

Required. List of resource groups for the policy.

For a particular VM, resource groups are evaluated in the order specified and the first resource group that is applicable is selected and the rest are ignored. If none of the resource groups are applicable for a VM, the VM is considered to be non-compliant w.r.t this policy. This behavior can be toggled by the flag allow_no_resource_group_match

Parameter
Name Description
var array<OSPolicy\ResourceGroup>
Returns
Type Description
$this

getAllowNoResourceGroupMatch

This flag determines the OS policy compliance status when none of the resource groups within the policy are applicable for a VM. Set this value to true if the policy needs to be reported as compliant even if the policy has nothing to validate or enforce.

Returns
Type Description
bool

setAllowNoResourceGroupMatch

This flag determines the OS policy compliance status when none of the resource groups within the policy are applicable for a VM. Set this value to true if the policy needs to be reported as compliant even if the policy has nothing to validate or enforce.

Parameter
Name Description
var bool
Returns
Type Description
$this