Skip to main content

io.enterpriseai.resources.SandboxClient

Source: sdks/java/enterprise-ai-java/src/main/java/io/enterpriseai/resources/SandboxClient.java. Back to the Java SDK reference index.

note

This page is generated by tools/docs/gen_sdk_reference.py from the SDK sources and the OpenAPI text folders. Do not edit it by hand: change the source and regenerate.

Class SandboxClient​

Sandboxed executions (gVisor, Kata).

Constructor SandboxClient​

SandboxClient(Transport transport)

Creates the client on the shared transport; EnterpriseAIClient builds it and exposes it through the accessor of the same name.

NameTypeDefaultRequiredDescription
transportTransportyesTransport shared by the sub-clients of one client.

SandboxClient.execute​

JsonNode execute(Object body)

Run a command in a sandbox. Creates a sandbox execution: the image and command run as a Kubernetes Job with the runtime class of the profile (gVisor, Kata, Wasm) when Kubernetes is configured (status: submitted, or failed if the submission fails). Needs tenant_admin, developer or agent; the profile none needs tenant_admin (403). Invalid profile, image or limits answer 422 invalid_sandbox. The usage is metered and the request audited as sandbox.execute.

Route: /v1/sandbox/executions (POST).

NameTypeDefaultRequiredDescription
bodyObjectyesProfile, image, command, environment and resource limits.

Returns: JsonNode. Decoded JSON answer of the operation "Run a command in a sandbox".

Raises: the typed errors of the transport (Errors).

SandboxClient.execute​

JsonNode execute(Object body, RequestOptions options)

Run a command in a sandbox. Creates a sandbox execution: the image and command run as a Kubernetes Job with the runtime class of the profile (gVisor, Kata, Wasm) when Kubernetes is configured (status: submitted, or failed if the submission fails). Needs tenant_admin, developer or agent; the profile none needs tenant_admin (403). Invalid profile, image or limits answer 422 invalid_sandbox. The usage is metered and the request audited as sandbox.execute.

Route: /v1/sandbox/executions (POST).

NameTypeDefaultRequiredDescription
bodyObjectyesProfile, image, command, environment and resource limits.
optionsRequestOptionsyesPer call options (idempotency key, traceparent, headers, abort signal).

Returns: JsonNode. Decoded JSON answer of the operation "Run a command in a sandbox".

Raises: the typed errors of the transport (Errors).

SandboxClient.get​

JsonNode get(String id)

Get a sandbox execution. Returns the sandbox execution: profile, image, command, limits, generated Kubernetes Job spec, status, executor and result. 404 sandbox_execution_not_found.

Route: /v1/sandbox/executions/{execution_id} (GET).

NameTypeDefaultRequiredDescription
idStringyesIdentifier (UUID) of the sandbox execution.

Returns: JsonNode. Decoded JSON answer of the operation "Get a sandbox execution".

Raises: the typed errors of the transport (Errors).