chi.image¶
The chi.image module exposes a functional interface for interacting with
disk images.
- class chi.image.Image(uuid: str, created_at: datetime.datetime, is_chameleon_supported: bool, name: str)[source]¶
- chi.image.get_image(name: str) Image[source]¶
Get an image by its name.
- Parameters:
name (str) – The name of the image.
- Returns:
The Image object matching the name.
- Return type:
- Raises:
CHIValueError – If no image is found with the given name.
ResourceError – If multiple images are found with the same name.
- chi.image.get_image_id(name)[source]¶
Look up an image’s ID from its name.
- Parameters:
name (str) – The name of the image.
- Returns:
The ID of the found image.
- Raises:
ValueError – If the image could not be found, or if multiple images matched the name.
- chi.image.get_image_name(id: str) str[source]¶
Look up an image’s name from its ID.
- Parameters:
id (str) – The ID of the image.
- Returns:
The name of the found image.
- Return type:
- Raises:
CHIValueError – If the image could not be found.