Class: Daytona::CreateSandboxBaseParams

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(language: nil, os_user: nil, env_vars: nil, labels: nil, public: nil, timeout: nil, auto_stop_interval: nil, auto_archive_interval: nil, auto_delete_interval: nil, volumes: nil, network_block_all: nil, network_allow_list: nil, ephemeral: nil) ⇒ CreateSandboxBaseParams

Initialize CreateSandboxBaseParams



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/daytona/common/daytona.rb', line 59

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_archive_interval: nil,
  auto_delete_interval: nil,
  volumes: nil,
  network_block_all: nil,
  network_allow_list: nil,
  ephemeral: nil
)
  @language = language
  @os_user = os_user
  @env_vars = env_vars
  @labels = labels
  @public = public
  @timeout = timeout
  @auto_stop_interval = auto_stop_interval
  @auto_archive_interval = auto_archive_interval
  @auto_delete_interval = auto_delete_interval
  @volumes = volumes
  @network_block_all = network_block_all
  @network_allow_list = network_allow_list
  @ephemeral = ephemeral

  # Handle ephemeral and auto_delete_interval conflict
  handle_ephemeral_auto_delete_conflict
end

Instance Attribute Details

#auto_archive_intervalInteger?



27
28
29
# File 'lib/daytona/common/daytona.rb', line 27

def auto_archive_interval
  @auto_archive_interval
end

#auto_delete_intervalInteger?



30
31
32
# File 'lib/daytona/common/daytona.rb', line 30

def auto_delete_interval
  @auto_delete_interval
end

#auto_stop_intervalInteger?



24
25
26
# File 'lib/daytona/common/daytona.rb', line 24

def auto_stop_interval
  @auto_stop_interval
end

#env_varsHash<String, String>?



12
13
14
# File 'lib/daytona/common/daytona.rb', line 12

def env_vars
  @env_vars
end

#ephemeralBoolean?



42
43
44
# File 'lib/daytona/common/daytona.rb', line 42

def ephemeral
  @ephemeral
end

#labelsHash<String, String>?



15
16
17
# File 'lib/daytona/common/daytona.rb', line 15

def labels
  @labels
end

#languageSymbol?



6
7
8
# File 'lib/daytona/common/daytona.rb', line 6

def language
  @language
end

#network_allow_listString?



39
40
41
# File 'lib/daytona/common/daytona.rb', line 39

def network_allow_list
  @network_allow_list
end

#network_block_allBoolean?



36
37
38
# File 'lib/daytona/common/daytona.rb', line 36

def network_block_all
  @network_block_all
end

#os_userString?



9
10
11
# File 'lib/daytona/common/daytona.rb', line 9

def os_user
  @os_user
end

#publicBoolean?



18
19
20
# File 'lib/daytona/common/daytona.rb', line 18

def public
  @public
end

#timeoutFloat?



21
22
23
# File 'lib/daytona/common/daytona.rb', line 21

def timeout
  @timeout
end

#volumesArray<DaytonaApiClient::SandboxVolume>?



33
34
35
# File 'lib/daytona/common/daytona.rb', line 33

def volumes
  @volumes
end

Instance Method Details

#to_hHash<Symbol, Object>

Convert to hash representation



95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/daytona/common/daytona.rb', line 95

def to_h # rubocop:disable Metrics/MethodLength
  {
    language:,
    os_user:,
    env_vars:,
    labels:,
    public:,
    timeout:,
    auto_stop_interval:,
    auto_archive_interval:,
    auto_delete_interval:,
    volumes:,
    network_block_all:,
    network_allow_list:,
    ephemeral:
  }.compact
end