Class GuestPolicies.GuestPolicy (2.44.0)

public static final class GuestPolicies.GuestPolicy extends GeneratedMessageV3 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 Fields

ASSIGNMENT_FIELD_NUMBER

public static final int ASSIGNMENT_FIELD_NUMBER
Field Value
Type Description
int

CREATE_TIME_FIELD_NUMBER

public static final int CREATE_TIME_FIELD_NUMBER
Field Value
Type Description
int

DESCRIPTION_FIELD_NUMBER

public static final int DESCRIPTION_FIELD_NUMBER
Field Value
Type Description
int

ETAG_FIELD_NUMBER

public static final int ETAG_FIELD_NUMBER
Field Value
Type Description
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
Type Description
int

PACKAGES_FIELD_NUMBER

public static final int PACKAGES_FIELD_NUMBER
Field Value
Type Description
int

PACKAGE_REPOSITORIES_FIELD_NUMBER

public static final int PACKAGE_REPOSITORIES_FIELD_NUMBER
Field Value
Type Description
int

RECIPES_FIELD_NUMBER

public static final int RECIPES_FIELD_NUMBER
Field Value
Type Description
int

UPDATE_TIME_FIELD_NUMBER

public static final int UPDATE_TIME_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static GuestPolicies.GuestPolicy getDefaultInstance()
Returns
Type Description
GuestPolicies.GuestPolicy

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static GuestPolicies.GuestPolicy.Builder newBuilder()
Returns
Type Description
GuestPolicies.GuestPolicy.Builder

newBuilder(GuestPolicies.GuestPolicy prototype)

public static GuestPolicies.GuestPolicy.Builder newBuilder(GuestPolicies.GuestPolicy prototype)
Parameter
Name Description
prototype GuestPolicies.GuestPolicy
Returns
Type Description
GuestPolicies.GuestPolicy.Builder

parseDelimitedFrom(InputStream input)

public static GuestPolicies.GuestPolicy parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
GuestPolicies.GuestPolicy
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static GuestPolicies.GuestPolicy parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
GuestPolicies.GuestPolicy
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static GuestPolicies.GuestPolicy parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
GuestPolicies.GuestPolicy
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static GuestPolicies.GuestPolicy parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
GuestPolicies.GuestPolicy
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static GuestPolicies.GuestPolicy parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
GuestPolicies.GuestPolicy
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static GuestPolicies.GuestPolicy parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
GuestPolicies.GuestPolicy
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static GuestPolicies.GuestPolicy parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
GuestPolicies.GuestPolicy
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static GuestPolicies.GuestPolicy parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
GuestPolicies.GuestPolicy
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static GuestPolicies.GuestPolicy parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
GuestPolicies.GuestPolicy
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static GuestPolicies.GuestPolicy parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
GuestPolicies.GuestPolicy
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static GuestPolicies.GuestPolicy parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
GuestPolicies.GuestPolicy
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static GuestPolicies.GuestPolicy parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
GuestPolicies.GuestPolicy
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<GuestPolicies.GuestPolicy> parser()
Returns
Type Description
Parser<GuestPolicy>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getAssignment()

public GuestPolicies.Assignment getAssignment()

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
Type Description
GuestPolicies.Assignment

The assignment.

getAssignmentOrBuilder()

public GuestPolicies.AssignmentOrBuilder getAssignmentOrBuilder()

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
Type Description
GuestPolicies.AssignmentOrBuilder

getCreateTime()

public Timestamp getCreateTime()

Output only. Time this guest policy was created.

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

Returns
Type Description
Timestamp

The createTime.

getCreateTimeOrBuilder()

public TimestampOrBuilder getCreateTimeOrBuilder()

Output only. Time this guest policy was created.

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

Returns
Type Description
TimestampOrBuilder

getDefaultInstanceForType()

public GuestPolicies.GuestPolicy getDefaultInstanceForType()
Returns
Type Description
GuestPolicies.GuestPolicy

getDescription()

public String getDescription()

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

string description = 2;

Returns
Type Description
String

The description.

getDescriptionBytes()

public ByteString getDescriptionBytes()

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

string description = 2;

Returns
Type Description
ByteString

The bytes for description.

getEtag()

public String getEtag()

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

string etag = 10;

Returns
Type Description
String

The etag.

getEtagBytes()

public ByteString getEtagBytes()

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

string etag = 10;

Returns
Type Description
ByteString

The bytes for etag.

getName()

public String getName()

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
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

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
Type Description
ByteString

The bytes for name.

getPackageRepositories(int index)

public GuestPolicies.PackageRepository getPackageRepositories(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
Name Description
index int
Returns
Type Description
GuestPolicies.PackageRepository

getPackageRepositoriesCount()

public int getPackageRepositoriesCount()

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
Type Description
int

getPackageRepositoriesList()

public List<GuestPolicies.PackageRepository> getPackageRepositoriesList()

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
Type Description
List<PackageRepository>

getPackageRepositoriesOrBuilder(int index)

public GuestPolicies.PackageRepositoryOrBuilder getPackageRepositoriesOrBuilder(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
Name Description
index int
Returns
Type Description
GuestPolicies.PackageRepositoryOrBuilder

getPackageRepositoriesOrBuilderList()

public List<? extends GuestPolicies.PackageRepositoryOrBuilder> getPackageRepositoriesOrBuilderList()

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
Type Description
List<? extends com.google.cloud.osconfig.v1beta.GuestPolicies.PackageRepositoryOrBuilder>

getPackages(int index)

public GuestPolicies.Package getPackages(int index)

The software packages to be managed by this policy.

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

Parameter
Name Description
index int
Returns
Type Description
GuestPolicies.Package

getPackagesCount()

public int getPackagesCount()

The software packages to be managed by this policy.

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

Returns
Type Description
int

getPackagesList()

public List<GuestPolicies.Package> getPackagesList()

The software packages to be managed by this policy.

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

Returns
Type Description
List<Package>

getPackagesOrBuilder(int index)

public GuestPolicies.PackageOrBuilder getPackagesOrBuilder(int index)

The software packages to be managed by this policy.

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

Parameter
Name Description
index int
Returns
Type Description
GuestPolicies.PackageOrBuilder

getPackagesOrBuilderList()

public List<? extends GuestPolicies.PackageOrBuilder> getPackagesOrBuilderList()

The software packages to be managed by this policy.

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

Returns
Type Description
List<? extends com.google.cloud.osconfig.v1beta.GuestPolicies.PackageOrBuilder>

getParserForType()

public Parser<GuestPolicies.GuestPolicy> getParserForType()
Returns
Type Description
Parser<GuestPolicy>
Overrides

getRecipes(int index)

public GuestPolicies.SoftwareRecipe getRecipes(int index)

A list of Recipes to install on the VM instance.

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

Parameter
Name Description
index int
Returns
Type Description
GuestPolicies.SoftwareRecipe

getRecipesCount()

public int getRecipesCount()

A list of Recipes to install on the VM instance.

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

Returns
Type Description
int

getRecipesList()

public List<GuestPolicies.SoftwareRecipe> getRecipesList()

A list of Recipes to install on the VM instance.

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

Returns
Type Description
List<SoftwareRecipe>

getRecipesOrBuilder(int index)

public GuestPolicies.SoftwareRecipeOrBuilder getRecipesOrBuilder(int index)

A list of Recipes to install on the VM instance.

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

Parameter
Name Description
index int
Returns
Type Description
GuestPolicies.SoftwareRecipeOrBuilder

getRecipesOrBuilderList()

public List<? extends GuestPolicies.SoftwareRecipeOrBuilder> getRecipesOrBuilderList()

A list of Recipes to install on the VM instance.

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

Returns
Type Description
List<? extends com.google.cloud.osconfig.v1beta.GuestPolicies.SoftwareRecipeOrBuilder>

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getUpdateTime()

public Timestamp getUpdateTime()

Output only. Last time this guest policy was updated.

.google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The updateTime.

getUpdateTimeOrBuilder()

public TimestampOrBuilder getUpdateTimeOrBuilder()

Output only. Last time this guest policy was updated.

.google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
TimestampOrBuilder

hasAssignment()

public boolean hasAssignment()

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
Type Description
boolean

Whether the assignment field is set.

hasCreateTime()

public boolean hasCreateTime()

Output only. Time this guest policy was created.

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

Returns
Type Description
boolean

Whether the createTime field is set.

hasUpdateTime()

public boolean hasUpdateTime()

Output only. Last time this guest policy was updated.

.google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the updateTime field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public GuestPolicies.GuestPolicy.Builder newBuilderForType()
Returns
Type Description
GuestPolicies.GuestPolicy.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected GuestPolicies.GuestPolicy.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
GuestPolicies.GuestPolicy.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public GuestPolicies.GuestPolicy.Builder toBuilder()
Returns
Type Description
GuestPolicies.GuestPolicy.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException