Install the SDK, or the CLI for
ppio commands, and set the PPIO_API_KEY and PPIO_DOMAIN environment variables before running these examples. See Quickstart and Install and authenticate.Set an idle timeout
The idle timeout is configured through themetadata field when a sandbox is created. The key is idle_timeout and the value is the number of seconds, as a string.
Pause instead of kill
To pause the sandbox instead, so it can be resumed later, enable the auto-pause option (auto_pause=True in Python, autoPause: true in Node.js).
Combine with other metadata
Theidle_timeout key can be combined with other metadata keys already in use.
Disable the idle timeout
To disable the idle timeout for a sandbox, omit theidle_timeout key from the metadata, or set it to 0.
The idle timeout is stored in the sandbox metadata under the
idle_timeout key, beside any other metadata keys of the sandbox. See List and filter sandboxes.