ImageService
Section titled “ImageService”class ImageService()Image build/pull/list namespace.
ImageService.__init__
Section titled “ImageService.__init__”def __init__(impl: AsyncImageService, bridge: SyncBridge) -> NoneImageService.build
Section titled “ImageService.build”def build(builder: ImageBuilder, /, *, name: Optional[str] = None, idle_expiry_seconds: Optional[int] = None, region: Optional[str] = None, cpu_arch: Optional[str] = None, timeout: Optional[float] = None) -> ImageBuild (or import) an image from an ImageBuilder declaration.
ImageService.delete
Section titled “ImageService.delete”def delete(image_id: str) -> NoneImageService.follow_build_logs
Section titled “ImageService.follow_build_logs”def follow_build_logs(image_id: str, *, on_logs: _LogsCallback, on_event: Optional[_EventCallback] = None, cursor: Optional[str] = None, timeout: Optional[float] = None) -> BuildLogFollowResultObserve a submitted image build. Timeout is in seconds, not execution TTL.
ImageService.get
Section titled “ImageService.get”def get(image_id: str, *, wait: Literal['ready'] | None = None, timeout: Optional[float] = None) -> ImageImageService.iter
Section titled “ImageService.iter”def iter(*, anonymous: bool = False, sandbox_id: Optional[str] = None, name: Optional[str] = None, cursor: Optional[str] = None, limit: Optional[int] = None, platform: Optional[Literal['true', 'false', 'any']] = None) -> Iterator[Image]ImageService.list
Section titled “ImageService.list”def list(*, anonymous: bool = False, sandbox_id: Optional[str] = None, name: Optional[str] = None, cursor: Optional[str] = None, limit: Optional[int] = None, platform: Optional[Literal['true', 'false', 'any']] = None) -> ListResult[Image]List images (GET /images).
ImageService.promote
Section titled “ImageService.promote”def promote(image_id: str, name: str) -> ImageName an ANONYMOUS image, making it permanent (PATCH /images/{id}).
ImageService.pull
Section titled “ImageService.pull”def pull(image: str, *, name: Optional[str] = None, region: Optional[str] = None, timeout: Optional[float] = None) -> ImageAsyncImageService
Section titled “AsyncImageService”class AsyncImageService()Image build/pull/list namespace.
AsyncImageService.__init__
Section titled “AsyncImageService.__init__”def __init__(transport: AsyncTransport) -> NoneAsyncImageService.follow_build_logs
Section titled “AsyncImageService.follow_build_logs”async def follow_build_logs(image_id: str, *, on_logs: _LogsCallback, on_event: Optional[_EventCallback] = None, cursor: Optional[str] = None, timeout: Optional[float] = None) -> BuildLogFollowResultObserve a submitted image build. Timeout is in seconds, not execution TTL.
AsyncImageService.build
Section titled “AsyncImageService.build”async def build(builder: ImageBuilder, /, *, name: Optional[str] = None, idle_expiry_seconds: Optional[int] = None, region: Optional[str] = None, cpu_arch: Optional[str] = None, timeout: Optional[float] = None) -> ImageBuild (or import) an image from an ImageBuilder declaration.
The builder is the only way to say WHAT to build — ImageBuilder. from_dockerfile(...), .from_registry(...), or the fluent
.run_commands / .env / .workdir chain — in both SDKs
(parity with TypeScript’s images.build(builder, options)). name
omitted makes the image anonymous; idle_expiry_seconds is then its
idle-retention window — deleted once that long has passed without a
sandbox being created from it (every create restarts the clock);
omitted ⇒ the server maximum (DAYTONA_ANON_IMAGE_MAX_IDLE).
AsyncImageService.pull
Section titled “AsyncImageService.pull”async def pull(image: str, *, name: Optional[str] = None, region: Optional[str] = None, timeout: Optional[float] = None) -> ImageAsyncImageService.get
Section titled “AsyncImageService.get”async def get(image_id: str, *, wait: Literal['ready'] | None = None, timeout: Optional[float] = None) -> ImageAsyncImageService.promote
Section titled “AsyncImageService.promote”async def promote(image_id: str, name: str) -> ImageName an ANONYMOUS image, making it permanent (PATCH /images/{id}).
Promotion only: an image that already has a name answers 409 — renaming a named image is not offered (sandboxes reference images by id, so a rename would silently relabel every sandbox created from it).
AsyncImageService.delete
Section titled “AsyncImageService.delete”async def delete(image_id: str) -> NoneAsyncImageService.list
Section titled “AsyncImageService.list”async def list(*, anonymous: bool = False, sandbox_id: Optional[str] = None, name: Optional[str] = None, cursor: Optional[str] = None, limit: Optional[int] = None, platform: Optional[Literal['true', 'false', 'any']] = None) -> ListResult[Image]List images (GET /images).
platform picks the platform images the operator publishes for every
project: "false" (the server default) lists the project’s own
images, "true" lists only the non-deprecated platform images (the
default one carries default=True), and "any" lists both.
AsyncImageService.iter
Section titled “AsyncImageService.iter”async def iter(*, anonymous: bool = False, sandbox_id: Optional[str] = None, name: Optional[str] = None, cursor: Optional[str] = None, limit: Optional[int] = None, platform: Optional[Literal['true', 'false', 'any']] = None) -> AsyncIterator[Image]BuildLogFollowResult
Section titled “BuildLogFollowResult”@dataclass(frozen=True)class BuildLogFollowResult()Attributes:
statusstrreasonBuildLogDoneReasonoutput_completeboolcursorstr | None = Noneraw_reasonstr | None = None
BuildLogStateEvent
Section titled “BuildLogStateEvent”@dataclass(frozen=True)class BuildLogStateEvent()Attributes:
statusstrerrorstr | None = Nonedeadline_atstr | None = NonetypeLiteral[‘state’] = ‘state’
BuildLogChunkEvent
Section titled “BuildLogChunkEvent”@dataclass(frozen=True)class BuildLogChunkEvent()Attributes:
data_base64strstart_offsetstrnext_offsetstrcursorstrtypeLiteral[‘log’] = ‘log’
BuildLogGapEvent
Section titled “BuildLogGapEvent”@dataclass(frozen=True)class BuildLogGapEvent()Attributes:
requested_offsetstrfirst_available_offsetstrdropped_bytesstrcursorstrreasonBuildLogGapReason = ‘truncated’typeLiteral[‘gap’] = ‘gap’raw_reasonstr | None = None
BuildLogUnavailableEvent
Section titled “BuildLogUnavailableEvent”@dataclass(frozen=True)class BuildLogUnavailableEvent()Attributes:
reasonstrtypeLiteral[‘unavailable’] = ‘unavailable’
BuildLogSourceChangedEvent
Section titled “BuildLogSourceChangedEvent”@dataclass(frozen=True)class BuildLogSourceChangedEvent()Attributes:
reasonstrtypeLiteral[‘source_changed’] = ‘source_changed’
BuildLogDoneEvent
Section titled “BuildLogDoneEvent”@dataclass(frozen=True)class BuildLogDoneEvent()Attributes:
resultBuildLogFollowResulttypeLiteral[‘done’] = ‘done’
BuildLogErrorEvent
Section titled “BuildLogErrorEvent”@dataclass(frozen=True)class BuildLogErrorEvent()Attributes:
errorstrcodestrretryablebooltrace_idstr | None = NonetypeLiteral[‘error’] = ‘error’
ImageBuilder
Section titled “ImageBuilder”@dataclass(frozen=True, slots=True)class ImageBuilder()ImageBuilder.from_registry
Section titled “ImageBuilder.from_registry”@classmethoddef from_registry(ref: str) -> SelfImageBuilder.from_dockerfile
Section titled “ImageBuilder.from_dockerfile”@classmethoddef from_dockerfile(content: str) -> SelfImageBuilder.pip_install
Section titled “ImageBuilder.pip_install”def pip_install(*packages: str) -> SelfImageBuilder.run_commands
Section titled “ImageBuilder.run_commands”def run_commands(*commands: str) -> SelfImageBuilder.env
Section titled “ImageBuilder.env”@overloaddef env(name: str, value: str, /) -> SelfImageBuilder.env
Section titled “ImageBuilder.env”@overloaddef env(values: Mapping[str, str], /) -> SelfImageBuilder.workdir
Section titled “ImageBuilder.workdir”def workdir(path: str, /) -> SelfImageBuilder.build_request_source
Section titled “ImageBuilder.build_request_source”def build_request_source() -> tuple[dict[str, str] | None, str | None]ImageBuilder.render_dockerfile
Section titled “ImageBuilder.render_dockerfile”def render_dockerfile() -> strRender the Dockerfile the build request carries.
Byte-identical to TypeScript’s ImageBuilder.toDockerfile() for the
same builder: one line per layer, a single trailing newline (a POSIX
text file), no trailing whitespace. The text is the build’s content
key, so the two SDKs must agree to the byte or the same build would
dedupe differently across them.
ImageRef
Section titled “ImageRef”@dataclass(frozen=True, slots=True)class ImageRef()Attributes:
idstrnameOptional[str] = None
@dataclass(frozen=True, slots=True)class Image()Attributes:
idstrnameOptional[str]statusstrregionstranonymousboolretentionArtifactRetentionvar_classstravailable_inlist[str]originstrcreated_atOptional[str] = NoneerrorOptional[str] = Noneexpires_atOptional[str] = NonesourceOptional[ImageSource] = NonebytesOptional[int] = Nonelayer_countOptional[int] = NonecursorOptional[str] = Noneformat_versionOptional[int] = Noneformat_outdatedbool = Falseplatformbool = Falsedefaultbool = Falsedeprecatedbool = Falseupdated_atOptional[str] = Nonedisk_mibOptional[int] = Noneraw_retentionstr = field(default=”, kw_only=True)
BuildLogDoneReason
Section titled “BuildLogDoneReason”BuildLogDoneReason = Literal['terminal', 'deadline', 'not_applicable', 'resource_deleted', 'unknown']BuildLogGapReason
Section titled “BuildLogGapReason”BuildLogGapReason = Literal['truncated', 'unknown']BuildLogEvent
Section titled “BuildLogEvent”BuildLogEvent = BuildLogStateEvent | BuildLogChunkEvent | BuildLogGapEvent | BuildLogUnavailableEvent | BuildLogSourceChangedEvent | BuildLogDoneEvent | BuildLogErrorEventImageBuildResponse
Section titled “ImageBuildResponse”ImageBuildResponse = _gen.api.AsyncOperationImageJob
Section titled “ImageJob”ImageJob = ImageBuildResponseImageDto
Section titled “ImageDto”ImageDto = _gen.api.ImageListItemArtifactRetention
Section titled “ArtifactRetention”ArtifactRetention = Literal['permanent', 'idle', 'unknown']ImageSource
Section titled “ImageSource”ImageSource = Union[RegistryImageSource, DockerfileImageSource, NamedImageSource, ManifestImageSource]