public class Snapshot extends SnapshotInfo
Snapshot
adds a layer of service-related
functionality over SnapshotInfo
. Objects of this class are immutable; to get a Snapshot
object with the most recent information use reload(com.google.cloud.compute.deprecated.Compute.SnapshotOption...)
.Modifier and Type | Class and Description |
---|---|
static class |
Snapshot.Builder
A builder for
Snapshot objects. |
SnapshotInfo.Status, SnapshotInfo.StorageBytesStatus
Modifier and Type | Method and Description |
---|---|
Operation |
delete(Compute.OperationOption... options)
Deletes this snapshot.
|
boolean |
equals(Object obj) |
boolean |
exists()
Checks if this snapshot exists.
|
Compute |
getCompute()
Returns the snapshot's
Compute object used to issue requests. |
int |
hashCode() |
Snapshot |
reload(Compute.SnapshotOption... options)
Fetches current snapshot's latest information.
|
Snapshot.Builder |
toBuilder()
Returns a builder for the current snapshot.
|
getCreationTimestamp, getDescription, getDiskSizeGb, getGeneratedId, getLicenses, getSnapshotId, getSourceDisk, getSourceDiskId, getStatus, getStorageBytes, getStorageBytesStatus, newBuilder, of, toString
public boolean exists()
true
if this snapshot exists, false
otherwiseComputeException
- upon failurepublic Snapshot reload(Compute.SnapshotOption... options)
null
if the snapshot does not
exist.options
- snapshot optionsSnapshot
object with latest information or null
if not foundComputeException
- upon failurepublic Operation delete(Compute.OperationOption... options)
null
if the
snapshot was not foundComputeException
- upon failurepublic Compute getCompute()
Compute
object used to issue requests.public Snapshot.Builder toBuilder()
SnapshotInfo
toBuilder
in class SnapshotInfo
public final boolean equals(Object obj)
equals
in class SnapshotInfo
public final int hashCode()
hashCode
in class SnapshotInfo
Copyright © 2019 Google LLC. All rights reserved.