Skip to main content

What You’ll Learn

  • Creating a sandbox with metadata and environment variables
  • Retrieving sandbox info (id, state, template) with get_info() / getInfo()
  • Checking whether a sandbox is running with is_running() / isRunning()
  • Verifying that environment variables are set inside the sandbox
  • Extending the sandbox timeout with set_timeout() / setTimeout()
  • Killing the sandbox and confirming it stopped

Prerequisites

Code Walkthrough

Create a sandbox with metadata and envs:
Inspect the sandbox with get_info() and check its running state:
Verify environment variables by running a command inside the sandbox:
Extend the timeout and then kill:
Always wrap in try/finallykill() is idempotent:

Expected Output