Class Image.Builder (1.88.0)

public static final class Image.Builder extends GeneratedMessageV3.Builder<Image.Builder> implements ImageOrBuilder

Represents an Image resource. You can use images to create boot disks for your VM instances. For more information, read Images.

Protobuf type google.cloud.compute.v1.Image

Implements

ImageOrBuilder

Static Methods

getDescriptor()

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

Methods

addAllGuestOsFeatures(Iterable<? extends GuestOsFeature> values)

public Image.Builder addAllGuestOsFeatures(Iterable<? extends GuestOsFeature> values)

A list of features to enable on the guest operating system. Applicable only for bootable images. To see a list of available options, see the guestOSfeatures[].type parameter.

repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545;

Parameter
Name Description
values Iterable<? extends com.google.cloud.compute.v1.GuestOsFeature>
Returns
Type Description
Image.Builder

addAllLicenseCodes(Iterable<? extends Long> values)

public Image.Builder addAllLicenseCodes(Iterable<? extends Long> values)

Integer license codes indicating which licenses are attached to this image.

repeated int64 license_codes = 45482664;

Parameter
Name Description
values Iterable<? extends java.lang.Long>

The licenseCodes to add.

Returns
Type Description
Image.Builder

This builder for chaining.

addAllLicenses(Iterable<String> values)

public Image.Builder addAllLicenses(Iterable<String> values)

Any applicable license URI.

repeated string licenses = 337642578;

Parameter
Name Description
values Iterable<String>

The licenses to add.

Returns
Type Description
Image.Builder

This builder for chaining.

addAllStorageLocations(Iterable<String> values)

public Image.Builder addAllStorageLocations(Iterable<String> values)

Cloud Storage bucket storage location of the image (regional or multi-regional).

repeated string storage_locations = 328005274;

Parameter
Name Description
values Iterable<String>

The storageLocations to add.

Returns
Type Description
Image.Builder

This builder for chaining.

addGuestOsFeatures(GuestOsFeature value)

public Image.Builder addGuestOsFeatures(GuestOsFeature value)

A list of features to enable on the guest operating system. Applicable only for bootable images. To see a list of available options, see the guestOSfeatures[].type parameter.

repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545;

Parameter
Name Description
value GuestOsFeature
Returns
Type Description
Image.Builder

addGuestOsFeatures(GuestOsFeature.Builder builderForValue)

public Image.Builder addGuestOsFeatures(GuestOsFeature.Builder builderForValue)

A list of features to enable on the guest operating system. Applicable only for bootable images. To see a list of available options, see the guestOSfeatures[].type parameter.

repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545;

Parameter
Name Description
builderForValue GuestOsFeature.Builder
Returns
Type Description
Image.Builder

addGuestOsFeatures(int index, GuestOsFeature value)

public Image.Builder addGuestOsFeatures(int index, GuestOsFeature value)

A list of features to enable on the guest operating system. Applicable only for bootable images. To see a list of available options, see the guestOSfeatures[].type parameter.

repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545;

Parameters
Name Description
index int
value GuestOsFeature
Returns
Type Description
Image.Builder

addGuestOsFeatures(int index, GuestOsFeature.Builder builderForValue)

public Image.Builder addGuestOsFeatures(int index, GuestOsFeature.Builder builderForValue)

A list of features to enable on the guest operating system. Applicable only for bootable images. To see a list of available options, see the guestOSfeatures[].type parameter.

repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545;

Parameters
Name Description
index int
builderForValue GuestOsFeature.Builder
Returns
Type Description
Image.Builder

addGuestOsFeaturesBuilder()

public GuestOsFeature.Builder addGuestOsFeaturesBuilder()

A list of features to enable on the guest operating system. Applicable only for bootable images. To see a list of available options, see the guestOSfeatures[].type parameter.

repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545;

Returns
Type Description
GuestOsFeature.Builder

addGuestOsFeaturesBuilder(int index)

public GuestOsFeature.Builder addGuestOsFeaturesBuilder(int index)

A list of features to enable on the guest operating system. Applicable only for bootable images. To see a list of available options, see the guestOSfeatures[].type parameter.

repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545;

Parameter
Name Description
index int
Returns
Type Description
GuestOsFeature.Builder

addLicenseCodes(long value)

public Image.Builder addLicenseCodes(long value)

Integer license codes indicating which licenses are attached to this image.

repeated int64 license_codes = 45482664;

Parameter
Name Description
value long

The licenseCodes to add.

Returns
Type Description
Image.Builder

This builder for chaining.

addLicenses(String value)

public Image.Builder addLicenses(String value)

Any applicable license URI.

repeated string licenses = 337642578;

Parameter
Name Description
value String

The licenses to add.

Returns
Type Description
Image.Builder

This builder for chaining.

addLicensesBytes(ByteString value)

public Image.Builder addLicensesBytes(ByteString value)

Any applicable license URI.

repeated string licenses = 337642578;

Parameter
Name Description
value ByteString

The bytes of the licenses to add.

Returns
Type Description
Image.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Image.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Image.Builder
Overrides

addStorageLocations(String value)

public Image.Builder addStorageLocations(String value)

Cloud Storage bucket storage location of the image (regional or multi-regional).

repeated string storage_locations = 328005274;

Parameter
Name Description
value String

The storageLocations to add.

Returns
Type Description
Image.Builder

This builder for chaining.

addStorageLocationsBytes(ByteString value)

public Image.Builder addStorageLocationsBytes(ByteString value)

Cloud Storage bucket storage location of the image (regional or multi-regional).

repeated string storage_locations = 328005274;

Parameter
Name Description
value ByteString

The bytes of the storageLocations to add.

Returns
Type Description
Image.Builder

This builder for chaining.

build()

public Image build()
Returns
Type Description
Image

buildPartial()

public Image buildPartial()
Returns
Type Description
Image

clear()

public Image.Builder clear()
Returns
Type Description
Image.Builder
Overrides

clearArchitecture()

public Image.Builder clearArchitecture()

The architecture of the image. Valid values are ARM64 or X86_64. Check the Architecture enum for the list of possible values.

optional string architecture = 302803283;

Returns
Type Description
Image.Builder

This builder for chaining.

clearArchiveSizeBytes()

public Image.Builder clearArchiveSizeBytes()

Size of the image tar.gz archive stored in Google Cloud Storage (in bytes).

optional int64 archive_size_bytes = 381093450;

Returns
Type Description
Image.Builder

This builder for chaining.

clearCreationTimestamp()

public Image.Builder clearCreationTimestamp()

[Output Only] Creation timestamp in RFC3339 text format.

optional string creation_timestamp = 30525366;

Returns
Type Description
Image.Builder

This builder for chaining.

clearDeprecated()

public Image.Builder clearDeprecated()

The deprecation status associated with this image.

optional .google.cloud.compute.v1.DeprecationStatus deprecated = 515138995;

Returns
Type Description
Image.Builder

clearDescription()

public Image.Builder clearDescription()

An optional description of this resource. Provide this property when you create the resource.

optional string description = 422937596;

Returns
Type Description
Image.Builder

This builder for chaining.

clearDiskSizeGb()

public Image.Builder clearDiskSizeGb()

Size of the image when restored onto a persistent disk (in GB).

optional int64 disk_size_gb = 316263735;

Returns
Type Description
Image.Builder

This builder for chaining.

clearEnableConfidentialCompute()

public Image.Builder clearEnableConfidentialCompute()

Whether this image is created from a confidential compute mode disk. [Output Only]: This field is not set by user, but from source disk.

optional bool enable_confidential_compute = 102135228;

Returns
Type Description
Image.Builder

This builder for chaining.

clearFamily()

public Image.Builder clearFamily()

The name of the image family to which this image belongs. The image family name can be from a publicly managed image family provided by Compute Engine, or from a custom image family you create. For example, centos-stream-9 is a publicly available image family. For more information, see Image family best practices. When creating disks, you can specify an image family instead of a specific image name. The image family always returns its latest image that is not deprecated. The name of the image family must comply with RFC1035.

optional string family = 328751972;

Returns
Type Description
Image.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public Image.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description