Sandboxes SDK for Python
Usage and symbol reference
Render Sandboxes is in public beta.
APIs, defaults, and limits might change during the beta period.
Setup
1. Install the SDK
From your Python project directory:
If you already have the SDK installed, make sure you're using version 1.10.0 or later:
After installing, make sure to add render>=1.10.0 as a dependency in your application's requirements.txt, pyproject.toml, or equivalent.
Version 1.9.0 and later require Python 3.11 or later.
2. Import the client (sync or async)
The Python SDK provides separate classes for synchronous (Render) and asynchronous (RenderAsync) usage. Both clients support the methods in this reference.
The method examples below use the sync client. With RenderAsync, await each method call except exec, which returns an async iterator to use with async for.
Import sandbox-specific types and errors from render.sandbox.
Initializes a synchronous Render SDK client.
Raises: ValueError
| Parameter | Description |
|---|---|
|
The Render API key to use for authentication. If omitted, the client uses the value of the |
|
The default workspace ID to use for sandbox operations. Override this default by setting If omitted, the client uses the value of the |
|
A compatibility parameter that does not affect sandbox placement. The sandbox group determines the region. Currently, all sandboxes run in the Oregon region. If omitted, the client uses the value of the |
Initializes an asynchronous Render SDK client.
Raises: ValueError
| Parameter | Description |
|---|---|
|
The Render API key to use for authentication. If omitted, the client uses the value of the |
|
The default workspace ID to use for sandbox operations. Override this default by setting If omitted, the client uses the value of the |
|
A compatibility parameter that does not affect sandbox placement. The sandbox group determines the region. Currently, all sandboxes run in the Oregon region. If omitted, the client uses the value of the |
Sandbox lifecycle
Creates a new sandbox with the specified configuration.
-
To restore from a snapshot:
- Provide one of
snapshot_idorsnapshot_name(not both). - Set
sandbox_group_idto the snapshot's group ID (cross-group restores are not supported). - For details, see Restoring from a snapshot.
- Provide one of
-
To use a custom image:
- Set
imageto the ID or name of the image to use. The image must have been previously imported. - Set
sandbox_group_idto the image's group ID (cross-group image use is not supported). - For details, see Docker images.
- Set
By default, this method does not wait for the sandbox to become ready before returning. Pass the wait option to customize wait behavior.
On success: Returns a Sandbox object. Check its status field to determine whether it's currently running or creating.
Raises: SandboxCreateWaitError, ValueError (invalid wait options, network policy, or conflicting image/snapshot parameters), SnapshotNotFoundError, SnapshotNotReadyError, SnapshotPlanMismatchError, ImageNotFoundError, ImageNotReadyError, RateLimitError, ClientError, ServerError, RenderError
With RenderAsync, canceling the task while this method is waiting attempts to terminate the created sandbox before propagating cancellation.
Supported parameters include:
| Parameter | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
The ID of the workspace that owns the sandbox. Defaults to the client configuration. If this value is not set here, it must be set in the client configuration. Otherwise, this method raises | |||||||||||||||
|
An optional, case-sensitive name for the sandbox. This value cannot exceed 64 characters or begin with Names are not required to be unique. Use the sandbox's ID when calling methods that operate on a specific sandbox. | |||||||||||||||
|
The ID of the sandbox group to create the sandbox in. If omitted, defaults to the workspace's default sandbox group. If the workspace does not have any sandbox groups, this method creates a new group and adds the sandbox to it. | |||||||||||||||
|
The ID of the compute plan to use for the sandbox. One of the following:
For pricing details, see Compute plans and billing. Omit this value if restoring from a runtime snapshot. In this case, the new sandbox must use the same compute plan as the source sandbox (which is the default behavior). You can provide this value if restoring from a filesystem snapshot. If you omit this field:
| |||||||||||||||
|
The maximum time the sandbox can run continuously, in seconds. The sandbox terminates when this time elapses. If the sandbox is suspended and later resumed, this timeout restarts. If you omit this field:
Set to Automatic idle suspension is configured separately with | |||||||||||||||
|
The number of seconds of inactivity before the sandbox is automatically suspended. See Idle suspension. If you omit this field:
Set to | |||||||||||||||
|
A If you omit this field:
| |||||||||||||||
|
A dictionary containing key-value pairs to add to the sandbox as environment variables. For example: All values must be strings. These values override any matching See Environment variable limits. The API does not return these values in sandbox details. | |||||||||||||||
|
The ID of the snapshot to restore from. The snapshot must have status If you provide this value, do not provide | |||||||||||||||
|
The name of the snapshot to restore from (case-sensitive). The snapshot must have status If multiple snapshots match the provided name, Render uses the most recently created snapshot with a status of If you provide this value, do not provide | |||||||||||||||
|
The ID or name of an image that was previously imported into the same sandbox group using
If omitted, the sandbox uses the default image unless you provide a snapshot. If you provide this value, do not provide | |||||||||||||||
|
Controls how the method waits for the sandbox to become ready before returning. Provide one of the following:
Defaults to The wait begins after the create request returns. If it fails, this method raises | |||||||||||||||
|
Deprecated. Do not provide this field. A sandbox's sandbox group determines its region. Currently, all sandboxes run in the Oregon region. |
Waits for the specified sandbox to reach a status of running and then returns its details.
Raises SandboxNotRunningError if the sandbox is errored, terminated, suspending, or suspended. If the wait times out or is canceled, the sandbox continues to exist. Use terminate to stop it.
To create a sandbox and wait for it in a single call, provide wait options to create.
On success: Returns a Sandbox object with a status of running.
Raises: SandboxNotFoundError, SandboxNotRunningError, SandboxWaitTimeoutError, ValueError (invalid wait options), RateLimitError, ClientError, ServerError, RenderError
| Parameter | Description |
|---|---|
|
Required. The ID of the sandbox to wait for. |
|
The maximum total time to wait, in seconds. If this timeout is reached, the method raises a Defaults to |
|
The initial delay between status checks, in seconds. Must be greater than
Defaults to |
|
The ID of the workspace that owns the sandbox. Defaults to the client configuration. If this value is not set here, it must be set in the client configuration. Otherwise, this method raises |
Retrieves the details of the sandbox with the specified ID.
On success: Returns a Sandbox object.
Raises: SandboxNotFoundError, RateLimitError, ClientError, ServerError, RenderError
| Parameter | Description |
|---|---|
|
Required. The ID of the sandbox to retrieve. |
|
The ID of the workspace that owns the sandbox. Defaults to the client configuration. If this value is not set here, it must be set in the client configuration. Otherwise, this method raises |
Lists sandboxes in the specified workspace, newest first.
Terminated sandboxes are excluded by default. Include terminated in the status filter to retrieve them.
On success: Returns a SandboxList containing a page of sandboxes and a cursor for the next page.
Raises: RateLimitError, ClientError, ServerError, RenderError
Supported parameters include:
| Parameter | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
The ID of the workspace to list sandboxes for. Defaults to the client configuration. If this value is not set here, it must be set in the client configuration. Otherwise, this method raises | ||||||||||||||||
|
The sandbox name to filter results by. Matches must be exact and are case-sensitive. Multiple sandboxes can have the same name. Omit to include sandboxes with any name. | ||||||||||||||||
|
A status string or sequence of statuses to filter results by:
| ||||||||||||||||
|
The | ||||||||||||||||
|
The maximum number of sandboxes to return per page. Defaults to | ||||||||||||||||
|
The ID of a sandbox group to filter results by. Omit to list sandboxes across the workspace. |
Terminates the sandbox with the specified ID and releases its compute resources. Terminating an already-terminated sandbox succeeds.
On success: Returns None.
Raises: SandboxNotFoundError, RateLimitError, ClientError, ServerError, RenderError
| Parameter | Description |
|---|---|
|
Required. The ID of the sandbox to terminate. |
|
The ID of the workspace that owns the sandbox. Defaults to the client configuration. If this value is not set here, it must be set in the client configuration. Otherwise, this method raises |
Runtime execution
Executes the specified command in the specified sandbox and streams its output. If the sandbox is currently suspended, this method resumes it before executing the command.
By default, sandboxes execute commands using bash -c. Sandboxes using a custom image that does not include Bash fall back to sh -c.
- Sandboxes using a custom image execute each command from the image's specified
WORKDIRif it exists, falling back to the sandbox's home directory. - All other sandboxes execute each command from the sandbox's home directory.
Output events identify the stream (stdout or stderr) and include a chunk of output. The final event includes the command's exit code. A nonzero exit code does not raise an error.
On success: Returns an iterator of SandboxExecEvent values: a regular iterator with Render, or an async iterator with RenderAsync.
Raises: SandboxNotFoundError, SandboxEndedError, SandboxExecStreamError, SandboxExecError, RateLimitError, ClientError, ServerError, RenderError
| Parameter | Description |
|---|---|
|
Required. The ID of the sandbox in which to run the command. |
|
Required. The shell command to run. |
|
The ID of the workspace that owns the sandbox. Defaults to the client configuration. If this value is not set here, it must be set in the client configuration. Otherwise, this method raises |
Streams a local file or directory to the specified path in the specified sandbox, without loading the entire file into memory. If the sandbox is suspended, this method resumes it before transferring data.
For directories, the SDK transfers the directory's contents to remote_path. Symlinks are preserved, and sockets, FIFOs, and other special files are skipped.
Passing a local path that is neither a regular file nor a directory raises ValueError.
On success: Returns None.
Raises: ValueError (invalid path), SandboxNotFoundError, SandboxEndedError, SandboxFileNotFoundError, RateLimitError, ClientError, ServerError, RenderError
| Parameter | Description |
|---|---|
|
Required. The ID of the destination sandbox. |
|
Required. The local file or directory to upload, as a string or |
|
Required. The destination path in the sandbox.
|
|
The ID of the workspace that owns the sandbox. Defaults to the client configuration. If this value is not set here, it must be set in the client configuration. Otherwise, this method raises |
Streams a file or directory from the specified path in the specified sandbox to a local disk path, without loading the entire file into memory. If the sandbox is suspended, this method resumes it before transferring data.
If a file already exists at the specified local path, this method attempts to overwrite it after the download succeeds.
If a local filesystem error prevents saving the download, the method raises SandboxDownloadError.
Directories are extracted into local_path. For an individual file, local_path can be either the destination filename or an existing directory to save the file in.
If a directory download fails during extraction, partially extracted files can remain at the local path.
This method does not enforce a download size limit.
On success: Returns the local path of the downloaded file or directory, as a string.
Raises: ValueError (invalid path), SandboxNotFoundError, SandboxEndedError, SandboxFileNotFoundError, SandboxDownloadError, RateLimitError, ClientError, ServerError, RenderError
| Parameter | Description |
|---|---|
|
Required. The ID of the source sandbox. |
|
Required. The path of the file or directory in the sandbox.
|
|
Required. The local destination path, as a string or |
|
The ID of the workspace that owns the sandbox. Defaults to the client configuration. If this value is not set here, it must be set in the client configuration. Otherwise, this method raises |
Snapshots
Access snapshot methods through render.sandboxes.snapshots.
Snapshot results include the snapshot ID, optional name, source sandbox ID, sandbox group ID, kind, status, plan, capture and expiration times, size in bytes, and any capture error.
Deleting a snapshot prevents future restores but does not affect sandboxes already restored from it. After a snapshot expires, you can no longer retrieve it or restore from it, and snapshot lists omit it.
Initiates a snapshot capture of the specified sandbox, which must have status running.
Capturing a snapshot temporarily interrupts the sandbox's operation. The details of this interruption depend on the kind of snapshot:
| Kind of snapshot | Effect |
|---|---|
runtime | The sandbox is fully paused while RAM, CPU, and disk state are captured. |
filesystem | Filesystem writes are blocked while the filesystem is captured. The sandbox remains running. |
This temporary interruption ends before the snapshot becomes available.
By default, this method does not wait for the snapshot to become available before returning. Pass the wait option to customize wait behavior.
On success: Returns a Snapshot object.
Raises: SnapshotCreateWaitError, ValueError (invalid wait options), SandboxNotFoundError, RateLimitError, ClientError, ServerError
Supported parameters include:
| Parameter | Description | ||||||
|---|---|---|---|---|---|---|---|
|
Required. The ID of the running sandbox to capture. | ||||||
|
The kind of snapshot to create:
Defaults to For details, see Kinds of snapshots. | ||||||
|
An optional, case-sensitive name for the snapshot, with a maximum of 64 characters. Names are scoped to the sandbox group, can be reused, and cannot begin with | ||||||
|
The snapshot's time-to-live (TTL), in seconds. When the TTL expires, the snapshot is deleted. Each time you restore from the snapshot, its TTL refreshes. Set to Defaults to 30 days. This option replaced the For details, see Snapshot retention. | ||||||
|
The ID of the workspace that owns the source sandbox. Defaults to the client configuration. If neither is set, the API determines the workspace from the source sandbox. | ||||||
|
Controls how the method waits for the snapshot to be available before returning. Provide one of the following:
When enabled, the default wait timeout is If the wait fails, this method raises |
Waits for the specified snapshot to complete its capture and then returns its details.
Raises SnapshotFailedError if the snapshot's status becomes failed. If the wait times out or is canceled, snapshot capture continues.
To create a snapshot and wait for it in a single call, provide wait options to snapshots.create.
On success: Returns a Snapshot object with a status of available.
Raises: SnapshotFailedError, SnapshotWaitTimeoutError, SnapshotNotFoundError, ValueError (invalid wait options), RateLimitError, ClientError, ServerError
| Parameter | Description |
|---|---|
|
Required. The ID of the sandbox group that contains the snapshot. |
|
Required. The ID of the snapshot to wait for. |
|
The maximum total time to wait, in seconds. If this timeout is reached, the method raises a Defaults to |
|
The initial delay between status checks, in seconds. Must be greater than
Defaults to |
|
The ID of the workspace that owns the sandbox group. Defaults to the client configuration. If neither is set, the API determines the workspace from the sandbox group. |
Retrieves the details of the snapshot with the specified ID in the specified sandbox group.
To wait until a snapshot is available, use snapshots.wait_until_available.
On success: Returns a Snapshot object.
Raises: SnapshotNotFoundError, RateLimitError, ClientError, ServerError
| Parameter | Description |
|---|---|
|
Required. The ID of the sandbox group that contains the snapshot. |
|
Required. The ID of the snapshot to retrieve. |
|
The ID of the workspace that owns the sandbox group. Defaults to the client configuration. If neither is set, the API determines the workspace from the sandbox group. |
Lists snapshots in the specified sandbox group, newest first. Deleted and expired snapshots are excluded.
On success: Returns a SnapshotList containing a page of snapshots and a cursor for the next page.
Raises: RateLimitError, ClientError, ServerError, RenderError
Supported parameters include:
| Parameter | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|
|
Required. The ID of the sandbox group to list snapshots for. | ||||||||
|
A status string or sequence of statuses to filter results by:
| ||||||||
|
The | ||||||||
|
The maximum number of snapshots to return per page. Defaults to | ||||||||
|
The ID of the workspace that owns the sandbox group. Defaults to the client configuration. If this value is not set here, it must be set in the client configuration. Otherwise, this method raises |
Deletes the snapshot with the specified ID in the specified sandbox group. You cannot delete a snapshot while its status is creating. Sandboxes already restored from the snapshot are unaffected.
On success: Returns None.
Raises: SnapshotNotFoundError, SnapshotNotReadyError, RateLimitError, ClientError, ServerError
Supported parameters include:
| Parameter | Description |
|---|---|
|
Required. The ID of the sandbox group that contains the snapshot. |
|
Required. The ID of the snapshot to delete. |
|
The ID of the workspace that owns the sandbox group. Defaults to the client configuration. If neither is set, the API determines the workspace from the sandbox group. |
Docker images
Import a Docker image from a registry to use as the base image for sandboxes. For image requirements and runtime behavior, see Providing a custom image.
Imports the specified Docker image from its registry for use in the specified sandbox group.
This method does not wait for the image to become ready before returning. Use images.wait_until_ready to wait until the image is ready for use in a sandbox.
On success: Returns an Image object.
Raises: RateLimitError, ClientError, ServerError. HTTP 429 indicates a request rate limit or too many imports in progress.
Supported parameters include:
| Parameter | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|
|
Required. The ID of the sandbox group to import into. | ||||||||
|
Required. A case-sensitive name to associate with the imported image. This value cannot exceed 255 characters or begin with You can reuse a given name to import updated versions of the same image. When you provide an image name to | ||||||||
|
Required. An image reference identifying the image to import, such as Docker image reference formatYou can reference a Docker image by tag or digest: Examples: Render uses the following defaults when you omit parts of the reference:
For example, the following references all resolve to
| ||||||||
|
Required for private images, omit otherwise. A dictionary containing credentials for pulling the image from its registry. Credentials are used only for this single import.
Do not hardcode sensitive credentials in your application code. Use environment variables or a secrets manager instead. |
Waits for the specified Docker image to complete its import and then returns its details.
Raises ImageFailedError if the image's status becomes failed. If the wait times out or is canceled, the image import continues.
On success: Returns an Image object with a status of succeeded.
Raises: ImageFailedError, ImageWaitTimeoutError, ImageNotFoundError, ValueError (invalid wait options), RateLimitError, ClientError, ServerError
| Parameter | Description |
|---|---|
|
Required. The ID of the sandbox group that contains the image. |
|
Required. The ID of the image to wait for. |
|
The maximum total time to wait, in seconds. If this timeout is reached, the method raises an Defaults to |
|
The initial delay between status checks, in seconds. The delay doubles with each attempt until reaching at least 2 seconds. Defaults to |
Retrieves the details of the image with the specified ID in the specified sandbox group.
To wait until an image has completed its import, instead use images.wait_until_ready.
On success: Returns an Image object.
Raises: ImageNotFoundError, RateLimitError, ClientError, ServerError
| Parameter | Description |
|---|---|
|
Required. The ID of the sandbox group that contains the image. |
|
Required. The ID of the image to retrieve. |
Lists images in the specified sandbox group, newest first.
Each imported version is returned as a separate result. Multiple results can have the same image name.
On success: Returns an ImageList containing a page of images and a cursor for the next page.
Raises: RateLimitError, ClientError, ServerError
Supported parameters include:
| Parameter | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
Required. The ID of the sandbox group to list images from. | ||||||||||
|
The case-sensitive image name to filter results by. Omit to include images with any name. | ||||||||||
|
A status string or sequence of import statuses to filter results by. Omit to include all statuses.
| ||||||||||
|
The | ||||||||||
|
The maximum number of images to return per page. Defaults to |
Deletes the image with the specified ID in the specified sandbox group. Deleting an already-deleted image succeeds.
If at least one sandbox or snapshot depends on the image (such as to resume or restore), this method raises ImageInUseError.
On success: Returns None.
Raises: ImageNotFoundError, ImageInUseError, RateLimitError, ClientError, ServerError
Supported parameters include:
| Parameter | Description |
|---|---|
|
Required. The ID of the sandbox group that contains the image. |
|
Required. The ID of the image to delete. |
Sandbox groups
Lists sandbox groups in the specified workspace.
To paginate, use next_cursor from the previous response to retrieve the next page. Continue until a page contains no groups.
On success: Returns a SandboxGroupList containing a page of sandbox groups and a cursor for the next page.
Raises: RateLimitError, ClientError, ServerError, RenderError
Supported parameters include:
| Parameter | Description |
|---|---|
|
The ID of the workspace to list sandbox groups for. Defaults to the client configuration. If this value is not set here, it must be set in the client configuration. Otherwise, this method raises |
|
The |
|
The maximum number of groups to return per page. Defaults to |
Creates a sandbox group in the specified workspace.
On success: Returns a SandboxGroup object.
Raises: RateLimitError, ClientError, ServerError, RenderError
Supported parameters include:
| Parameter | Description |
|---|---|
|
Required. The name of the sandbox group. |
|
The ID of the workspace that owns the sandbox group. Defaults to the client configuration. If this value is not set here, it must be set in the client configuration. Otherwise, this method raises |
|
The region for the sandbox group. Currently, only Defaults to |
Retrieves the details of the sandbox group with the specified ID.
On success: Returns a SandboxGroup object.
Raises: RateLimitError, ClientError, ServerError, RenderError
| Parameter | Description |
|---|---|
|
Required. The ID of the sandbox group to retrieve. |
Sets the specified sandbox group's concurrency limit. The returned group includes the new effective limit, which might be lower than the requested limit if capped by your workspace's concurrency limit.
On success: Returns a SandboxGroup object.
Raises: RateLimitError, ClientError, ServerError, RenderError
| Parameter | Description |
|---|---|
|
Required. The ID of the sandbox group to update. |
|
Required. The maximum number of active sandboxes in the group. Must be at least |
Deletes the specified sandbox group and initiates termination of its sandboxes. Snapshots in the group are also deleted as part of cleanup.
You cannot delete a workspace's default sandbox group. First use set_default_group to make another group the default.
On success: Returns None.
Raises: SandboxGroupDefaultNotDeletableError, RateLimitError, ClientError, ServerError, RenderError
| Parameter | Description |
|---|---|
|
Required. The ID of the sandbox group to delete. |
Sets the specified sandbox group as the workspace's default group. If you create a sandbox without specifying a sandbox_group_id, it belongs to the default group.
On success: Returns a SandboxGroup object.
Raises: RateLimitError, ClientError, ServerError, RenderError
| Parameter | Description |
|---|---|
|
Required. The ID of the sandbox group to make the default. |
Error types
All SDK-specific errors inherit from RenderError. Import common errors from render.client.errors and sandbox-specific errors from render.sandbox.
The SDK can also raise standard Python exceptions, such as ValueError for invalid parameter values.
Sandbox errors
These errors pertain to sandbox operations that cannot resolve required client configuration or encounter an unexpected response.
The base class for SDK-specific errors. Raised when an operation cannot resolve a required owner ID or encounters an unexpected sandbox response.
Raised when the sandbox does not exist or is no longer retrievable.
Raised when command execution or file transfer is attempted on a sandbox with a status of terminated or errored. Includes the status in sandbox_status.
Sandbox group errors
These errors pertain to deleting sandbox groups and changing the workspace's default group.
Raised when delete_group attempts to delete the workspace's default sandbox group. Use set_default_group to make another group the default before deleting it.
Command execution errors
These errors pertain to running commands in a sandbox.
Raised when the event stream for the exec method ends with a terminal error. Includes status and message properties.
Raised when the command event stream ends without a final exit event or contains invalid event data.
File transfer errors
Raised when the requested path does not exist in the sandbox.
Raised when copy_from encounters a local filesystem error while saving a download or cannot safely extract a downloaded directory.
Readiness errors
These errors pertain to waiting for a sandbox or snapshot to be ready.
Raised when wait_until_running detects that the specified sandbox has a status of errored, terminated, suspending, or suspended. Includes sandbox_id and sandbox_status.
Raised when snapshots.wait_until_available detects that the specified snapshot has a status of failed. Includes snapshot_id and the capture error in snapshot_error, if available.
Raised when a sandbox does not reach a status of running within the specified wait timeout. Includes sandbox_id, timeout_seconds, and last_status (or None if no status check completed).
Raised when a snapshot does not reach a status of available within the specified wait timeout. Includes snapshot_id, timeout_seconds, and last_status (or None if no status check completed).
Raised when create reaches a failure state while waiting for a created sandbox to reach a status of running.
Common failure states include:
- The
waittimeout passed tocreatewas reached. - The sandbox reached a non-
runningstatus (errored,terminated,suspending, orsuspended).
Includes sandbox_id and the underlying error in cause.
The created sandbox still exists. Use from_id to retrieve its details, including its current status.
Raised when snapshots.create reaches a failure state while waiting for a created snapshot to reach a status of available.
Common failure states include:
- The
waittimeout passed tosnapshots.createwas reached. - The snapshot capture failed.
Includes snapshot_id, sandbox_group_id, and the underlying error in cause.
The created snapshot still exists. Use snapshots.from_id to retrieve its details, including its current status.
Snapshot errors
These errors pertain to creating snapshots, restoring from snapshots, and managing snapshots.
Raised when a specified snapshot cannot be found in the specified sandbox group.
Common causes include:
- The snapshot was deleted.
- The snapshot expired.
- The snapshot belongs to a different sandbox group.
Raised when a sandbox attempts to restore from a snapshot with a non-available status, or when attempting to delete a snapshot with a status of creating.
Raised when a sandbox attempts to restore from a runtime snapshot if its compute plan does not match the plan of the snapshot's source sandbox.
Image errors
These errors pertain to importing and managing Docker images and creating sandboxes from them.
Raised when a specified image cannot be found in the specified sandbox group by ID or name.
Common causes include:
- The image was deleted.
- The image belongs to a different sandbox group.
Raised when create attempts to use an image with a non-succeeded status. The import might still be in progress or have failed.
Raised when images.delete attempts to delete an image that at least one sandbox or snapshot depends on (such as to resume or restore). The error message identifies dependent sandboxes and snapshots.
Raised when images.wait_until_ready detects that the specified image has a status of failed. Includes image_id and the API's failure_reason, if available.
Raised when the specified image does not reach a status of succeeded within the timeout for images.wait_until_ready. Includes image_id, timeout_seconds, and last_status (or None if no status check completed).
The image import continues and might still succeed.
API errors
These errors pertain to responses from the Render API.
Raised when the API returns a 4xx response, including HTTP 429 for either the request rate or concurrency cap (see Sandbox limits).
Includes code when the API provides an error code.
Raised when the API returns HTTP 429 because of a request rate or concurrency limit. See Sandbox limits.
Raised when the API returns a 5xx response.
Raised when an API request times out. Also the parent class of SandboxWaitTimeoutError, SnapshotWaitTimeoutError, and ImageWaitTimeoutError. This is the SDK's TimeoutError, imported from render.client.errors.
Additional types
Represents a single sandbox on Render. Returned by methods such as create, from_id, and wait_until_running.
| Property | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
The sandbox's ID. | ||||||||||||||||
|
The sandbox's name, or | ||||||||||||||||
|
The sandbox's current status:
| ||||||||||||||||
|
The sandbox's compute plan. | ||||||||||||||||
|
The sandbox's outbound network policy, as a | ||||||||||||||||
|
The region that the sandbox runs in. This value is currently always | ||||||||||||||||
|
The sandbox's runtime timeout, in seconds. A value of This timeout restarts if the sandbox is suspended and later resumed. | ||||||||||||||||
|
The sandbox's idle timeout, in seconds. A value of This timeout restarts if the sandbox is suspended and later resumed. | ||||||||||||||||
|
The ID of the sandbox group that contains the sandbox. | ||||||||||||||||
|
The time when the sandbox was created, as a | ||||||||||||||||
|
For a terminated sandbox, the time when it was terminated, as a This also applies to termination caused by an error, in which case the sandbox has a status of For sandboxes with any other status, this value is |
Specifies a sandbox's outbound network policy. Provide this object as network_policy to create.
| Property | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|
|
Required. The sandbox's outbound network policy. One of the following:
| ||||||||
|
Required when You can define a maximum of 100 rules for a given sandbox. |
Specifies a destination allowed by a NetworkPolicy with a type of allow-list.
| Property | Description |
|---|---|
|
Required. A lowercase hostname (such as |
|
Defaults to |
Specifies wait settings for create and snapshots.create. Provide this object as the method's wait parameter.
| Property | Description |
|---|---|
|
The maximum total time to wait, in seconds. Defaults to |
|
The initial delay between status checks, in seconds. Must be greater than
Defaults to |
Represents an output event received while streaming command output from the exec method.
| Property | Description |
|---|---|
|
The output stream that the command wrote to: |
|
The string that the command wrote to the specified |
Represents the final exit event received from the exec method.
| Property | Description |
|---|---|
|
The command's exit code, as an integer. Conventionally, a value of |
The SandboxExecEvent type is a SandboxExecOutput or SandboxExecExit object received while streaming command output from exec.
Represents a single sandbox group on Render. Returned by methods such as get_group or included in a SandboxGroupList page.
| Property | Description |
|---|---|
|
The sandbox group's ID. |
|
The ID of the workspace that owns the sandbox group. |
|
The sandbox group's name. |
|
The Render region that the sandbox group belongs to. |
|
Whether this is the workspace's default sandbox group. |
|
The maximum number of sandboxes that can run concurrently in this group. Suspended sandboxes do not count toward the limit. For details, see Concurrency per group. |
|
The time when the sandbox group was created, as a |
|
The time when the sandbox group was last updated, as a |
|
The ID of the group's associated environment. This value is |
Represents one page of sandbox groups returned by list_groups.
| Property | Description |
|---|---|
|
A list of |
|
The cursor to pass on the next request. |
Represents a single imported Docker image. Returned by methods such as images.import_ and images.from_id or included in an ImageList page.
| Property | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
The image's ID, starting with Provide this value as | ||||||||||
|
The ID of the sandbox group that contains the image. | ||||||||||
|
The name associated with the imported image. Multiple imported versions can share the same name. | ||||||||||
|
An | ||||||||||
|
The resolved digest of the source image. Starts with | ||||||||||
|
The image's current import status:
| ||||||||||
|
If For images with any other status, this value is | ||||||||||
|
The time when the import was created, as a | ||||||||||
|
If For images with any other status, this value is |
Represents the source Docker image identified by the source property of an Image object.
| Property | Description |
|---|---|
|
The registry host and repository path, such as |
|
The source image's name within the repository, such as |
|
The source image's tag or digest, such as |
Represents one page of imported Docker images returned by images.list.
| Property | Description |
|---|---|
|
A list of |
|
The cursor to pass on the next request. |
Represents a single sandbox snapshot. Returned by methods such as snapshots.from_id or included in a SnapshotList page.
| Property | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|
|
The snapshot's ID. | ||||||||
|
The ID of the sandbox group that contains the snapshot. | ||||||||
|
The ID of the snapshot's source sandbox. | ||||||||
|
The snapshot's name. This value is | ||||||||
|
The kind of snapshot: For details, see Snapshot kinds. | ||||||||
|
The snapshot's current status:
| ||||||||
|
The compute plan of the snapshot's source sandbox. | ||||||||
|
The time when snapshot capture was requested, as a | ||||||||
|
The time when capture completed, as a This value is | ||||||||
|
The snapshot's current expiration time, as a For a snapshot with TTL disabled, this value has a year of 9999. | ||||||||
|
The snapshot's total time-to-live (TTL), in seconds. This value does not dynamically decrement to reflect the current amount of time until expiration. Use the For a snapshot with TTL disabled, this value is | ||||||||
|
The snapshot's size, in bytes. This value is | ||||||||
|
If For snapshots with any other status, this value is |
Represents one page of snapshots returned by snapshots.list.
| Property | Description |
|---|---|
|
A list of |
|
The cursor to pass on the next request. |