Daytona
Section titled “Daytona”Daytona class for Daytona SDK.
Constructors
Section titled “Constructors”new Daytona()
Section titled “new Daytona()”def initialize(config = Config.new)Parameters:
configDaytona:Config - Configuration options. Defaults to Daytona::Config.new
Returns:
Daytona- a new instance of Daytona
Methods
Section titled “Methods”config()
Section titled “config()”def config()Returns:
Daytona:Config
api_client()
Section titled “api_client()”def api_client()Returns:
DaytonaApiClient
sandbox_api()
Section titled “sandbox_api()”def sandbox_api()Returns:
DaytonaApiClient:SandboxApi
volume()
Section titled “volume()”def volume()Returns:
Daytona:VolumeService
secret()
Section titled “secret()”def secret()Returns:
Daytona:SecretService
object_storage_api()
Section titled “object_storage_api()”def object_storage_api()Returns:
DaytonaApiClient:ObjectStorageApi
snapshots_api()
Section titled “snapshots_api()”def snapshots_api()Returns:
DaytonaApiClient:SnapshotsApi
snapshot()
Section titled “snapshot()”def snapshot()Returns:
Daytona:SnapshotService
close()
Section titled “close()”def close()Shuts down OTel providers, flushing any pending telemetry data.
Returns:
void
create()
Section titled “create()”def create(params = nil, on_snapshot_create_logs: nil)Creates a sandbox with the specified parameters
Parameters:
paramsDaytona:CreateSandboxFromSnapshotParams, Daytona:CreateSandboxFromImageParams, Nil - Sandbox creation parameters
Returns:
Daytona:Sandbox- The created sandbox
Raises:
Daytona:Sdk:Error- If auto_stop_interval, auto_pause_interval, auto_archive_interval, or ttl_minutes is negative, or if auto_stop_interval and auto_pause_interval are both non-zero
delete()
Section titled “delete()”def delete(sandbox, wait: false)Deletes a Sandbox.
Parameters:
sandboxDaytona:Sandbox -waitBoolean - When +true+, block until the Sandbox is destroyed.
Returns:
void
def get(id)Gets a Sandbox by its ID.
Parameters:
idString -
Returns:
Daytona:Sandbox
Raises:
Daytona:Sdk:Error-
list()
Section titled “list()”def list(query = nil)Iterates over Sandboxes matching the given query.
Parameters:
queryDaytona:ListSandboxesQuery, nil - Optional filters, sorting, and per-page size.
Returns:
Enumerator\<Daytona:Sandbox\>
Raises:
Daytona:Sdk:Error-
Examples:
daytona.list(Daytona::ListSandboxesQuery.new(labels: { 'env' => 'dev' })).each do |sandbox| puts sandbox.idendstart()
Section titled “start()”def start(sandbox, timeout = Sandbox::DEFAULT_TIMEOUT)Starts a Sandbox and waits for it to be ready.
Parameters:
sandboxDaytona:Sandbox -timeoutNumeric - Maximum wait time in seconds (defaults to 60 s).
Returns:
void
stop()
Section titled “stop()”def stop(sandbox, timeout = Sandbox::DEFAULT_TIMEOUT)Stops a Sandbox and waits for it to be stopped.
Parameters:
sandboxDaytona:Sandbox -timeoutNumeric - Maximum wait time in seconds (defaults to 60 s).
Returns:
void