Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions porter_sandbox/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class ReadinessResponse(BaseModel):


class SandboxDomainSpec(BaseModel):
domain: str | None = Field(default=None, description="Fully qualified hostname for the sandbox, one label under the\ntarget ingress's domain. Unlike name it need not be unique, so\nsuccessive sandboxes can reuse one hostname (only one may be live\nat a time). Defaults to <name>.<ingress domain>, then\n<id>.<ingress domain>, when omitted.\n")
domain: str | None = Field(default=None, description="Fully qualified hostname for the sandbox, one label under the\ntarget ingress's domain. Unlike name it need not be unique, so\nsuccessive sandboxes can reuse one hostname (only one may be live\nat a time). Defaults to <name>.<ingress domain>, then\n<id>.<ingress domain>, when omitted. Not available on Porter-hosted\nsandboxes, which are always served at\n<name>-<8 random characters>.<ingress domain>.\n")
visibility: SandboxDomainSpecVisibility | None = Field(default=None, description="Which sandbox ingress serves the domain when the cluster has both a\npublic and a private one. Omit to default to whichever is\nconfigured, public winning; with neither configured, the sandbox is\nserved at its cluster-internal address only. Rejected when the\nsandbox exposes a port but the requested ingress is not configured\non the cluster.\n")


Expand Down Expand Up @@ -165,7 +165,7 @@ class SandboxResourcesSpec(BaseModel):


class SandboxSpec(BaseModel):
image: str = Field(description="Container image to run. Empty when snapshot_id is set, since the\nsnapshot is the image.\n")
image: str | None = Field(default=None, description="Container image to run. Empty when snapshot_id is set, since the\nsnapshot is the image. When both are omitted, the sandbox runs\npython:3.14-slim, and with no command or args it runs sleep infinity.\n")
snapshot_id: str | None = Field(default=None, description="Start the sandbox from this snapshot's filesystem instead of an image,\nso image must be left unset. The snapshot carries no command or volumes:\nan omitted command runs the base image's, and the sandbox mounts only\nthe volumes this request asks for.\n")
name: str | None = Field(default=None, description="Sandbox name, unique within the cluster. Must be a valid DNS label\n(lowercase alphanumeric and dashes). Defaults to the sandbox's id\nwhen omitted.\n")
tags: dict[str, str] | None = Field(default=None, description="Arbitrary key/value labels for identifying and filtering sandboxes")
Expand Down
4 changes: 2 additions & 2 deletions porter_sandbox/sandboxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def raw(self) -> SandboxesResource:

def create(
self,
image: str,
*,
image: str | None = None,
snapshot_id: str | None = None,
name: str | None = None,
tags: dict[str, str] | None = None,
Expand Down Expand Up @@ -98,8 +98,8 @@ def raw(self) -> AsyncSandboxesResource:

async def create(
self,
image: str,
*,
image: str | None = None,
snapshot_id: str | None = None,
name: str | None = None,
tags: dict[str, str] | None = None,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "porter-sandbox"
version = "0.1.68"
version = "0.1.71"
description = "Python SDK for the Porter Sandbox API"
readme = "README.md"
requires-python = ">=3.10"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_models_round_trip.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def test_sandbox_resources_spec_round_trip() -> None:


def test_sandbox_spec_round_trip() -> None:
instance = SandboxSpec(image="x")
instance = SandboxSpec()
serialized = instance.model_dump(by_alias=True, exclude_none=True)
round_tripped = SandboxSpec.model_validate(serialized)
assert round_tripped.model_dump(by_alias=True, exclude_none=True) == serialized
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading