Claims
Claim sandboxes from a cloud pool, keep them alive, release them, and sign service URLs.
Claim sandboxes from a cloud pool, keep them alive, release them, and sign service URLs.
A claim binds one sandbox of a pool to you until you release it or its TTL passes.
Python programs usually use the high-level API instead: Pool.claim.
Methods of Fleet.
Fleet.claim#Creates a claim without waiting.
async def claim(self, pool: str, name: Optional[str], ttl_seconds: Optional[int]) -> FleetClaim| Parameter | Type | Default |
|---|---|---|
pool | String | required |
name | Option<String> | required |
ttl_seconds | Option<u32> | required |
Returns FleetClaim · Async · Raises CuaError
Fleet.acquire#Claims a sandbox from a pool and waits for it to bind. A claim named
name that already exists is reattached.
async def acquire(self, pool: str, name: Optional[str], ttl_seconds: Optional[int]) -> FleetSandbox| Parameter | Type | Default |
|---|---|---|
pool | String | required |
name | Option<String> | required |
ttl_seconds | Option<u32> | required |
Returns FleetSandbox · Async · Raises CuaError
Fleet.acquire_with#Fleet.acquire with claim options, including a per-claim env
token (bounded wait for its delivery; ClaimSecretsNotDelivered
releases the claim).
async def acquire_with(self, pool: str, options: FleetClaimOptions) -> FleetSandbox| Parameter | Type | Default |
|---|---|---|
pool | String | required |
options | FleetClaimOptions | required |
Returns FleetSandbox · Async · Raises CuaError (ClaimSecretsNotDelivered)
Fleet.attach_claim#Waits for a named claim to bind.
async def attach_claim(self, namespace: str, name: str) -> FleetSandbox| Parameter | Type | Default |
|---|---|---|
namespace | String | required |
name | String | required |
Returns FleetSandbox · Async · Raises CuaError
Fleet.list_claims#Lists claims in a namespace.
async def list_claims(self, namespace: str) -> List[FleetClaim]| Parameter | Type | Default |
|---|---|---|
namespace | String | required |
Returns Vec<FleetClaim> · Async · Raises CuaError
Fleet.keep_alive#Extends a claim's lease; returns the RFC 3339 shutdown time.
async def keep_alive(self, namespace: str, name: str, seconds: int) -> str| Parameter | Type | Default |
|---|---|---|
namespace | String | required |
name | String | required |
seconds | u32 | required |
Returns String · Async · Raises CuaError
Fleet.release#Releases a claim (missing claims are fine).
async def release(self, namespace: str, name: str) -> None| Parameter | Type | Default |
|---|---|---|
namespace | String | required |
name | String | required |
Async · Raises CuaError
Fleet.service_url#The gateway URL of a sandbox service (needs the Fleet bearer).
def service_url(self, sandbox: FleetSandbox, service: str) -> str| Parameter | Type | Default |
|---|---|---|
sandbox | FleetSandbox | required |
service | String | required |
Returns String · Raises CuaError
Fleet.create_signed_service_url#Mints a signed, shareable service URL.
async def create_signed_service_url(self, sandbox: FleetSandbox, service: str, label: Optional[str], expires_in_seconds: int) -> FleetSignedUrl| Parameter | Type | Default |
|---|---|---|
sandbox | FleetSandbox | required |
service | String | required |
label | Option<String> | required |
expires_in_seconds | u32 | required |
Returns FleetSignedUrl · Async · Raises CuaError
FleetClaim record#A claim.
Returned by Fleet.claim, Fleet.list_claims.
| Field | Type | Default | Description |
|---|---|---|---|
name | String | Claim name. | |
namespace | String | Namespace (the pool's). | |
json | String | The resource as JSON. |
FleetClaimOptions record#Claim options for Fleet.acquire_with.
| Field | Type | Default | Description |
|---|---|---|---|
name | Option<String> | None | Claim name; an existing claim with it is reattached. |
ttl_seconds / ttlSeconds | Option<u32> | None | Claim TTL (seconds). |
claim_token / claimToken | Option<String> | None | Per-claim env token (see fleet_generate_claim_token); the pool's spec must set claim_secrets. Acquire waits (at most 90 s) until the sandbox has it, else releases the claim and raises ClaimSecretsNotDelivered. |
FleetSandbox record#A bound sandbox.
Returned by Fleet.acquire, Fleet.acquire_with, Fleet.attach_claim.
| Field | Type | Default | Description |
|---|---|---|---|
name | String | Sandbox name. | |
namespace | String | Namespace. | |
claim | String | Claim name. | |
services | Vec<String> | Declared service names. |
FleetSignedUrl record#A signed, shareable service URL.
Returned by Fleet.create_signed_service_url.
| Field | Type | Default | Description |
|---|---|---|---|
url | String | The URL. | |
json | String | The resource as JSON (for revoke_signed_service_url). |