Class OSPolicy.Builder (2.18.0)

public static final class OSPolicy.Builder extends GeneratedMessageV3.Builder<OSPolicy.Builder> implements OSPolicyOrBuilder

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

Protobuf type google.cloud.osconfig.v1.OSPolicy

Implements

OSPolicyOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addAllResourceGroups(Iterable<? extends OSPolicy.ResourceGroup> values)

public OSPolicy.Builder addAllResourceGroups(Iterable<? extends OSPolicy.ResourceGroup> values)

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

repeated .google.cloud.osconfig.v1.OSPolicy.ResourceGroup resource_groups = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valuesIterable<? extends com.google.cloud.osconfig.v1.OSPolicy.ResourceGroup>
Returns
TypeDescription
OSPolicy.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public OSPolicy.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
OSPolicy.Builder
Overrides

addResourceGroups(OSPolicy.ResourceGroup value)

public OSPolicy.Builder addResourceGroups(OSPolicy.ResourceGroup value)

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

repeated .google.cloud.osconfig.v1.OSPolicy.ResourceGroup resource_groups = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueOSPolicy.ResourceGroup
Returns
TypeDescription
OSPolicy.Builder

addResourceGroups(OSPolicy.ResourceGroup.Builder builderForValue)

public OSPolicy.Builder addResourceGroups(OSPolicy.ResourceGroup.Builder builderForValue)

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

repeated .google.cloud.osconfig.v1.OSPolicy.ResourceGroup resource_groups = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
builderForValueOSPolicy.ResourceGroup.Builder
Returns
TypeDescription
OSPolicy.Builder

addResourceGroups(int index, OSPolicy.ResourceGroup value)

public OSPolicy.Builder addResourceGroups(int index, OSPolicy.ResourceGroup value)

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

repeated .google.cloud.osconfig.v1.OSPolicy.ResourceGroup resource_groups = 4 [(.google.api.field_behavior) = REQUIRED];

Parameters
NameDescription
indexint
valueOSPolicy.ResourceGroup
Returns
TypeDescription
OSPolicy.Builder

addResourceGroups(int index, OSPolicy.ResourceGroup.Builder builderForValue)

public OSPolicy.Builder addResourceGroups(int index, OSPolicy.ResourceGroup.Builder builderForValue)

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

repeated .google.cloud.osconfig.v1.OSPolicy.ResourceGroup resource_groups = 4 [(.google.api.field_behavior) = REQUIRED];

Parameters
NameDescription
indexint
builderForValueOSPolicy.ResourceGroup.Builder
Returns
TypeDescription
OSPolicy.Builder

addResourceGroupsBuilder()

public OSPolicy.ResourceGroup.Builder addResourceGroupsBuilder()

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

repeated .google.cloud.osconfig.v1.OSPolicy.ResourceGroup resource_groups = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
OSPolicy.ResourceGroup.Builder

addResourceGroupsBuilder(int index)

public OSPolicy.ResourceGroup.Builder addResourceGroupsBuilder(int index)

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

repeated .google.cloud.osconfig.v1.OSPolicy.ResourceGroup resource_groups = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
indexint
Returns
TypeDescription
OSPolicy.ResourceGroup.Builder

build()

public OSPolicy build()
Returns
TypeDescription
OSPolicy

buildPartial()

public OSPolicy buildPartial()
Returns
TypeDescription
OSPolicy

clear()

public OSPolicy.Builder clear()
Returns
TypeDescription
OSPolicy.Builder
Overrides

clearAllowNoResourceGroupMatch()

public OSPolicy.Builder clearAllowNoResourceGroupMatch()

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 allow_no_resource_group_match = 5;

Returns
TypeDescription
OSPolicy.Builder

This builder for chaining.

clearDescription()

public OSPolicy.Builder clearDescription()

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

string description = 2;

Returns
TypeDescription
OSPolicy.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public OSPolicy.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription