pub struct VolumeAttachmentClient { /* private fields */ }Expand description
Calls VolumeAttachmentService.
Volume attachments: which volumes of the persistent volume service an instance holds, and the device names its guest sees them under. Creating one attaches a volume, deleting it detaches the volume.
Implementations§
Source§impl VolumeAttachmentClient
impl VolumeAttachmentClient
Sourcepub fn new(client: &Client) -> Self
pub fn new(client: &Client) -> Self
Returns a client of VolumeAttachmentService 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_attachment(
&self,
request: GetVolumeAttachmentRequest,
) -> Result<VolumeAttachment, Error>
pub async fn get_volume_attachment( &self, request: GetVolumeAttachmentRequest, ) -> Result<VolumeAttachment, Error>
Returns a volume attachment. A detached attachment isn’t found.
Sourcepub async fn list_volume_attachments(
&self,
request: ListVolumeAttachmentsRequest,
) -> Result<ListVolumeAttachmentsResponse, Error>
pub async fn list_volume_attachments( &self, request: ListVolumeAttachmentsRequest, ) -> Result<ListVolumeAttachmentsResponse, Error>
Lists an instance’s volume attachments, the boot volume’s first, then
by device name. With - for the instance, lists every instance’s in the
zone, which with volume finds the instance holding a volume.
Detached attachments aren’t listed.
Sourcepub fn all_volume_attachments(
&self,
request: ListVolumeAttachmentsRequest,
) -> Pages<VolumeAttachment>
pub fn all_volume_attachments( &self, request: ListVolumeAttachmentsRequest, ) -> Pages<VolumeAttachment>
Returns everything list_volume_attachments 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_attachment(
&self,
request: CreateVolumeAttachmentRequest,
) -> Result<Operation<VolumeAttachment>, Error>
pub async fn create_volume_attachment( &self, request: CreateVolumeAttachmentRequest, ) -> Result<Operation<VolumeAttachment>, Error>
Attaches an AVAILABLE volume to a instance::State::Running or instance::State::Stopped instance in
the same project and zone. On a stopped instance the disk appears at
the next start, and the operation is done at once. On a running one it
is added live, and the operation is done once the guest sees it, or
failed if it couldn’t be added, which leaves the volume available.
It answers with an operation to wait on: Operation::wait returns the VolumeAttachment once the change is done.
Sourcepub async fn delete_volume_attachment(
&self,
request: DeleteVolumeAttachmentRequest,
) -> Result<Operation<Empty>, Error>
pub async fn delete_volume_attachment( &self, request: DeleteVolumeAttachmentRequest, ) -> Result<Operation<Empty>, Error>
Detaches a volume, which then is AVAILABLE again. The boot volume
can’t be detached. On a running instance the device is removed live;
if the guest doesn’t release it, the operation fails and the volume
stays attached. The operation is done once the volume is detached.
It answers with an operation to wait on, which has no result: Operation::wait returns once the change is done.