Class: Daytona::CreateSandboxBaseParams
- Inherits:
-
Object
- Object
- Daytona::CreateSandboxBaseParams
- Defined in:
- lib/daytona/common/daytona.rb
Direct Known Subclasses
CreateSandboxFromImageParams, CreateSandboxFromSnapshotParams
Instance Attribute Summary collapse
-
#auto_archive_interval ⇒ Integer?
Auto-archive interval in minutes.
-
#auto_delete_interval ⇒ Integer?
Auto-delete interval in minutes.
-
#auto_pause_interval ⇒ Integer?
Auto-pause interval in minutes (nil = server default: 60 for non-ephemeral pause-supporting sandbox classes with auto-stop disabled; 0 = disabled).
-
#auto_stop_interval ⇒ Integer?
Auto-stop interval in minutes.
-
#domain_allow_list ⇒ String?
Comma-separated list of allowed domains for the Sandbox.
-
#env_vars ⇒ Hash<String, String>?
Environment variables to set in the Sandbox.
-
#ephemeral ⇒ Boolean?
Whether the Sandbox should be ephemeral.
-
#labels ⇒ Hash<String, String>?
Custom labels for the Sandbox.
-
#language ⇒ Symbol?
Programming language for the Sandbox.
-
#linked_sandbox ⇒ String?
ID or name of an existing Sandbox to link the new Sandbox to.
-
#network_allow_list ⇒ String?
Comma-separated list of allowed CIDR network addresses for the Sandbox.
-
#network_block_all ⇒ Boolean?
Whether to block all network access for the Sandbox.
-
#os_user ⇒ String?
OS user for the Sandbox.
-
#otel_endpoint_override ⇒ String?
OTel collector endpoint override for the Sandbox.
-
#outbound_proxy_url ⇒ String?
Outbound proxy URL to route the Sandbox HTTP(S) traffic through.
-
#public ⇒ Boolean?
Whether the Sandbox should be public.
-
#secrets ⇒ Hash<String, String>?
Organization Secrets to expose in the Sandbox, as a mapping of env var name to existing Secret name.
-
#spot ⇒ Boolean?
GPU-only.
-
#timeout ⇒ Float?
Timeout in seconds for Sandbox to be created and started.
-
#ttl_minutes ⇒ Integer?
Time to live in minutes (0 to disable).
-
#volumes ⇒ Array<DaytonaApiClient::SandboxVolume>?
List of volumes mounts to attach to the Sandbox.
Instance Method Summary collapse
-
#initialize(language: nil, os_user: nil, env_vars: nil, labels: nil, public: nil, timeout: nil, auto_stop_interval: nil, auto_pause_interval: nil, auto_archive_interval: nil, auto_delete_interval: nil, ttl_minutes: nil, volumes: nil, secrets: nil, network_block_all: nil, network_allow_list: nil, domain_allow_list: nil, outbound_proxy_url: nil, otel_endpoint_override: nil, ephemeral: nil, spot: nil, linked_sandbox: nil) ⇒ CreateSandboxBaseParams
constructor
Initialize CreateSandboxBaseParams.
-
#to_h ⇒ Hash<Symbol, Object>
Convert to hash representation.
Constructor Details
#initialize(language: nil, os_user: nil, env_vars: nil, labels: nil, public: nil, timeout: nil, auto_stop_interval: nil, auto_pause_interval: nil, auto_archive_interval: nil, auto_delete_interval: nil, ttl_minutes: nil, volumes: nil, secrets: nil, network_block_all: nil, network_allow_list: nil, domain_allow_list: nil, outbound_proxy_url: nil, otel_endpoint_override: nil, ephemeral: nil, spot: nil, linked_sandbox: nil) ⇒ CreateSandboxBaseParams
Initialize CreateSandboxBaseParams
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
# File 'lib/daytona/common/daytona.rb', line 111 def initialize( # rubocop:disable Metrics/MethodLength, Metrics/ParameterLists language: nil, os_user: nil, env_vars: nil, labels: nil, public: nil, timeout: nil, auto_stop_interval: nil, auto_pause_interval: nil, auto_archive_interval: nil, auto_delete_interval: nil, ttl_minutes: nil, volumes: nil, secrets: nil, network_block_all: nil, network_allow_list: nil, domain_allow_list: nil, outbound_proxy_url: nil, otel_endpoint_override: nil, ephemeral: nil, spot: nil, linked_sandbox: nil ) @language = language @os_user = os_user @env_vars = env_vars @labels = labels @public = public @timeout = timeout @auto_stop_interval = auto_stop_interval @auto_pause_interval = auto_pause_interval @auto_archive_interval = auto_archive_interval @auto_delete_interval = auto_delete_interval @ttl_minutes = ttl_minutes @volumes = volumes @secrets = secrets @network_block_all = network_block_all @network_allow_list = network_allow_list @domain_allow_list = domain_allow_list @outbound_proxy_url = outbound_proxy_url @otel_endpoint_override = otel_endpoint_override @ephemeral = ephemeral @spot = spot @linked_sandbox = linked_sandbox # Handle ephemeral and auto_delete_interval conflict handle_ephemeral_auto_delete_conflict end |
Instance Attribute Details
#auto_archive_interval ⇒ Integer?
Returns Auto-archive interval in minutes.
37 38 39 |
# File 'lib/daytona/common/daytona.rb', line 37 def auto_archive_interval @auto_archive_interval end |
#auto_delete_interval ⇒ Integer?
Returns Auto-delete interval in minutes.
40 41 42 |
# File 'lib/daytona/common/daytona.rb', line 40 def auto_delete_interval @auto_delete_interval end |
#auto_pause_interval ⇒ Integer?
Returns Auto-pause interval in minutes (nil = server default: 60 for non-ephemeral pause-supporting sandbox classes with auto-stop disabled; 0 = disabled). Not allowed for ephemeral sandboxes.
34 35 36 |
# File 'lib/daytona/common/daytona.rb', line 34 def auto_pause_interval @auto_pause_interval end |
#auto_stop_interval ⇒ Integer?
Returns Auto-stop interval in minutes.
29 30 31 |
# File 'lib/daytona/common/daytona.rb', line 29 def auto_stop_interval @auto_stop_interval end |
#domain_allow_list ⇒ String?
Returns Comma-separated list of allowed domains for the Sandbox.
57 58 59 |
# File 'lib/daytona/common/daytona.rb', line 57 def domain_allow_list @domain_allow_list end |
#env_vars ⇒ Hash<String, String>?
Returns Environment variables to set in the Sandbox.
17 18 19 |
# File 'lib/daytona/common/daytona.rb', line 17 def env_vars @env_vars end |
#ephemeral ⇒ Boolean?
Returns Whether the Sandbox should be ephemeral.
69 70 71 |
# File 'lib/daytona/common/daytona.rb', line 69 def ephemeral @ephemeral end |
#labels ⇒ Hash<String, String>?
Returns Custom labels for the Sandbox.
20 21 22 |
# File 'lib/daytona/common/daytona.rb', line 20 def labels @labels end |
#language ⇒ Symbol?
Returns Programming language for the Sandbox.
11 12 13 |
# File 'lib/daytona/common/daytona.rb', line 11 def language @language end |
#linked_sandbox ⇒ String?
Returns ID or name of an existing Sandbox to link the new Sandbox to. The new Sandbox will be scheduled on the same runner as the linked Sandbox so a local network can be established between them. Linked Sandboxes must be ephemeral (auto_delete_interval=0) and cannot themselves be linked to another Sandbox.
80 81 82 |
# File 'lib/daytona/common/daytona.rb', line 80 def linked_sandbox @linked_sandbox end |
#network_allow_list ⇒ String?
Returns Comma-separated list of allowed CIDR network addresses for the Sandbox.
54 55 56 |
# File 'lib/daytona/common/daytona.rb', line 54 def network_allow_list @network_allow_list end |
#network_block_all ⇒ Boolean?
Returns Whether to block all network access for the Sandbox.
51 52 53 |
# File 'lib/daytona/common/daytona.rb', line 51 def network_block_all @network_block_all end |
#os_user ⇒ String?
Returns OS user for the Sandbox.
14 15 16 |
# File 'lib/daytona/common/daytona.rb', line 14 def os_user @os_user end |
#otel_endpoint_override ⇒ String?
Returns OTel collector endpoint override for the Sandbox.
63 64 65 |
# File 'lib/daytona/common/daytona.rb', line 63 def otel_endpoint_override @otel_endpoint_override end |
#outbound_proxy_url ⇒ String?
Returns Outbound proxy URL to route the Sandbox HTTP(S) traffic through.
60 61 62 |
# File 'lib/daytona/common/daytona.rb', line 60 def outbound_proxy_url @outbound_proxy_url end |
#public ⇒ Boolean?
Returns Whether the Sandbox should be public.
23 24 25 |
# File 'lib/daytona/common/daytona.rb', line 23 def public @public end |
#secrets ⇒ Hash<String, String>?
Returns Organization Secrets to expose in the Sandbox, as a mapping of env var name to existing Secret name. The injected env var holds an opaque placeholder that is resolved to the real value only for the Secret's allowed hosts.
48 49 50 |
# File 'lib/daytona/common/daytona.rb', line 48 def secrets @secrets end |
#spot ⇒ Boolean?
Returns GPU-only. When true, the Sandbox may be instantly terminated without notice to free GPU capacity for an on-demand (non-spot) GPU Sandbox. Rejected when the Sandbox requests no GPUs.
74 75 76 |
# File 'lib/daytona/common/daytona.rb', line 74 def spot @spot end |
#timeout ⇒ Float?
Returns Timeout in seconds for Sandbox to be created and started.
26 27 28 |
# File 'lib/daytona/common/daytona.rb', line 26 def timeout @timeout end |
#ttl_minutes ⇒ Integer?
Returns Time to live in minutes (0 to disable).
66 67 68 |
# File 'lib/daytona/common/daytona.rb', line 66 def ttl_minutes @ttl_minutes end |
#volumes ⇒ Array<DaytonaApiClient::SandboxVolume>?
Returns List of volumes mounts to attach to the Sandbox.
43 44 45 |
# File 'lib/daytona/common/daytona.rb', line 43 def volumes @volumes end |
Instance Method Details
#to_h ⇒ Hash<Symbol, Object>
Convert to hash representation
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 |
# File 'lib/daytona/common/daytona.rb', line 163 def to_h # rubocop:disable Metrics/MethodLength { language:, os_user:, env_vars:, labels:, public:, timeout:, auto_stop_interval:, auto_pause_interval:, auto_archive_interval:, auto_delete_interval:, ttl_minutes:, volumes:, secrets:, network_block_all:, network_allow_list:, domain_allow_list:, outbound_proxy_url:, otel_endpoint_override:, ephemeral:, spot:, linked_sandbox: }.compact end |