Google Cloud OsConfig V1 Client - Class OSPolicy (1.1.1)

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
NameDescription
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<Google\Cloud\OsConfig\V1\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
TypeDescription
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
NameDescription
var string
Returns
TypeDescription
$this

getDescription

Policy description.

Length of the description is limited to 1024 characters.

Returns
TypeDescription
string

setDescription

Policy description.

Length of the description is limited to 1024 characters.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getMode

Required. Policy mode

Returns
TypeDescription
int

setMode

Required. Policy mode

Parameter
NameDescription
var int
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var array<Google\Cloud\OsConfig\V1\OSPolicy\ResourceGroup>
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var bool
Returns
TypeDescription
$this