pub struct SnapshotClient { /* private fields */ }Expand description
Calls SnapshotService.
Snapshots: point-in-time copies of a volume, in the volume’s zone. A protected, completed snapshot is the source of new volumes and images.
Implementations§
Source§impl SnapshotClient
impl SnapshotClient
Sourcepub fn new(client: &Client) -> Self
pub fn new(client: &Client) -> Self
Returns a client of SnapshotService that sends its calls through client.
Sourcepub fn service(&self) -> &Service
pub fn service(&self) -> &Service
The endpoint the client sends its calls to, which also serves the operations its methods answer with.
Sourcepub async fn get_snapshot(
&self,
request: GetSnapshotRequest,
) -> Result<Snapshot, Error>
pub async fn get_snapshot( &self, request: GetSnapshotRequest, ) -> Result<Snapshot, Error>
Returns a snapshot.
Sourcepub async fn list_snapshots(
&self,
request: ListSnapshotsRequest,
) -> Result<ListSnapshotsResponse, Error>
pub async fn list_snapshots( &self, request: ListSnapshotsRequest, ) -> Result<ListSnapshotsResponse, Error>
Lists the snapshots in a zone, oldest first. Deleted snapshots aren’t
listed. For every zone’s snapshots, list the zones whose services name
pvs with the location service (location.origincloudapis.eu), then
each zone’s snapshots.
Sourcepub fn all_snapshots(&self, request: ListSnapshotsRequest) -> Pages<Snapshot>
pub fn all_snapshots(&self, request: ListSnapshotsRequest) -> Pages<Snapshot>
Returns everything list_snapshots lists from request’s page on, fetching the next page as the stream reaches it. A page that fails ends the stream with its error.
Sourcepub async fn create_snapshot(
&self,
request: CreateSnapshotRequest,
) -> Result<Operation<Snapshot>, Error>
pub async fn create_snapshot( &self, request: CreateSnapshotRequest, ) -> Result<Operation<Snapshot>, Error>
Takes a snapshot of a volume. The operation is done once the copy is
snapshot::State::Completed, or failed once it is snapshot::State::Error.
It answers with an operation to wait on: Operation::wait returns the Snapshot once the change is done.
Sourcepub async fn update_snapshot(
&self,
request: UpdateSnapshotRequest,
) -> Result<Snapshot, Error>
pub async fn update_snapshot( &self, request: UpdateSnapshotRequest, ) -> Result<Snapshot, Error>
Changes a snapshot’s tags.
Sourcepub async fn delete_snapshot(
&self,
request: DeleteSnapshotRequest,
) -> Result<Operation<Empty>, Error>
pub async fn delete_snapshot( &self, request: DeleteSnapshotRequest, ) -> Result<Operation<Empty>, Error>
Deletes a snapshot. It must be snapshot::State::Completed or snapshot::State::Error, and unprotected.
The operation is done once the snapshot is snapshot::State::Deleted.
It answers with an operation to wait on, which has no result: Operation::wait returns once the change is done.
Sourcepub async fn protect_snapshot(
&self,
request: ProtectSnapshotRequest,
) -> Result<Operation<Snapshot>, Error>
pub async fn protect_snapshot( &self, request: ProtectSnapshotRequest, ) -> Result<Operation<Snapshot>, Error>
Protects a snapshot, so it can be the source of volumes and images and
can’t be deleted. The operation is done once it is snapshot::ProtectionState::Protected.
It answers with an operation to wait on: Operation::wait returns the Snapshot once the change is done.
Sourcepub async fn unprotect_snapshot(
&self,
request: UnprotectSnapshotRequest,
) -> Result<Operation<Snapshot>, Error>
pub async fn unprotect_snapshot( &self, request: UnprotectSnapshotRequest, ) -> Result<Operation<Snapshot>, Error>
Unprotects a snapshot, so it can be deleted. Refused with
FAILED_PRECONDITION while an image is built from it or a volume not
snapshot::State::Deleted was created from it; delete those first. The operation is
done once it is snapshot::ProtectionState::Unprotected.
It answers with an operation to wait on: Operation::wait returns the Snapshot once the change is done.