pub struct Images {
pub client: Client,
}
Fields§
§client: Client
Implementations§
Source§impl Images
impl Images
Sourcepub async fn view(&self, id: &str) -> Result<Image>
pub async fn view(&self, id: &str) -> Result<Image>
Fetch an image by id.
This function performs a GET
to the /by-id/images/{id}
endpoint.
Parameters:
id: &str
Sourcepub async fn get_page(
&self,
limit: u32,
organization_name: &str,
page_token: &str,
project_name: &str,
sort_by: NameSortMode,
) -> Result<Vec<Image>>
pub async fn get_page( &self, limit: u32, organization_name: &str, page_token: &str, project_name: &str, sort_by: NameSortMode, ) -> Result<Vec<Image>>
List images.
This function performs a GET
to the /organizations/{organization_name}/projects/{project_name}/images
endpoint.
List images in a project. The images are returned sorted by creation date, with the most recent images appearing first.
Parameters:
limit: u32
– Maximum number of items returned by a single call.page_token: &str
– Token returned by previous call to retrieve the subsequent page.sort_by: crate::types::NameSortMode
– Supported set of sort modes for scanning by name only
Currently, we only support scanning in ascending order.
organization_name: &str
– Names must begin with a lower case ASCII letter, be composed exclusively of lowercase ASCII, uppercase ASCII, numbers, and ‘-’, and may not end with a ‘-’. Names cannot be a UUID though they may contain a UUID.project_name: &str
– Names must begin with a lower case ASCII letter, be composed exclusively of lowercase ASCII, uppercase ASCII, numbers, and ‘-’, and may not end with a ‘-’. Names cannot be a UUID though they may contain a UUID.
Sourcepub async fn get_all(
&self,
organization_name: &str,
project_name: &str,
sort_by: NameSortMode,
) -> Result<Vec<Image>>
pub async fn get_all( &self, organization_name: &str, project_name: &str, sort_by: NameSortMode, ) -> Result<Vec<Image>>
List images.
This function performs a GET
to the /organizations/{organization_name}/projects/{project_name}/images
endpoint.
As opposed to get
, this function returns all the pages of the request at once.
List images in a project. The images are returned sorted by creation date, with the most recent images appearing first.
Sourcepub async fn post(
&self,
organization_name: &str,
project_name: &str,
body: &ImageCreate,
) -> Result<Image>
pub async fn post( &self, organization_name: &str, project_name: &str, body: &ImageCreate, ) -> Result<Image>
Create an image.
This function performs a POST
to the /organizations/{organization_name}/projects/{project_name}/images
endpoint.
Create a new image in a project.
Parameters:
organization_name: &str
– Names must begin with a lower case ASCII letter, be composed exclusively of lowercase ASCII, uppercase ASCII, numbers, and ‘-’, and may not end with a ‘-’. Names cannot be a UUID though they may contain a UUID.project_name: &str
– Names must begin with a lower case ASCII letter, be composed exclusively of lowercase ASCII, uppercase ASCII, numbers, and ‘-’, and may not end with a ‘-’. Names cannot be a UUID though they may contain a UUID.
Sourcepub async fn get(
&self,
image_name: &str,
organization_name: &str,
project_name: &str,
) -> Result<Image>
pub async fn get( &self, image_name: &str, organization_name: &str, project_name: &str, ) -> Result<Image>
Fetch an image.
This function performs a GET
to the /organizations/{organization_name}/projects/{project_name}/images/{image_name}
endpoint.
Fetch the details for a specific image in a project.
Parameters:
image_name: &str
– Names must begin with a lower case ASCII letter, be composed exclusively of lowercase ASCII, uppercase ASCII, numbers, and ‘-’, and may not end with a ‘-’. Names cannot be a UUID though they may contain a UUID.organization_name: &str
– Names must begin with a lower case ASCII letter, be composed exclusively of lowercase ASCII, uppercase ASCII, numbers, and ‘-’, and may not end with a ‘-’. Names cannot be a UUID though they may contain a UUID.project_name: &str
– Names must begin with a lower case ASCII letter, be composed exclusively of lowercase ASCII, uppercase ASCII, numbers, and ‘-’, and may not end with a ‘-’. Names cannot be a UUID though they may contain a UUID.
Sourcepub async fn delete(
&self,
image_name: &str,
organization_name: &str,
project_name: &str,
) -> Result<()>
pub async fn delete( &self, image_name: &str, organization_name: &str, project_name: &str, ) -> Result<()>
Delete an image.
This function performs a DELETE
to the /organizations/{organization_name}/projects/{project_name}/images/{image_name}
endpoint.
Permanently delete an image from a project. This operation cannot be undone. Any instances in the project using the image will continue to run, however new instances can not be created with this image.
Parameters:
image_name: &str
– Names must begin with a lower case ASCII letter, be composed exclusively of lowercase ASCII, uppercase ASCII, numbers, and ‘-’, and may not end with a ‘-’. Names cannot be a UUID though they may contain a UUID.organization_name: &str
– Names must begin with a lower case ASCII letter, be composed exclusively of lowercase ASCII, uppercase ASCII, numbers, and ‘-’, and may not end with a ‘-’. Names cannot be a UUID though they may contain a UUID.project_name: &str
– Names must begin with a lower case ASCII letter, be composed exclusively of lowercase ASCII, uppercase ASCII, numbers, and ‘-’, and may not end with a ‘-’. Names cannot be a UUID though they may contain a UUID.