Class OSPolicyAssignment.Builder (2.5.2)

Stay organized with collections Save and categorize content based on your preferences.
public static final class OSPolicyAssignment.Builder extends GeneratedMessageV3.Builder<OSPolicyAssignment.Builder> implements OSPolicyAssignmentOrBuilder

OS policy assignment is an API resource that is used to apply a set of OS policies to a dynamically targeted group of Compute Engine VM instances. An OS policy is used to define the desired state configuration for a Compute Engine VM instance through a set of configuration resources that provide capabilities such as installing or removing software packages, or executing a script. For more information, see OS policy and OS policy assignment.

Protobuf type google.cloud.osconfig.v1.OSPolicyAssignment

Static Methods

getDescriptor()

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

Methods

addAllOsPolicies(Iterable<? extends OSPolicy> values)

public OSPolicyAssignment.Builder addAllOsPolicies(Iterable<? extends OSPolicy> values)

Required. List of OS policies to be applied to the VMs.

repeated .google.cloud.osconfig.v1.OSPolicy os_policies = 3 [(.google.api.field_behavior) = REQUIRED];

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

addOsPolicies(OSPolicy value)

public OSPolicyAssignment.Builder addOsPolicies(OSPolicy value)

Required. List of OS policies to be applied to the VMs.

repeated .google.cloud.osconfig.v1.OSPolicy os_policies = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueOSPolicy
Returns
TypeDescription
OSPolicyAssignment.Builder

addOsPolicies(OSPolicy.Builder builderForValue)

public OSPolicyAssignment.Builder addOsPolicies(OSPolicy.Builder builderForValue)

Required. List of OS policies to be applied to the VMs.

repeated .google.cloud.osconfig.v1.OSPolicy os_policies = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
builderForValueOSPolicy.Builder
Returns
TypeDescription
OSPolicyAssignment.Builder

addOsPolicies(int index, OSPolicy value)

public OSPolicyAssignment.Builder addOsPolicies(int index, OSPolicy value)

Required. List of OS policies to be applied to the VMs.

repeated .google.cloud.osconfig.v1.OSPolicy os_policies = 3 [(.google.api.field_behavior) = REQUIRED];

Parameters
NameDescription
indexint
valueOSPolicy
Returns
TypeDescription
OSPolicyAssignment.Builder

addOsPolicies(int index, OSPolicy.Builder builderForValue)

public OSPolicyAssignment.Builder addOsPolicies(int index, OSPolicy.Builder builderForValue)

Required. List of OS policies to be applied to the VMs.

repeated .google.cloud.osconfig.v1.OSPolicy os_policies = 3 [(.google.api.field_behavior) = REQUIRED];

Parameters
NameDescription
indexint
builderForValueOSPolicy.Builder
Returns
TypeDescription
OSPolicyAssignment.Builder

addOsPoliciesBuilder()

public OSPolicy.Builder addOsPoliciesBuilder()

Required. List of OS policies to be applied to the VMs.

repeated .google.cloud.osconfig.v1.OSPolicy os_policies = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
OSPolicy.Builder

addOsPoliciesBuilder(int index)

public OSPolicy.Builder addOsPoliciesBuilder(int index)

Required. List of OS policies to be applied to the VMs.

repeated .google.cloud.osconfig.v1.OSPolicy os_policies = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
indexint
Returns
TypeDescription
OSPolicy.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public OSPolicyAssignment build()
Returns
TypeDescription
OSPolicyAssignment

buildPartial()

public OSPolicyAssignment buildPartial()
Returns
TypeDescription
OSPolicyAssignment

clear()

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

clearBaseline()

public OSPolicyAssignment.Builder clearBaseline()

Output only. Indicates that this revision has been successfully rolled out in this zone and new VMs will be assigned OS policies from this revision. For a given OS policy assignment, there is only one revision with a value of true for this field.

bool baseline = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
OSPolicyAssignment.Builder

This builder for chaining.

clearDeleted()

public OSPolicyAssignment.Builder clearDeleted()

Output only. Indicates that this revision deletes the OS policy assignment.

bool deleted = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
OSPolicyAssignment.Builder

This builder for chaining.

clearDescription()

public OSPolicyAssignment.Builder clearDescription()

OS policy assignment description. Length of the description is limited to 1024 characters.

string description = 2;

Returns
TypeDescription
OSPolicyAssignment.Builder

This builder for chaining.

clearEtag()

public OSPolicyAssignment.Builder clearEtag()

The etag for this OS policy assignment. If this is provided on update, it must match the server's etag.

string etag = 8;

Returns
TypeDescription
OSPolicyAssignment.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public OSPolicyAssignment.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
OSPolicyAssignment.Builder
Overrides

clearInstanceFilter()

public OSPolicyAssignment.Builder clearInstanceFilter()

Required. Filter to select VMs.

.google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter instance_filter = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
OSPolicyAssignment.Builder

clearName()

public OSPolicyAssignment.Builder clearName()

Resource name. Format: projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id} This field is ignored when you create an OS policy assignment.

string name = 1;

Returns
TypeDescription
OSPolicyAssignment.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public OSPolicyAssignment.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
OSPolicyAssignment.Builder
Overrides

clearOsPolicies()

public OSPolicyAssignment.Builder clearOsPolicies()

Required. List of OS policies to be applied to the VMs.

repeated .google.cloud.osconfig.v1.OSPolicy os_policies = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
OSPolicyAssignment.Builder

clearReconciling()

public OSPolicyAssignment.Builder clearReconciling()

Output only. Indicates that reconciliation is in progress for the revision. This value is true when the rollout_state is one of:

  • IN_PROGRESS
  • CANCELLING

bool reconciling = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
OSPolicyAssignment.Builder

This builder for chaining.

clearRevisionCreateTime()

public OSPolicyAssignment.Builder clearRevisionCreateTime()

Output only. The timestamp that the revision was created.

.google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
OSPolicyAssignment.Builder

clearRevisionId()

public OSPolicyAssignment.Builder clearRevisionId()

Output only. The assignment revision ID A new revision is committed whenever a rollout is triggered for a OS policy assignment

string revision_id = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
OSPolicyAssignment.Builder

This builder for chaining.

clearRollout()

public OSPolicyAssignment.Builder clearRollout()

Required. Rollout to deploy the OS policy assignment. A rollout is triggered in the following situations: 1) OSPolicyAssignment is created. 2) OSPolicyAssignment is updated and the update contains changes to one of the following fields:

  • instance_filter
  • os_policies 3) OSPolicyAssignment is deleted.

.google.cloud.osconfig.v1.OSPolicyAssignment.Rollout rollout = 5 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
OSPolicyAssignment.Builder

clearRolloutState()

public OSPolicyAssignment.Builder clearRolloutState()

Output only. OS policy assignment rollout state

.google.cloud.osconfig.v1.OSPolicyAssignment.RolloutState rollout_state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
OSPolicyAssignment.Builder

This builder for chaining.

clearUid()

public OSPolicyAssignment.Builder clearUid()

Output only. Server generated unique id for the OS policy assignment resource.

string uid = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
OSPolicyAssignment.Builder

This builder for chaining.

clone()

public OSPolicyAssignment.Builder clone()
Returns
TypeDescription
OSPolicyAssignment.Builder
Overrides

getBaseline()

public boolean getBaseline()

Output only. Indicates that this revision has been successfully rolled out in this zone and new VMs will be assigned OS policies from this revision. For a given OS policy assignment, there is only one revision with a value of true for this field.

bool baseline = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
boolean

The baseline.

getDefaultInstanceForType()

public OSPolicyAssignment getDefaultInstanceForType()
Returns
TypeDescription
OSPolicyAssignment

getDeleted()

public boolean getDeleted()

Output only. Indicates that this revision deletes the OS policy assignment.

bool deleted = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
boolean

The deleted.

getDescription()

public String getDescription()

OS policy assignment description. Length of the description is limited to 1024 characters.

string description = 2;

Returns
TypeDescription
String

The description.

getDescriptionBytes()

public ByteString getDescriptionBytes()

OS policy assignment description. Length of the description is limited to 1024 characters.

string description = 2;

Returns
TypeDescription
ByteString

The bytes for description.

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getEtag()

public String getEtag()

The etag for this OS policy assignment. If this is provided on update, it must match the server's etag.

string etag = 8;

Returns
TypeDescription
String

The etag.

getEtagBytes()

public ByteString getEtagBytes()

The etag for this OS policy assignment. If this is provided on update, it must match the server's etag.

string etag = 8;

Returns
TypeDescription
ByteString

The bytes for etag.

getInstanceFilter()

public OSPolicyAssignment.InstanceFilter getInstanceFilter()

Required. Filter to select VMs.

.google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter instance_filter = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
OSPolicyAssignment.InstanceFilter

The instanceFilter.

getInstanceFilterBuilder()

public OSPolicyAssignment.InstanceFilter.Builder getInstanceFilterBuilder()

Required. Filter to select VMs.

.google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter instance_filter = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
OSPolicyAssignment.InstanceFilter.Builder

getInstanceFilterOrBuilder()

public OSPolicyAssignment.InstanceFilterOrBuilder getInstanceFilterOrBuilder()

Required. Filter to select VMs.

.google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter instance_filter = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
OSPolicyAssignment.InstanceFilterOrBuilder

getName()

public String getName()

Resource name. Format: projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id} This field is ignored when you create an OS policy assignment.

string name = 1;

Returns
TypeDescription
String

The name.

getNameBytes()

public ByteString getNameBytes()

Resource name. Format: projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id} This field is ignored when you create an OS policy assignment.

string name = 1;

Returns
TypeDescription
ByteString

The bytes for name.

getOsPolicies(int index)

public OSPolicy getOsPolicies(int index)

Required. List of OS policies to be applied to the VMs.

repeated .google.cloud.osconfig.v1.OSPolicy os_policies = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
indexint
Returns
TypeDescription
OSPolicy

getOsPoliciesBuilder(int index)

public OSPolicy.Builder getOsPoliciesBuilder(int index)

Required. List of OS policies to be applied to the VMs.

repeated .google.cloud.osconfig.v1.OSPolicy os_policies = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
indexint
Returns
TypeDescription
OSPolicy.Builder<