Class: Daytona::CreateSandboxFromSnapshotParams

Inherits:
CreateSandboxBaseParams show all
Defined in:
lib/daytona/common/daytona.rb

Instance Attribute Summary collapse

Attributes inherited from CreateSandboxBaseParams

#auto_archive_interval, #auto_delete_interval, #auto_stop_interval, #env_vars, #ephemeral, #labels, #language, #network_allow_list, #network_block_all, #os_user, #public, #timeout, #volumes

Instance Method Summary collapse

Constructor Details

#initialize(snapshot: nil, **args) ⇒ CreateSandboxFromSnapshotParams

Initialize CreateSandboxFromSnapshotParams

Parameters:

  • snapshot (String, nil) (defaults to: nil)

    Name of the snapshot to use for the Sandbox

  • language (Symbol, nil)

    Programming language for the Sandbox

  • os_user (String, nil)

    OS user for the Sandbox

  • env_vars (Hash<String, String>, nil)

    Environment variables to set in the Sandbox

  • labels (Hash<String, String>, nil)

    Custom labels for the Sandbox

  • public (Boolean, nil)

    Whether the Sandbox should be public

  • timeout (Float, nil)

    Timeout in seconds for Sandbox to be created and started

  • auto_stop_interval (Integer, nil)

    Auto-stop interval in minutes

  • auto_archive_interval (Integer, nil)

    Auto-archive interval in minutes

  • auto_delete_interval (Integer, nil)

    Auto-delete interval in minutes

  • volumes (Array<DaytonaApiClient::SandboxVolume>, nil)

    List of volumes mounts to attach to the Sandbox

  • network_block_all (Boolean, nil)

    Whether to block all network access for the Sandbox

  • network_allow_list (String, nil)

    Comma-separated list of allowed CIDR network addresses for the Sandbox

  • ephemeral (Boolean, nil)

    Whether the Sandbox should be ephemeral



193
194
195
196
197
# File 'lib/daytona/common/daytona.rb', line 193

def initialize(snapshot: nil, **args)
  @snapshot = snapshot

  super(**args)
end

Instance Attribute Details

#snapshotString?

Returns Name of the snapshot to use for the Sandbox.

Returns:

  • (String, nil)

    Name of the snapshot to use for the Sandbox



175
176
177
# File 'lib/daytona/common/daytona.rb', line 175

def snapshot
  @snapshot
end

Instance Method Details

#to_hHash<Symbol, Object>

Convert to hash representation

Returns:

  • (Hash<Symbol, Object>)

    Hash representation of the parameters



202
203
204
# File 'lib/daytona/common/daytona.rb', line 202

def to_h
  super.merge(snapshot:).compact
end