pub struct VolumeClient { /* private fields */ }Expand description
Calls VolumeService.
Block storage volumes: durable disks in one zone that an instance attaches to read and write.
Implementations§
Source§impl VolumeClient
impl VolumeClient
Sourcepub fn new(client: &Client) -> Self
pub fn new(client: &Client) -> Self
Returns a client of VolumeService 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_volume(
&self,
request: GetVolumeRequest,
) -> Result<Volume, Error>
pub async fn get_volume( &self, request: GetVolumeRequest, ) -> Result<Volume, Error>
Returns a volume.
Sourcepub async fn list_volumes(
&self,
request: ListVolumesRequest,
) -> Result<ListVolumesResponse, Error>
pub async fn list_volumes( &self, request: ListVolumesRequest, ) -> Result<ListVolumesResponse, Error>
Lists the volumes in a zone, oldest first. Deleted volumes aren’t
listed. For every zone’s volumes, list the zones whose services name
pvs with the location service (location.origincloudapis.eu), then
each zone’s volumes.
Sourcepub fn all_volumes(&self, request: ListVolumesRequest) -> Pages<Volume>
pub fn all_volumes(&self, request: ListVolumesRequest) -> Pages<Volume>
Returns everything list_volumes 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_volume(
&self,
request: CreateVolumeRequest,
) -> Result<Operation<Volume>, Error>
pub async fn create_volume( &self, request: CreateVolumeRequest, ) -> Result<Operation<Volume>, Error>
Creates a volume, empty or as a copy of a snapshot. The operation is
done once the volume is volume::State::Available, or failed once it is volume::State::Error.
It answers with an operation to wait on: Operation::wait returns the Volume once the change is done.
Sourcepub async fn import_volume(
&self,
request: ImportVolumeRequest,
) -> Result<Operation<Volume>, Error>
pub async fn import_volume( &self, request: ImportVolumeRequest, ) -> Result<Operation<Volume>, Error>
Creates a volume whose initial content is a disk image the platform
downloads. The operation is done once the volume is volume::State::Available.
It answers with an operation to wait on: Operation::wait returns the Volume once the change is done.
Sourcepub async fn update_volume(
&self,
request: UpdateVolumeRequest,
) -> Result<Operation<Volume>, Error>
pub async fn update_volume( &self, request: UpdateVolumeRequest, ) -> Result<Operation<Volume>, Error>
Changes a volume’s size or tags. A larger size_gib grows the volume,
attached or not; it never shrinks, and the size it already has changes
nothing. The operation is done once the volume reports the new size.
It answers with an operation to wait on: Operation::wait returns the Volume once the change is done.
Sourcepub async fn delete_volume(
&self,
request: DeleteVolumeRequest,
) -> Result<Operation<Empty>, Error>
pub async fn delete_volume( &self, request: DeleteVolumeRequest, ) -> Result<Operation<Empty>, Error>
Deletes a volume. It must not be attached, and none of its snapshots
may be left. The operation is done once the volume is volume::State::Deleted.
It answers with an operation to wait on, which has no result: Operation::wait returns once the change is done.