Class: Daytona::WarmPool

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

Overview

A warm pool of ready-to-use Sandboxes for a snapshot. current_size versus pool is the pool's status: current_size is the number of ready warm sandboxes, pool is the desired number. error_reason is set when the pool cannot be filled.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(warm_pool_dto) ⇒ WarmPool

Initialize warm pool from DTO

Parameters:

  • warm_pool_dto (DaytonaApiClient::WarmPool)


57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/daytona/warm_pool.rb', line 57

def initialize(warm_pool_dto)
  @id = warm_pool_dto.id
  @organization_id = warm_pool_dto.organization_id
  @snapshot = warm_pool_dto.snapshot
  @target = warm_pool_dto.target
  # The generated client deserializes OpenAPI numbers as Float; these are all integral.
  @pool = warm_pool_dto.pool.to_i
  @current_size = warm_pool_dto.current_size.to_i
  @cpu = warm_pool_dto.cpu.to_i
  @mem = warm_pool_dto.mem.to_i
  @disk = warm_pool_dto.disk.to_i
  @os_user = warm_pool_dto.os_user
  @env = warm_pool_dto.env
  @error_reason = warm_pool_dto.error_reason
  @created_at = warm_pool_dto.created_at
  @updated_at = warm_pool_dto.updated_at
end

Instance Attribute Details

#cpuInteger (readonly)

Returns:

  • (Integer)


31
32
33
# File 'lib/daytona/warm_pool.rb', line 31

def cpu
  @cpu
end

#created_atString (readonly)

Returns:

  • (String)


49
50
51
# File 'lib/daytona/warm_pool.rb', line 49

def created_at
  @created_at
end

#current_sizeInteger (readonly)

Returns:

  • (Integer)


28
29
30
# File 'lib/daytona/warm_pool.rb', line 28

def current_size
  @current_size
end

#diskInteger (readonly)

Returns:

  • (Integer)


37
38
39
# File 'lib/daytona/warm_pool.rb', line 37

def disk
  @disk
end

#envHash{String => String} (readonly)

Returns:

  • (Hash{String => String})


43
44
45
# File 'lib/daytona/warm_pool.rb', line 43

def env
  @env
end

#error_reasonString? (readonly)

Returns:

  • (String, nil)


46
47
48
# File 'lib/daytona/warm_pool.rb', line 46

def error_reason
  @error_reason
end

#idString (readonly)

Returns:

  • (String)


13
14
15
# File 'lib/daytona/warm_pool.rb', line 13

def id
  @id
end

#memInteger (readonly)

Returns:

  • (Integer)


34
35
36
# File 'lib/daytona/warm_pool.rb', line 34

def mem
  @mem
end

#organization_idString (readonly)

Returns:

  • (String)


16
17
18
# File 'lib/daytona/warm_pool.rb', line 16

def organization_id
  @organization_id
end

#os_userString (readonly)

Returns:

  • (String)


40
41
42
# File 'lib/daytona/warm_pool.rb', line 40

def os_user
  @os_user
end

#poolInteger (readonly)

Returns:

  • (Integer)


25
26
27
# File 'lib/daytona/warm_pool.rb', line 25

def pool
  @pool
end

#snapshotString (readonly)

Returns:

  • (String)


19
20
21
# File 'lib/daytona/warm_pool.rb', line 19

def snapshot
  @snapshot
end

#targetString (readonly)

Returns:

  • (String)


22
23
24
# File 'lib/daytona/warm_pool.rb', line 22

def target
  @target
end

#updated_atString (readonly)

Returns:

  • (String)


52
53
54
# File 'lib/daytona/warm_pool.rb', line 52

def updated_at
  @updated_at
end