public static class AttachedDiskInitializeParams.Builder extends Object
Modifier and Type | Method and Description |
---|---|
AttachedDiskInitializeParams.Builder |
addAllResourcePolicies(List<String> resourcePolicies)
Resource policies applied to this disk for automatic snapshot creations.
|
AttachedDiskInitializeParams.Builder |
addResourcePolicies(String resourcePolicies)
Resource policies applied to this disk for automatic snapshot creations.
|
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.
|
List<String> |
getResourcePoliciesList()
Resource policies applied to this disk for automatic snapshot creations.
|
String |
getSourceImage()
The source image to create this disk.
|
CustomerEncryptionKey |
getSourceImageEncryptionKey()
The customer-supplied encryption key of the source image.
|
String |
getSourceSnapshot()
The source snapshot to create this disk.
|
CustomerEncryptionKey |
getSourceSnapshotEncryptionKey()
The customer-supplied encryption key of the source snapshot.
|
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.
|
AttachedDiskInitializeParams.Builder |
setSourceSnapshot(String sourceSnapshot)
The source snapshot to create this disk.
|
AttachedDiskInitializeParams.Builder |
setSourceSnapshotEncryptionKey(CustomerEncryptionKey sourceSnapshotEncryptionKey)
The customer-supplied encryption key of the source snapshot.
|
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 List<String> getResourcePoliciesList()
public AttachedDiskInitializeParams.Builder addAllResourcePolicies(List<String> resourcePolicies)
public AttachedDiskInitializeParams.Builder addResourcePolicies(String resourcePolicies)
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 String getSourceSnapshot()
To create a disk with a snapshot that you created, specify the snapshot name in the following format: global/snapshots/my-backup
If the source snapshot is deleted later, this field will not be set.
public AttachedDiskInitializeParams.Builder setSourceSnapshot(String sourceSnapshot)
To create a disk with a snapshot that you created, specify the snapshot name in the following format: global/snapshots/my-backup
If the source snapshot is deleted later, this field will not be set.
public CustomerEncryptionKey getSourceSnapshotEncryptionKey()
public AttachedDiskInitializeParams.Builder setSourceSnapshotEncryptionKey(CustomerEncryptionKey sourceSnapshotEncryptionKey)
public AttachedDiskInitializeParams build()
public AttachedDiskInitializeParams.Builder clone()
Copyright © 2019 Google LLC. All rights reserved.