public static class AttachedDiskInitializeParams.Builder extends Object
Modifier and Type | Method and Description |
---|---|
AttachedDiskInitializeParams |
build() |
AttachedDiskInitializeParams.Builder |
clone() |
String |
getDescription()
An optional description.
|
String |
getDiskName()
Specifies the disk name.
|
String |
getDiskSizeGb()
Specifies the size of the disk in base-2 GB.
|
String |
getDiskType()
Specifies the disk type to use to create the instance.
|
Map<String,String> |
getLabelsMap()
Labels to apply to this disk.
|
String |
getSourceImage()
The source image to create this disk.
|
CustomerEncryptionKey |
getSourceImageEncryptionKey()
The customer-supplied encryption key of the source image.
|
AttachedDiskInitializeParams.Builder |
mergeFrom(AttachedDiskInitializeParams other) |
AttachedDiskInitializeParams.Builder |
putAllLabels(Map<String,String> labels)
Labels to apply to this disk.
|
AttachedDiskInitializeParams.Builder |
setDescription(String description)
An optional description.
|
AttachedDiskInitializeParams.Builder |
setDiskName(String diskName)
Specifies the disk name.
|
AttachedDiskInitializeParams.Builder |
setDiskSizeGb(String diskSizeGb)
Specifies the size of the disk in base-2 GB.
|
AttachedDiskInitializeParams.Builder |
setDiskType(String diskType)
Specifies the disk type to use to create the instance.
|
AttachedDiskInitializeParams.Builder |
setSourceImage(String sourceImage)
The source image to create this disk.
|
AttachedDiskInitializeParams.Builder |
setSourceImageEncryptionKey(CustomerEncryptionKey sourceImageEncryptionKey)
The customer-supplied encryption key of the source image.
|
public AttachedDiskInitializeParams.Builder mergeFrom(AttachedDiskInitializeParams other)
public String getDescription()
public AttachedDiskInitializeParams.Builder setDescription(String description)
public String getDiskName()
public AttachedDiskInitializeParams.Builder setDiskName(String diskName)
public String getDiskSizeGb()
public AttachedDiskInitializeParams.Builder setDiskSizeGb(String diskSizeGb)
public String getDiskType()
Other values include pd-ssd and local-ssd. If you define this field, you can provide either the full or partial URL. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType - projects/project/zones/zone/diskTypes/diskType - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the name of the disk type, not URL.
public AttachedDiskInitializeParams.Builder setDiskType(String diskType)
Other values include pd-ssd and local-ssd. If you define this field, you can provide either the full or partial URL. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType - projects/project/zones/zone/diskTypes/diskType - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the name of the disk type, not URL.
public Map<String,String> getLabelsMap()
public AttachedDiskInitializeParams.Builder putAllLabels(Map<String,String> labels)
public String getSourceImage()
To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-9 to use the latest Debian 9 image: projects/debian-cloud/global/images/family/debian-9
Alternatively, use a specific version of a public operating system image: projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
To create a disk with a custom image that you created, specify the image name in the following format: global/images/my-custom-image
You can also specify a custom image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name: global/images/family/my-image-family
If the source image is deleted later, this field will not be set.
public AttachedDiskInitializeParams.Builder setSourceImage(String sourceImage)
To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-9 to use the latest Debian 9 image: projects/debian-cloud/global/images/family/debian-9
Alternatively, use a specific version of a public operating system image: projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
To create a disk with a custom image that you created, specify the image name in the following format: global/images/my-custom-image
You can also specify a custom image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name: global/images/family/my-image-family
If the source image is deleted later, this field will not be set.
public CustomerEncryptionKey getSourceImageEncryptionKey()
Instance templates do not store customer-supplied encryption keys, so you cannot create disks for instances in a managed instance group if the source images are encrypted with your own keys.
public AttachedDiskInitializeParams.Builder setSourceImageEncryptionKey(CustomerEncryptionKey sourceImageEncryptionKey)
Instance templates do not store customer-supplied encryption keys, so you cannot create disks for instances in a managed instance group if the source images are encrypted with your own keys.
public AttachedDiskInitializeParams build()
public AttachedDiskInitializeParams.Builder clone()
Copyright © 2019 Google LLC. All rights reserved.