java.lang.Object
io.agentscope.extensions.sandbox.kubernetes.client.Sandbox

public class Sandbox extends Object
Handle for a running Sandbox instance. Provides command execution and file I/O via commands() and files().

Mirrors the Python SDK's Sandbox class.

  • Constructor Details

  • Method Details

    • claimName

      public String claimName()
    • sandboxId

      public String sandboxId()
    • namespace

      public String namespace()
    • commands

      public CommandExecutor commands()
      Returns the command executor, or null if the connection has been closed.
      Returns:
      command executor
    • files

      public Filesystem files()
      Returns the filesystem API, or null if the connection has been closed.
      Returns:
      filesystem
    • isActive

      public boolean isActive()
      Whether the client-side connection is still active.
      Returns:
      true if active
    • getPodName

      public String getPodName()
      Fetches the Sandbox object from Kubernetes and retrieves its current pod name.
      Returns:
      pod name
    • getPodIp

      public String getPodIp()
      Selects a pod IP from the Sandbox status (prefers IPv4).
      Returns:
      pod IP or null
    • getSandboxNameHash

      public String getSandboxNameHash()
      Fetches the sandbox name hash from the status selector label.
      Returns:
      hash or null
    • status

      public SandboxStatus status()
      Retrieves the current status of the Sandbox.
      Returns:
      status pair
    • closeConnection

      public void closeConnection()
      Closes the client-side connection but leaves the remote Kubernetes resources running.
    • terminate

      public void terminate()
      Permanently deletes the SandboxClaim and closes the client-side connection. Idempotent.