Co-authored-by: Tasnim Kabir Sadik <tksadik92@gmail.com>
Reviewed-on: wrenn/python-sdk#13
This commit is contained in:
2026-05-22 23:01:46 +00:00
parent 2b10fde45b
commit de72dfe9c8
8 changed files with 221 additions and 82 deletions

View File

@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: openapi.yaml
# timestamp: 2026-05-19T08:54:50+00:00
# timestamp: 2026-05-22T19:20:45+00:00
from __future__ import annotations
from pydantic import AwareDatetime, BaseModel, EmailStr, Field
@ -65,7 +65,7 @@ class APIKeyResponse(BaseModel):
class CreateCapsuleRequest(BaseModel):
template: str | None = "minimal"
template: str | None = "minimal-ubuntu"
vcpus: int | None = 1
memory_mb: int | None = 512
disk_size_mb: Annotated[
@ -148,6 +148,7 @@ class Status(StrEnum):
running = "running"
pausing = "pausing"
paused = "paused"
snapshotting = "snapshotting"
resuming = "resuming"
stopping = "stopping"
hibernated = "hibernated"
@ -203,12 +204,46 @@ class Template(BaseModel):
platform: Annotated[
bool | None,
Field(
description="True when the template is platform-managed (visible to all teams,\ne.g. the built-in `minimal` rootfs). False for team-owned\nsnapshot templates.\n"
description="True when the template is platform-managed (visible to all teams,\ne.g. the built-in `minimal-ubuntu` rootfs). False for team-owned\nsnapshot templates.\n"
),
] = None
protected: Annotated[
bool | None,
Field(
description="True for built-in system base templates (minimal-ubuntu,\nminimal-alpine, minimal-arch, minimal-fedora). Protected templates\ncannot be deleted.\n"
),
] = None
metadata: dict[str, str] | None = None
class AdminTemplate(BaseModel):
"""
Template as returned by the admin templates list. Unlike `Template`
(the team-facing snapshot shape), this includes the owning `team_id`
and omits `platform`/`metadata`.
"""
name: str | None = None
type: Type | None = None
vcpus: int | None = None
memory_mb: int | None = None
size_bytes: int | None = None
team_id: Annotated[
str | None,
Field(
description="Owning team ID (formatted, e.g. `team-…`). Platform team for global templates."
),
] = None
created_at: AwareDatetime | None = None
protected: Annotated[
bool | None,
Field(
description="True for built-in system base templates (minimal-ubuntu,\nminimal-alpine, minimal-arch, minimal-fedora). Protected templates\ncannot be deleted.\n"
),
] = None
class ExecRequest(BaseModel):
cmd: str
args: list[str] | None = None
@ -296,7 +331,7 @@ class ListDirRequest(BaseModel):
] = 1
class Type1(StrEnum):
class Type2(StrEnum):
file = "file"
directory = "directory"
symlink = "symlink"
@ -305,7 +340,7 @@ class Type1(StrEnum):
class FileEntry(BaseModel):
name: str | None = None
path: str | None = None
type: Type1 | None = None
type: Type2 | None = None
size: int | None = None
mode: int | None = None
permissions: Annotated[
@ -333,7 +368,7 @@ class RemoveRequest(BaseModel):
path: Annotated[str, Field(description="Path to remove inside the capsule")]
class Type2(StrEnum):
class Type3(StrEnum):
"""
Host type. Regular hosts are shared; BYOC hosts belong to a team.
"""
@ -344,7 +379,7 @@ class Type2(StrEnum):
class CreateHostRequest(BaseModel):
type: Annotated[
Type2,
Type3,
Field(
description="Host type. Regular hosts are shared; BYOC hosts belong to a team."
),
@ -372,7 +407,7 @@ class RegisterHostRequest(BaseModel):
address: Annotated[str, Field(description="Host agent address (ip:port).")]
class Type3(StrEnum):
class Type4(StrEnum):
regular = "regular"
byoc = "byoc"
@ -387,7 +422,7 @@ class Status1(StrEnum):
class Host(BaseModel):
id: str | None = None
type: Type3 | None = None
type: Type4 | None = None
team_id: str | None = None
provider: str | None = None
availability_zone: str | None = None
@ -678,14 +713,14 @@ class Resource(BaseModel):
type: str | None = None
class Type4(StrEnum):
class Type5(StrEnum):
user = "user"
api_key = "api_key"
system = "system"
class Actor(BaseModel):
type: Type4 | None = None
type: Type5 | None = None
id: str | None = None
name: str | None = None