Skip to main content

Image

The Image class provides an interface to interact with OpenStack images, allowing you to retrieve information about virtual machine images and the servers using them.

Constructor

Image(image_id=None, name=None, cloud=Cloud())
Initialize an Image instance.
image_id
str
The unique identifier of the image. Either image_id or name should be provided.
name
str
The name of the image. Either image_id or name should be provided.
cloud
Cloud
default:"Cloud()"
The Cloud instance to use for OpenStack operations. Defaults to a new Cloud instance.

Properties

name

@property
def name(self) -> str
name
str
Returns the name associated to this Image.

id

@property
def id(self) -> str
id
str
Returns the image_id associated to this Image.

servers

@property
def servers(self) -> EntityList
servers
EntityList
Returns all Servers using this Image.

Usage Example

from myos.image import Image

# Initialize image by name
image = Image(name="rocky-8-aqml")

# Access image properties
print(image.name)  # Get image name
print(image.id)    # Get image ID

# List servers using this image
for server in image.servers:
    print(server.id)

Build docs developers (and LLMs) love