public class Disk extends DiskInfo
Disk object with the
most recent information use reload(com.google.cloud.compute.deprecated.Compute.DiskOption...). Disk adds a layer of service-related
functionality over DiskInfo.| Modifier and Type | Class and Description |
|---|---|
static class |
Disk.Builder
A builder for
Disk objects. |
DiskInfo.CreationStatus| Modifier and Type | Method and Description |
|---|---|
Operation |
createImage(String image,
Compute.OperationOption... options)
Creates an image for this disk given the image's name.
|
Operation |
createImage(String image,
String description,
Compute.OperationOption... options)
Creates an image for this disk given the image's name and description.
|
Operation |
createSnapshot(String snapshot,
Compute.OperationOption... options)
Creates a snapshot for this disk given the snapshot's name.
|
Operation |
createSnapshot(String snapshot,
String description,
Compute.OperationOption... options)
Creates a snapshot for this disk given the snapshot's name and description.
|
Operation |
delete(Compute.OperationOption... options)
Deletes this disk.
|
boolean |
equals(Object obj) |
boolean |
exists()
Checks if this disk exists.
|
Compute |
getCompute()
Returns the disk's
Compute object used to issue requests. |
int |
hashCode() |
Disk |
reload(Compute.DiskOption... options)
Fetches current disk's latest information.
|
Operation |
resize(long sizeGb,
Compute.OperationOption... options)
Resizes this disk to the requested size.
|
Disk.Builder |
toBuilder()
Returns a builder for the object.
|
getAttachedInstances, getConfiguration, getCreationStatus, getCreationTimestamp, getDescription, getDiskId, getGeneratedId, getLastAttachTimestamp, getLastDetachTimestamp, getLicenses, newBuilder, of, toStringpublic boolean exists()
true if this disk exists, false otherwiseComputeException - upon failurepublic Disk reload(Compute.DiskOption... options)
null if the disk does not exist.options - disk optionsDisk object with latest information or null if not foundComputeException - upon failurepublic Operation delete(Compute.OperationOption... options)
null if the disk
was not foundComputeException - upon failurepublic Operation createSnapshot(String snapshot, Compute.OperationOption... options)
ComputeException - upon failurepublic Operation createSnapshot(String snapshot, String description, Compute.OperationOption... options)
ComputeException - upon failurepublic Operation createImage(String image, Compute.OperationOption... options)
ComputeException - upon failurepublic Operation createImage(String image, String description, Compute.OperationOption... options)
ComputeException - upon failurepublic Operation resize(long sizeGb, Compute.OperationOption... options)
null if this disk
was not foundComputeException - upon failure or if the new disk size is smaller than the previous onepublic Compute getCompute()
Compute object used to issue requests.public Disk.Builder toBuilder()
DiskInfoCopyright © 2019 Google LLC. All rights reserved.