Class SandboxClient
java.lang.Object
io.agentscope.extensions.sandbox.kubernetes.client.SandboxClient
- All Implemented Interfaces:
AutoCloseable
Client for managing agent-sandbox lifecycles.
Mirrors the Python SDK's SandboxClient: creates SandboxClaims against a warm pool,
waits for readiness, and returns Sandbox handles for command / file operations.
-
Constructor Summary
ConstructorsConstructorDescriptionSandboxClient(SandboxConnectionConfig connectionConfig) SandboxClient(SandboxConnectionConfig connectionConfig, io.fabric8.kubernetes.client.KubernetesClient kubernetesClient) SandboxClient(SandboxConnectionConfig connectionConfig, io.fabric8.kubernetes.client.KubernetesClient kubernetesClient, Duration requestTimeout, Duration perAttemptTimeout) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()createSandbox(CreateSandboxOptions options) Creates a sandbox from the given options.createSandbox(String warmPool) Convenience overload matching the Python SDK signature.createSandbox(String warmPool, String namespace) Convenience overload with namespace.voidDeletes all sandboxes tracked by this client.voiddeleteSandbox(String claimName, String namespace) Stops the client-side connection and deletes the Kubernetes claim.getSandbox(String claimName, String namespace) Re-attaches to an existing SandboxClaim.getSandbox(String claimName, String namespace, long resolveTimeoutSeconds) Re-attaches to an existing SandboxClaim.getSandboxClaimWarmPoolName(String claimName, String namespace) Returns the warm pool name referenced by a claim.Returns(namespace, claimName)pairs tracked by this client.listAllSandboxes(String namespace) Lists all SandboxClaim names in the cluster for the given namespace.listAllSandboxes(String namespace, String labelSelector) Lists SandboxClaim names, optionally filtered by label selector.
-
Constructor Details
-
SandboxClient
public SandboxClient() -
SandboxClient
-
SandboxClient
public SandboxClient(SandboxConnectionConfig connectionConfig, io.fabric8.kubernetes.client.KubernetesClient kubernetesClient) -
SandboxClient
public SandboxClient(SandboxConnectionConfig connectionConfig, io.fabric8.kubernetes.client.KubernetesClient kubernetesClient, Duration requestTimeout, Duration perAttemptTimeout)
-
-
Method Details
-
createSandbox
Creates a sandbox from the given options.- Parameters:
options- create options- Returns:
- sandbox handle
-
createSandbox
Convenience overload matching the Python SDK signature.- Parameters:
warmPool- warm pool name- Returns:
- sandbox handle
-
createSandbox
Convenience overload with namespace.- Parameters:
warmPool- warm pool namenamespace- namespace- Returns:
- sandbox handle
-
getSandbox
Re-attaches to an existing SandboxClaim.- Parameters:
claimName- claim namenamespace- namespace- Returns:
- sandbox handle
-
getSandbox
Re-attaches to an existing SandboxClaim.- Parameters:
claimName- claim namenamespace- namespaceresolveTimeoutSeconds- timeout for name resolution- Returns:
- sandbox handle
-
listActiveSandboxes
Returns(namespace, claimName)pairs tracked by this client.- Returns:
- active sandbox keys as
namespace/claimNamestrings
-
listAllSandboxes
Lists all SandboxClaim names in the cluster for the given namespace.- Parameters:
namespace- namespace- Returns:
- claim names
-
listAllSandboxes
Lists SandboxClaim names, optionally filtered by label selector.- Parameters:
namespace- namespacelabelSelector- optional label selector- Returns:
- claim names
-
deleteSandbox
Stops the client-side connection and deletes the Kubernetes claim.- Parameters:
claimName- claim namenamespace- namespace
-
deleteAll
public void deleteAll()Deletes all sandboxes tracked by this client. -
getSandboxClaimWarmPoolName
Returns the warm pool name referenced by a claim.- Parameters:
claimName- claim namenamespace- namespace- Returns:
- warm pool name
-
getK8sHelper
-
getConnectionConfig
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-