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 \ V1Methods
__construct
Constructor.
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.
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.
var
string
$this
getDescription
Policy description.
Length of the description is limited to 1024 characters.
string
setDescription
Policy description.
Length of the description is limited to 1024 characters.
var
string
$this
getMode
Required. Policy mode
int
setMode
Required. Policy mode
var
int
$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
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
$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.
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.
var
bool
$this