Skip to main content

class ImagesManager

class contree_sdk.sdk.managers.images.ImagesManager(client)

Methods

__aiter__()

async def __aiter__()

__call__()

async def __call__(number, kind, tagged, since, until) -> list[TypeVar(_ImageT, bound= _ContreeImageBase)]
Fetch a list of images with optional filters.
number
int | None
default:"100"
Maximum number of images to return. None returns all.
kind
ImageKind | None
default:"None"
Filter by image kind.
tagged
bool
default:"False"
If True, return only tagged images.
since
datetime | timedelta | None
default:"None"
Return images created after this time. Accepts datetime or timedelta relative to now.
until
datetime | timedelta | None
default:"None"
Return images created before this time. Accepts datetime or timedelta relative to now.
returns
list[TypeVar(_ImageT, bound= _ContreeImageBase)]
List of images matching the given filters.

docker()

async def docker(ref, *, tag, username, password, timeout) -> TypeVar(_ImageT, bound= _ContreeImageBase)
Resolve an image by tag, falling back to import if not found.Derives the target tag from the tag parameter or from the reference itself, then tries to find an existing image with that tag. If the image does not exist, triggers an import and returns the result.
ref
str | OCIReference | UUID
required
str | OCIReference | UUIDUUID, OCI reference string, or OCIReference of the image.
tag
str | None
default:"None"
Tag override; if provided, replaces the tag from the reference.
username
str | None
default:"None"
Registry username for authenticated imports.
password
str | None
default:"None"
Registry password for authenticated imports.
timeout
float | None
default:"None"
Maximum seconds to wait for the import operation.
returns
TypeVar(_ImageT, bound= _ContreeImageBase)
Resolved or imported image object.
raises
NotFoundError – If ref is a UUID and the image does not exist.

import_from()

async def import_from(image, *, tag, username, password, timeout) -> TypeVar(_ImageT, bound= _ContreeImageBase)
Import an image from an external registry into Contree.
image
str | OCIReference
required
str | OCIReferenceOCI reference string or OCIReference pointing to the source image.
tag
str | None
default:"None"
Tag to assign to the imported image. Defaults to the tag in the reference.
username
str | None
default:"None"
Registry username for private registries.
password
str | None
default:"None"
Registry password for private registries.
timeout
float | None
default:"None"
Maximum seconds to wait for the import operation.
returns
TypeVar(_ImageT, bound= _ContreeImageBase)
Imported image object.
raises
ValueError – If image is a UUID or credentials are incomplete.
raises
FailedOperationError – If the import operation completes without returning an image.

oci()

async def oci(ref, *, tag, username, password, timeout) -> TypeVar(_ImageT, bound= _ContreeImageBase)
Resolve an image by tag, falling back to import if not found.Derives the target tag from the tag parameter or from the reference itself, then tries to find an existing image with that tag. If the image does not exist, triggers an import and returns the result.
ref
str | OCIReference | UUID
required
str | OCIReference | UUIDUUID, OCI reference string, or OCIReference of the image.
tag
str | None
default:"None"
Tag override; if provided, replaces the tag from the reference.
username
str | None
default:"None"
Registry username for authenticated imports.
password
str | None
default:"None"
Registry password for authenticated imports.
timeout
float | None
default:"None"
Maximum seconds to wait for the import operation.
returns
TypeVar(_ImageT, bound= _ContreeImageBase)
Resolved or imported image object.
raises
NotFoundError – If ref is a UUID and the image does not exist.

podman()

async def podman(ref, *, tag, username, password, timeout) -> TypeVar(_ImageT, bound= _ContreeImageBase)
Resolve an image by tag, falling back to import if not found.Derives the target tag from the tag parameter or from the reference itself, then tries to find an existing image with that tag. If the image does not exist, triggers an import and returns the result.
ref
str | OCIReference | UUID
required
str | OCIReference | UUIDUUID, OCI reference string, or OCIReference of the image.
tag
str | None
default:"None"
Tag override; if provided, replaces the tag from the reference.
username
str | None
default:"None"
Registry username for authenticated imports.
password
str | None
default:"None"
Registry password for authenticated imports.
timeout
float | None
default:"None"
Maximum seconds to wait for the import operation.
returns
TypeVar(_ImageT, bound= _ContreeImageBase)
Resolved or imported image object.
raises
NotFoundError – If ref is a UUID and the image does not exist.

pull()

async def pull(url_or_tag_or_uuid, *, new_tag, username, password, timeout) -> ContreeImage
url_or_tag_or_uuid
required
new_tag
default:"None"
username
default:"None"
password
default:"None"
timeout
default:"None"
returns
ContreeImage

pull_by_oci()

async def pull_by_oci(ref, *, tag, username, password, timeout) -> TypeVar(_ImageT, bound= _ContreeImageBase)
Resolve an image by tag, falling back to import if not found.Derives the target tag from the tag parameter or from the reference itself, then tries to find an existing image with that tag. If the image does not exist, triggers an import and returns the result.
ref
str | OCIReference | UUID
required
str | OCIReference | UUIDUUID, OCI reference string, or OCIReference of the image.
tag
str | None
default:"None"
Tag override; if provided, replaces the tag from the reference.
username
str | None
default:"None"
Registry username for authenticated imports.
password
str | None
default:"None"
Registry password for authenticated imports.
timeout
float | None
default:"None"
Maximum seconds to wait for the import operation.
returns
TypeVar(_ImageT, bound= _ContreeImageBase)
Resolved or imported image object.
raises
NotFoundError – If ref is a UUID and the image does not exist.

use()

async def use(ref, strict) -> TypeVar(_ImageT, bound= _ContreeImageBase)
Resolve a reference to an image object without importing.
ref
str | UUID | OCIReference
required
str | UUID | OCIReferenceImage identifier — UUID, OCI reference string, or OCIReference object.
strict
bool
default:"False"
If True, verify the image exists by fetching it from the API.
returns
TypeVar(_ImageT, bound= _ContreeImageBase)
Image object corresponding to the given reference.

class ImagesManagerSync

class contree_sdk.sdk.managers.images.ImagesManagerSync(client)

Methods

__call__()

def __call__(number, kind, tagged, since, until) -> list[TypeVar(_ImageT, bound= _ContreeImageBase)]
Fetch a list of images with optional filters.
number
int | None
default:"100"
Maximum number of images to return. None returns all.
kind
ImageKind | None
default:"None"
Filter by image kind.
tagged
bool
default:"False"
If True, return only tagged images.
since
datetime | timedelta | None
default:"None"
Return images created after this time. Accepts datetime or timedelta relative to now.
until
datetime | timedelta | None
default:"None"
Return images created before this time. Accepts datetime or timedelta relative to now.
returns
list[TypeVar(_ImageT, bound= _ContreeImageBase)]
List of images matching the given filters.

__iter__()

def __iter__()

docker()

def docker(ref, *, tag, username, password, timeout) -> TypeVar(_ImageT, bound= _ContreeImageBase)
Resolve an image by tag, falling back to import if not found.Derives the target tag from the tag parameter or from the reference itself, then tries to find an existing image with that tag. If the image does not exist, triggers an import and returns the result.
ref
str | OCIReference | UUID
required
str | OCIReference | UUIDUUID, OCI reference string, or OCIReference of the image.
tag
str | None
default:"None"
Tag override; if provided, replaces the tag from the reference.
username
str | None
default:"None"
Registry username for authenticated imports.
password
str | None
default:"None"
Registry password for authenticated imports.
timeout
float | None
default:"None"
Maximum seconds to wait for the import operation.
returns
TypeVar(_ImageT, bound= _ContreeImageBase)
Resolved or imported image object.
raises
NotFoundError – If ref is a UUID and the image does not exist.

import_from()

def import_from(image, *, tag, username, password, timeout) -> TypeVar(_ImageT, bound= _ContreeImageBase)
Import an image from an external registry into Contree.
image
str | OCIReference
required
str | OCIReferenceOCI reference string or OCIReference pointing to the source image.
tag
str | None
default:"None"
Tag to assign to the imported image. Defaults to the tag in the reference.
username
str | None
default:"None"
Registry username for private registries.
password
str | None
default:"None"
Registry password for private registries.
timeout
float | None
default:"None"
Maximum seconds to wait for the import operation.
returns
TypeVar(_ImageT, bound= _ContreeImageBase)
Imported image object.
raises
ValueError – If image is a UUID or credentials are incomplete.
raises
FailedOperationError – If the import operation completes without returning an image.

oci()

def oci(ref, *, tag, username, password, timeout) -> TypeVar(_ImageT, bound= _ContreeImageBase)
Resolve an image by tag, falling back to import if not found.Derives the target tag from the tag parameter or from the reference itself, then tries to find an existing image with that tag. If the image does not exist, triggers an import and returns the result.
ref
str | OCIReference | UUID
required
str | OCIReference | UUIDUUID, OCI reference string, or OCIReference of the image.
tag
str | None
default:"None"
Tag override; if provided, replaces the tag from the reference.
username
str | None
default:"None"
Registry username for authenticated imports.
password
str | None
default:"None"
Registry password for authenticated imports.
timeout
float | None
default:"None"
Maximum seconds to wait for the import operation.
returns
TypeVar(_ImageT, bound= _ContreeImageBase)
Resolved or imported image object.
raises
NotFoundError – If ref is a UUID and the image does not exist.

podman()

def podman(ref, *, tag, username, password, timeout) -> TypeVar(_ImageT, bound= _ContreeImageBase)
Resolve an image by tag, falling back to import if not found.Derives the target tag from the tag parameter or from the reference itself, then tries to find an existing image with that tag. If the image does not exist, triggers an import and returns the result.
ref
str | OCIReference | UUID
required
str | OCIReference | UUIDUUID, OCI reference string, or OCIReference of the image.
tag
str | None
default:"None"
Tag override; if provided, replaces the tag from the reference.
username
str | None
default:"None"
Registry username for authenticated imports.
password
str | None
default:"None"
Registry password for authenticated imports.
timeout
float | None
default:"None"
Maximum seconds to wait for the import operation.
returns
TypeVar(_ImageT, bound= _ContreeImageBase)
Resolved or imported image object.
raises
NotFoundError – If ref is a UUID and the image does not exist.

pull()

def pull(url_or_tag_or_uuid, *, new_tag, username, password, timeout) -> ContreeImageSync
url_or_tag_or_uuid
required
new_tag
default:"None"
username
default:"None"
password
default:"None"
timeout
default:"None"
returns
ContreeImageSync

pull_by_oci()

def pull_by_oci(ref, *, tag, username, password, timeout) -> TypeVar(_ImageT, bound= _ContreeImageBase)
Resolve an image by tag, falling back to import if not found.Derives the target tag from the tag parameter or from the reference itself, then tries to find an existing image with that tag. If the image does not exist, triggers an import and returns the result.
ref
str | OCIReference | UUID
required
str | OCIReference | UUIDUUID, OCI reference string, or OCIReference of the image.
tag
str | None
default:"None"
Tag override; if provided, replaces the tag from the reference.
username
str | None
default:"None"
Registry username for authenticated imports.
password
str | None
default:"None"
Registry password for authenticated imports.
timeout
float | None
default:"None"
Maximum seconds to wait for the import operation.
returns
TypeVar(_ImageT, bound= _ContreeImageBase)
Resolved or imported image object.
raises
NotFoundError – If ref is a UUID and the image does not exist.

use()

def use(ref, strict) -> TypeVar(_ImageT, bound= _ContreeImageBase)
Resolve a reference to an image object without importing.
ref
str | UUID | OCIReference
required
str | UUID | OCIReferenceImage identifier — UUID, OCI reference string, or OCIReference object.
strict
bool
default:"False"
If True, verify the image exists by fetching it from the API.
returns
TypeVar(_ImageT, bound= _ContreeImageBase)
Image object corresponding to the given reference.