Skip to main content

GMI Sandbox SDK Reference

Python SDK for the GMI Sandbox control plane and sandbox data plane.

Installation

The SDK requires Python 3.9 or newer.

Configuration

The client reads these environment variables when explicit arguments are not provided:

Client

Explicit configuration:
Constructor arguments: client.health() returns local client information:

Basic Workflow

idc_name is optional for sandbox and template creation: when omitted, the service falls back to the organization’s configured default IDC.

Sandboxes

client.sandboxes.create()

Arguments: Returns a Sandbox.

client.sandboxes.list()

state accepts a string or a sequence of strings. Metadata is encoded as metadata[key] query parameters.

client.sandboxes.get()

client.sandboxes.connect()

The returned sandbox contains fresh data-plane connection fields.

Sandbox

Properties: Lifecycle states include provisioning, running, checkpointing, updating, and failed. Methods:

Files

All file methods use the sandbox data plane and require connect() first.
Methods: download() always returns bytes. destination is an additional local write.

Command Execution

Arguments: Execution properties:
Execution statuses include pending, running, canceling, succeeded, failed, and canceled. Methods:
Cancel only non-terminal executions. The service may reject cancellation after an execution has completed.

Templates

Create

resources supports preset or custom values. Preset:
Custom:
Build sources include image and template sources:
idempotency_key is required for template creation. Returns a Template. The returned object can be used with template instance methods such as update(), delete(), builds(), build(), and build_logs().

List and Get

Update and Delete

The template’s idc_name is reused automatically when present in the template response.

Builds and Logs

Product Specifications

Pagination

List methods return a Page object:
Page fields:

Errors

All SDK exceptions derive from SandboxSDKError. APIError fields:
Error handling example:

OpenAPI Coverage

The SDK maps the Sandbox-related OpenAPI operations as follows: