Class: Daytona::WarmPool
- Inherits:
-
Object
- Object
- Daytona::WarmPool
- 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
- #cpu ⇒ Integer readonly
- #created_at ⇒ String readonly
- #current_size ⇒ Integer readonly
- #disk ⇒ Integer readonly
- #env ⇒ Hash{String => String} readonly
- #error_reason ⇒ String? readonly
- #id ⇒ String readonly
- #mem ⇒ Integer readonly
- #organization_id ⇒ String readonly
- #os_user ⇒ String readonly
- #pool ⇒ Integer readonly
- #snapshot ⇒ String readonly
- #target ⇒ String readonly
- #updated_at ⇒ String readonly
Instance Method Summary collapse
-
#initialize(warm_pool_dto) ⇒ WarmPool
constructor
Initialize warm pool from DTO.
Constructor Details
#initialize(warm_pool_dto) ⇒ WarmPool
Initialize warm pool from DTO
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
#cpu ⇒ Integer (readonly)
31 32 33 |
# File 'lib/daytona/warm_pool.rb', line 31 def cpu @cpu end |
#created_at ⇒ String (readonly)
49 50 51 |
# File 'lib/daytona/warm_pool.rb', line 49 def created_at @created_at end |
#current_size ⇒ Integer (readonly)
28 29 30 |
# File 'lib/daytona/warm_pool.rb', line 28 def current_size @current_size end |
#disk ⇒ Integer (readonly)
37 38 39 |
# File 'lib/daytona/warm_pool.rb', line 37 def disk @disk end |
#env ⇒ Hash{String => String} (readonly)
43 44 45 |
# File 'lib/daytona/warm_pool.rb', line 43 def env @env end |
#error_reason ⇒ String? (readonly)
46 47 48 |
# File 'lib/daytona/warm_pool.rb', line 46 def error_reason @error_reason end |
#id ⇒ String (readonly)
13 14 15 |
# File 'lib/daytona/warm_pool.rb', line 13 def id @id end |
#mem ⇒ Integer (readonly)
34 35 36 |
# File 'lib/daytona/warm_pool.rb', line 34 def mem @mem end |
#organization_id ⇒ String (readonly)
16 17 18 |
# File 'lib/daytona/warm_pool.rb', line 16 def organization_id @organization_id end |
#os_user ⇒ String (readonly)
40 41 42 |
# File 'lib/daytona/warm_pool.rb', line 40 def os_user @os_user end |
#pool ⇒ Integer (readonly)
25 26 27 |
# File 'lib/daytona/warm_pool.rb', line 25 def pool @pool end |
#snapshot ⇒ String (readonly)
19 20 21 |
# File 'lib/daytona/warm_pool.rb', line 19 def snapshot @snapshot end |
#target ⇒ String (readonly)
22 23 24 |
# File 'lib/daytona/warm_pool.rb', line 22 def target @target end |
#updated_at ⇒ String (readonly)
52 53 54 |
# File 'lib/daytona/warm_pool.rb', line 52 def updated_at @updated_at end |