pub struct ImageClient { /* private fields */ }Expand description
Calls ImageService.
Images: what an instance’s boot volume is created from, in one zone. A
project creates its own from protected snapshots in the zone; the
platform’s public images are in PublicImageService.
Implementations§
Source§impl ImageClient
impl ImageClient
Sourcepub fn new(client: &Client) -> Self
pub fn new(client: &Client) -> Self
Returns a client of ImageService 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 fn with_options(&self, options: CallOptions) -> Self
pub fn with_options(&self, options: CallOptions) -> Self
The same client, whose calls are sent as options says instead of as the Client’s settings do, such as a mutation that must not be sent twice: .with_options(CallOptions::new().max_attempts(1)). See CallOptions.
Sourcepub async fn get_image(&self, request: GetImageRequest) -> Result<Image, Error>
pub async fn get_image(&self, request: GetImageRequest) -> Result<Image, Error>
Returns one of the project’s own images.
Sourcepub async fn list_images(
&self,
request: ListImagesRequest,
) -> Result<ListImagesResponse, Error>
pub async fn list_images( &self, request: ListImagesRequest, ) -> Result<ListImagesResponse, Error>
Lists the project’s own images in a zone, oldest first. The public
images are listed by ListPublicImages.
Sourcepub fn all_images(&self, request: ListImagesRequest) -> Pages<Image>
pub fn all_images(&self, request: ListImagesRequest) -> Pages<Image>
Returns everything list_images 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_image(
&self,
request: CreateImageRequest,
) -> Result<Image, Error>
pub async fn create_image( &self, request: CreateImageRequest, ) -> Result<Image, Error>
Creates an image from the project’s protected snapshots in the zone. The snapshots can’t be unprotected while the image exists.
Sourcepub async fn update_image(
&self,
request: UpdateImageRequest,
) -> Result<Image, Error>
pub async fn update_image( &self, request: UpdateImageRequest, ) -> Result<Image, Error>
Changes an image’s description or tags.
Sourcepub async fn delete_image(
&self,
request: DeleteImageRequest,
) -> Result<Empty, Error>
pub async fn delete_image( &self, request: DeleteImageRequest, ) -> Result<Empty, Error>
Deletes an image. Instances launched from it are unaffected.