What You’ll Learn
- Creating a sandbox with metadata and environment variables
- Retrieving sandbox info (
id,state,template) withget_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
- Python
- TypeScript
Create a sandbox with Inspect the sandbox with Verify environment variables by running a command inside the sandbox:Extend the timeout and then kill:Always wrap in
metadata and envs:get_info() and check its running state:try/finally — kill() is idempotent: