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]
static from_glance_image(glance_image) Image[source]

Convert a glance image object to an Image object.

Parameters:

glance_image – The glance image object.

Returns:

The Image object.

Return type:

Image

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:

Image

Raises:
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:

str

Raises:

CHIValueError – If the image could not be found.

chi.image.list_images(is_chameleon_supported: bool | None = False) List[Image][source]

List all images available at the current site, filtered by support status.

Parameters:

is_chameleon_supported (bool, optional) – Filter images by Chameleon support. Defaults to True.

Returns:

A list of Image objects.

Return type:

List[Image]