Volcengine Kubernetes Engine
)Parameter | Description |
Parameter | Description |
template | The template ID of the SandboxTemplate created in the previous step. Description
|
secure | Specifies whether to enable envd authentication:
|
timeout | The lifetime of the Sandbox. When the timeout expires, the Sandbox is automatically reclaimed.
|
metadata | Optional information that can be added to help distinguish Sandboxes during subsequent queries or O&M. The data type is Dict[str, str]. |
Parameter | Description |
Parameter | Description |
files.write(path, file) | Writes a file to the Sandbox. path specifies the file path inside the Sandbox. |
files.read(path) | Reads and returns the file content from the Sandbox. |
Parameter | Description |
Parameter | Description |
run_code(code: str) | Runs Python code in the Sandbox. It is suitable for scenarios such as quick calculations and data processing. |
commands.run(cmd: str) | Run command-line instructions in the Sandbox. It is suitable for invoking system tools or running scripts. |
Parameter | Description |
Parameter | Description |
beta_pause() | Pauses the current Sandbox. This API is asynchronous, meaning that upon successful invocation, the corresponding Pod will be immediately reclaimed while the snapshot is created in the background. |
Sandbox.connect(sandbox_id=...) | During subsequent connections to the same sandbox (identified by sandbox_id), the Sandbox data will be automatically restored using the writable layer snapshot generated during the last pause. |
Parameter | Description |
Parameter | Description |
get_info() | Returns the Sandbox details, such as the associated bound template, status, start time, end time, and metadata. |