Class GuestPolicies.GuestPolicy.Builder (2.5.4)

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

An OS Config resource representing a guest configuration policy. These policies represent the desired state for VM instance guest environments including packages to install or remove, package repository configurations, and software to install.

Protobuf type google.cloud.osconfig.v1beta.GuestPolicy

Static Methods

getDescriptor()

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

Methods

addAllPackageRepositories(Iterable<? extends GuestPolicies.PackageRepository> values)

public GuestPolicies.GuestPolicy.Builder addAllPackageRepositories(Iterable<? extends GuestPolicies.PackageRepository> values)

A list of package repositories to configure on the VM instance. This is done before any other configs are applied so they can use these repos. Package repositories are only configured if the corresponding package manager(s) are available.

repeated .google.cloud.osconfig.v1beta.PackageRepository package_repositories = 8;

Parameter
NameDescription
valuesIterable<? extends com.google.cloud.osconfig.v1beta.GuestPolicies.PackageRepository>
Returns
TypeDescription
GuestPolicies.GuestPolicy.Builder

addAllPackages(Iterable<? extends GuestPolicies.Package> values)

public GuestPolicies.GuestPolicy.Builder addAllPackages(Iterable<? extends GuestPolicies.Package> values)

The software packages to be managed by this policy.

repeated .google.cloud.osconfig.v1beta.Package packages = 7;

Parameter
NameDescription
valuesIterable<? extends com.google.cloud.osconfig.v1beta.GuestPolicies.Package>
Returns
TypeDescription
GuestPolicies.GuestPolicy.Builder

addAllRecipes(Iterable<? extends GuestPolicies.SoftwareRecipe> values)

public GuestPolicies.GuestPolicy.Builder addAllRecipes(Iterable<? extends GuestPolicies.SoftwareRecipe> values)

A list of Recipes to install on the VM instance.

repeated .google.cloud.osconfig.v1beta.SoftwareRecipe recipes = 9;

Parameter
NameDescription
valuesIterable<? extends com.google.cloud.osconfig.v1beta.GuestPolicies.SoftwareRecipe>
Returns
TypeDescription
GuestPolicies.GuestPolicy.Builder

addPackageRepositories(GuestPolicies.PackageRepository value)

public GuestPolicies.GuestPolicy.Builder addPackageRepositories(GuestPolicies.PackageRepository value)

A list of package repositories to configure on the VM instance. This is done before any other configs are applied so they can use these repos. Package repositories are only configured if the corresponding package manager(s) are available.

repeated .google.cloud.osconfig.v1beta.PackageRepository package_repositories = 8;

Parameter
NameDescription
valueGuestPolicies.PackageRepository
Returns
TypeDescription
GuestPolicies.GuestPolicy.Builder

addPackageRepositories(GuestPolicies.PackageRepository.Builder builderForValue)

public GuestPolicies.GuestPolicy.Builder addPackageRepositories(GuestPolicies.PackageRepository.Builder builderForValue)

A list of package repositories to configure on the VM instance. This is done before any other configs are applied so they can use these repos. Package repositories are only configured if the corresponding package manager(s) are available.

repeated .google.cloud.osconfig.v1beta.PackageRepository package_repositories = 8;

Parameter
NameDescription
builderForValueGuestPolicies.PackageRepository.Builder
Returns
TypeDescription
GuestPolicies.GuestPolicy.Builder

addPackageRepositories(int index, GuestPolicies.PackageRepository value)

public GuestPolicies.GuestPolicy.Builder addPackageRepositories(int index, GuestPolicies.PackageRepository value)

A list of package repositories to configure on the VM instance. This is done before any other configs are applied so they can use these repos. Package repositories are only configured if the corresponding package manager(s) are available.

repeated .google.cloud.osconfig.v1beta.PackageRepository package_repositories = 8;

Parameters
NameDescription
indexint
valueGuestPolicies.PackageRepository
Returns
TypeDescription
GuestPolicies.GuestPolicy.Builder

addPackageRepositories(int index, GuestPolicies.PackageRepository.Builder builderForValue)

public GuestPolicies.GuestPolicy.Builder addPackageRepositories(int index, GuestPolicies.PackageRepository.Builder builderForValue)

A list of package repositories to configure on the VM instance. This is done before any other configs are applied so they can use these repos. Package repositories are only configured if the corresponding package manager(s) are available.

repeated .google.cloud.osconfig.v1beta.PackageRepository package_repositories = 8;

Parameters
NameDescription
indexint
builderForValueGuestPolicies.PackageRepository.Builder
Returns
TypeDescription
GuestPolicies.GuestPolicy.Builder

addPackageRepositoriesBuilder()

public GuestPolicies.PackageRepository.Builder addPackageRepositoriesBuilder()

A list of package repositories to configure on the VM instance. This is done before any other configs are applied so they can use these repos. Package repositories are only configured if the corresponding package manager(s) are available.

repeated .google.cloud.osconfig.v1beta.PackageRepository package_repositories = 8;

Returns
TypeDescription
GuestPolicies.PackageRepository.Builder

addPackageRepositoriesBuilder(int index)

public GuestPolicies.PackageRepository.Builder addPackageRepositoriesBuilder(int index)

A list of package repositories to configure on the VM instance. This is done before any other configs are applied so they can use these repos. Package repositories are only configured if the corresponding package manager(s) are available.

repeated .google.cloud.osconfig.v1beta.PackageRepository package_repositories = 8;

Parameter
NameDescription
indexint
Returns
TypeDescription
GuestPolicies.PackageRepository.Builder

addPackages(GuestPolicies.Package value)

public GuestPolicies.GuestPolicy.Builder addPackages(GuestPolicies.Package value)

The software packages to be managed by this policy.

repeated .google.cloud.osconfig.v1beta.Package packages = 7;

Parameter
NameDescription
valueGuestPolicies.Package
Returns
TypeDescription
GuestPolicies.GuestPolicy.Builder

addPackages(GuestPolicies.Package.Builder builderForValue)

public GuestPolicies.GuestPolicy.Builder addPackages(GuestPolicies.Package.Builder builderForValue)

The software packages to be managed by this policy.

repeated .google.cloud.osconfig.v1beta.Package packages = 7;

Parameter
NameDescription
builderForValueGuestPolicies.Package.Builder
Returns
TypeDescription
GuestPolicies.GuestPolicy.Builder

addPackages(int index, GuestPolicies.Package value)

public GuestPolicies.GuestPolicy.Builder addPackages(int index, GuestPolicies.Package value)

The software packages to be managed by this policy.

repeated .google.cloud.osconfig.v1beta.Package packages = 7;

Parameters
NameDescription
indexint
valueGuestPolicies.Package
Returns
TypeDescription
GuestPolicies.GuestPolicy.Builder

addPackages(int index, GuestPolicies.Package.Builder builderForValue)

public GuestPolicies.GuestPolicy.Builder addPackages(int index, GuestPolicies.Package.Builder builderForValue)

The software packages to be managed by this policy.

repeated .google.cloud.osconfig.v1beta.Package packages = 7;

Parameters
NameDescription
indexint
builderForValueGuestPolicies.Package.Builder
Returns
TypeDescription
GuestPolicies.GuestPolicy.Builder

addPackagesBuilder()

public GuestPolicies.Package.Builder addPackagesBuilder()

The software packages to be managed by this policy.

repeated .google.cloud.osconfig.v1beta.Package packages = 7;

Returns
TypeDescription
GuestPolicies.Package.Builder

addPackagesBuilder(int index)

public GuestPolicies.Package.Builder addPackagesBuilder(int index)

The software packages to be managed by this policy.

repeated .google.cloud.osconfig.v1beta.Package packages = 7;

Parameter
NameDescription
indexint
Returns
TypeDescription
GuestPolicies.Package.Builder

addRecipes(GuestPolicies.SoftwareRecipe value)

public GuestPolicies.GuestPolicy.Builder addRecipes(GuestPolicies.SoftwareRecipe value)

A list of Recipes to install on the VM instance.

repeated .google.cloud.osconfig.v1beta.SoftwareRecipe recipes = 9;

Parameter
NameDescription
valueGuestPolicies.SoftwareRecipe
Returns
TypeDescription
GuestPolicies.GuestPolicy.Builder

addRecipes(GuestPolicies.SoftwareRecipe.Builder builderForValue)

public GuestPolicies.GuestPolicy.Builder addRecipes(GuestPolicies.SoftwareRecipe.Builder builderForValue)

A list of Recipes to install on the VM instance.

repeated .google.cloud.osconfig.v1beta.SoftwareRecipe recipes = 9;

Parameter
NameDescription
builderForValueGuestPolicies.SoftwareRecipe.Builder
Returns
TypeDescription
GuestPolicies.GuestPolicy.Builder

addRecipes(int index, GuestPolicies.SoftwareRecipe value)

public GuestPolicies.GuestPolicy.Builder addRecipes(int index, GuestPolicies.SoftwareRecipe value)

A list of Recipes to install on the VM instance.

repeated .google.cloud.osconfig.v1beta.SoftwareRecipe recipes = 9;

Parameters
NameDescription
indexint
valueGuestPolicies.SoftwareRecipe
Returns
TypeDescription
GuestPolicies.GuestPolicy.Builder

addRecipes(int index, GuestPolicies.SoftwareRecipe.Builder builderForValue)

public GuestPolicies.GuestPolicy.Builder addRecipes(int index, GuestPolicies.SoftwareRecipe.Builder builderForValue)

A list of Recipes to install on the VM instance.

repeated .google.cloud.osconfig.v1beta.SoftwareRecipe recipes = 9;

Parameters
NameDescription
indexint
builderForValueGuestPolicies.SoftwareRecipe.Builder
Returns
TypeDescription
GuestPolicies.GuestPolicy.Builder

addRecipesBuilder()

public GuestPolicies.SoftwareRecipe.Builder addRecipesBuilder()

A list of Recipes to install on the VM instance.

repeated .google.cloud.osconfig.v1beta.SoftwareRecipe recipes = 9;

Returns
TypeDescription
GuestPolicies.SoftwareRecipe.Builder

addRecipesBuilder(int index)

public GuestPolicies.SoftwareRecipe.Builder addRecipesBuilder(int index)

A list of Recipes to install on the VM instance.

repeated .google.cloud.osconfig.v1beta.SoftwareRecipe recipes = 9;

Parameter
NameDescription
indexint
Returns
TypeDescription
GuestPolicies.SoftwareRecipe.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public GuestPolicies.GuestPolicy build()
Returns
TypeDescription
GuestPolicies.GuestPolicy

buildPartial()

public GuestPolicies.GuestPolicy buildPartial()
Returns
TypeDescription
GuestPolicies.GuestPolicy

clear()

public GuestPolicies.GuestPolicy.Builder clear()
Returns
TypeDescription
GuestPolicies.GuestPolicy.Builder
Overrides

clearAssignment()

public GuestPolicies.GuestPolicy.Builder clearAssignment()

Required. Specifies the VM instances that are assigned to this policy. This allows you to target sets or groups of VM instances by different parameters such as labels, names, OS, or zones. If left empty, all VM instances underneath this policy are targeted. At the same level in the resource hierarchy (that is within a project), the service prevents the creation of multiple policies that conflict with each other. For more information, see how the service handles assignment conflicts.

.google.cloud.osconfig.v1beta.Assignment assignment = 6 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
GuestPolicies.GuestPolicy.Builder

clearCreateTime()

public GuestPolicies.GuestPolicy.Builder clearCreateTime()

Output only. Time this guest policy was created.

.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
GuestPolicies.GuestPolicy.Builder

clearDescription()

public GuestPolicies.GuestPolicy.Builder clearDescription()

Description of the guest policy. Length of the description is limited to 1024 characters.

string description = 2;

Returns
TypeDescription
GuestPolicies.GuestPolicy.Builder

This builder for chaining.

clearEtag()

public GuestPolicies.GuestPolicy.Builder clearEtag()

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

string etag = 10;

Returns
TypeDescription
GuestPolicies.GuestPolicy.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearName()

public GuestPolicies.GuestPolicy.Builder clearName()

Required. Unique name of the resource in this project using one of the following forms: projects/{project_number}/guestPolicies/{guest_policy_id}.

string name = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
GuestPolicies.GuestPolicy.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public GuestPolicies.GuestPolicy.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription