Class: DaytonaApiClient::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/daytona_api_client/models/runner.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Runner

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
# File 'lib/daytona_api_client/models/runner.rb', line 215

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::Runner` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  acceptable_attribute_map = self.class.acceptable_attribute_map
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::Runner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'id')
    self.id = attributes[:'id']
  else
    self.id = nil
  end

  if attributes.key?(:'domain')
    self.domain = attributes[:'domain']
  end

  if attributes.key?(:'api_url')
    self.api_url = attributes[:'api_url']
  end

  if attributes.key?(:'proxy_url')
    self.proxy_url = attributes[:'proxy_url']
  end

  if attributes.key?(:'cpu')
    self.cpu = attributes[:'cpu']
  else
    self.cpu = nil
  end

  if attributes.key?(:'memory')
    self.memory = attributes[:'memory']
  else
    self.memory = nil
  end

  if attributes.key?(:'disk')
    self.disk = attributes[:'disk']
  else
    self.disk = nil
  end

  if attributes.key?(:'gpu')
    self.gpu = attributes[:'gpu']
  end

  if attributes.key?(:'gpu_type')
    self.gpu_type = attributes[:'gpu_type']
  end

  if attributes.key?(:'_class')
    self._class = attributes[:'_class']
  else
    self._class = nil
  end

  if attributes.key?(:'current_cpu_usage_percentage')
    self.current_cpu_usage_percentage = attributes[:'current_cpu_usage_percentage']
  end

  if attributes.key?(:'current_memory_usage_percentage')
    self.current_memory_usage_percentage = attributes[:'current_memory_usage_percentage']
  end

  if attributes.key?(:'current_disk_usage_percentage')
    self.current_disk_usage_percentage = attributes[:'current_disk_usage_percentage']
  end

  if attributes.key?(:'current_allocated_cpu')
    self.current_allocated_cpu = attributes[:'current_allocated_cpu']
  end

  if attributes.key?(:'current_allocated_memory_gi_b')
    self.current_allocated_memory_gi_b = attributes[:'current_allocated_memory_gi_b']
  end

  if attributes.key?(:'current_allocated_disk_gi_b')
    self.current_allocated_disk_gi_b = attributes[:'current_allocated_disk_gi_b']
  end

  if attributes.key?(:'current_snapshot_count')
    self.current_snapshot_count = attributes[:'current_snapshot_count']
  end

  if attributes.key?(:'current_started_sandboxes')
    self.current_started_sandboxes = attributes[:'current_started_sandboxes']
  end

  if attributes.key?(:'availability_score')
    self.availability_score = attributes[:'availability_score']
  end

  if attributes.key?(:'region')
    self.region = attributes[:'region']
  else
    self.region = nil
  end

  if attributes.key?(:'name')
    self.name = attributes[:'name']
  else
    self.name = nil
  end

  if attributes.key?(:'state')
    self.state = attributes[:'state']
  else
    self.state = nil
  end

  if attributes.key?(:'last_checked')
    self.last_checked = attributes[:'last_checked']
  end

  if attributes.key?(:'unschedulable')
    self.unschedulable = attributes[:'unschedulable']
  else
    self.unschedulable = nil
  end

  if attributes.key?(:'created_at')
    self.created_at = attributes[:'created_at']
  else
    self.created_at = nil
  end

  if attributes.key?(:'updated_at')
    self.updated_at = attributes[:'updated_at']
  else
    self.updated_at = nil
  end

  if attributes.key?(:'version')
    self.version = attributes[:'version']
  else
    self.version = nil
  end

  if attributes.key?(:'api_version')
    self.api_version = attributes[:'api_version']
  else
    self.api_version = nil
  end

  if attributes.key?(:'app_version')
    self.app_version = attributes[:'app_version']
  end
end

Instance Attribute Details

#_classObject

The class of the runner



46
47
48
# File 'lib/daytona_api_client/models/runner.rb', line 46

def _class
  @_class
end

#api_urlObject

The API URL of the runner



25
26
27
# File 'lib/daytona_api_client/models/runner.rb', line 25

def api_url
  @api_url
end

#api_versionObject

The api version of the runner



100
101
102
# File 'lib/daytona_api_client/models/runner.rb', line 100

def api_version
  @api_version
end

#app_versionObject

The app version of the runner



103
104
105
# File 'lib/daytona_api_client/models/runner.rb', line 103

def app_version
  @app_version
end

#availability_scoreObject

Runner availability score



73
74
75
# File 'lib/daytona_api_client/models/runner.rb', line 73

def availability_score
  @availability_score
end

#cpuObject

The CPU capacity of the runner



31
32
33
# File 'lib/daytona_api_client/models/runner.rb', line 31

def cpu
  @cpu
end

#created_atObject

The creation timestamp of the runner



91
92
93
# File 'lib/daytona_api_client/models/runner.rb', line 91

def created_at
  @created_at
end

#current_allocated_cpuObject

Current allocated CPU



58
59
60
# File 'lib/daytona_api_client/models/runner.rb', line 58

def current_allocated_cpu
  @current_allocated_cpu
end

#current_allocated_disk_gi_bObject

Current allocated disk in GiB



64
65
66
# File 'lib/daytona_api_client/models/runner.rb', line 64

def current_allocated_disk_gi_b
  @current_allocated_disk_gi_b
end

#current_allocated_memory_gi_bObject

Current allocated memory in GiB



61
62
63
# File 'lib/daytona_api_client/models/runner.rb', line 61

def current_allocated_memory_gi_b
  @current_allocated_memory_gi_b
end

#current_cpu_usage_percentageObject

Current CPU usage percentage



49
50
51
# File 'lib/daytona_api_client/models/runner.rb', line 49

def current_cpu_usage_percentage
  @current_cpu_usage_percentage
end

#current_disk_usage_percentageObject

Current disk usage percentage



55
56
57
# File 'lib/daytona_api_client/models/runner.rb', line 55

def current_disk_usage_percentage
  @current_disk_usage_percentage
end

#current_memory_usage_percentageObject

Current RAM usage percentage



52
53
54
# File 'lib/daytona_api_client/models/runner.rb', line 52

def current_memory_usage_percentage
  @current_memory_usage_percentage
end

#current_snapshot_countObject

Current snapshot count



67
68
69
# File 'lib/daytona_api_client/models/runner.rb', line 67

def current_snapshot_count
  @current_snapshot_count
end

#current_started_sandboxesObject

Current number of started sandboxes



70
71
72
# File 'lib/daytona_api_client/models/runner.rb', line 70

def current_started_sandboxes
  @current_started_sandboxes
end

#diskObject

The disk capacity of the runner in GiB



37
38
39
# File 'lib/daytona_api_client/models/runner.rb', line 37

def disk
  @disk
end

#domainObject

The domain of the runner



22
23
24
# File 'lib/daytona_api_client/models/runner.rb', line 22

def domain
  @domain
end

#gpuObject

The GPU capacity of the runner



40
41
42
# File 'lib/daytona_api_client/models/runner.rb', line 40

def gpu
  @gpu
end

#gpu_typeObject

The type of GPU



43
44
45
# File 'lib/daytona_api_client/models/runner.rb', line 43

def gpu_type
  @gpu_type
end

#idObject

The ID of the runner



19
20
21
# File 'lib/daytona_api_client/models/runner.rb', line 19

def id
  @id
end

#last_checkedObject

The last time the runner was checked



85
86
87
# File 'lib/daytona_api_client/models/runner.rb', line 85

def last_checked
  @last_checked
end

#memoryObject

The memory capacity of the runner in GiB



34
35
36
# File 'lib/daytona_api_client/models/runner.rb', line 34

def memory
  @memory
end

#nameObject

The name of the runner



79
80
81
# File 'lib/daytona_api_client/models/runner.rb', line 79

def name
  @name
end

#proxy_urlObject

The proxy URL of the runner



28
29
30
# File 'lib/daytona_api_client/models/runner.rb', line 28

def proxy_url
  @proxy_url
end

#regionObject

The region of the runner



76
77
78
# File 'lib/daytona_api_client/models/runner.rb', line 76

def region
  @region
end

#stateObject

The state of the runner



82
83
84
# File 'lib/daytona_api_client/models/runner.rb', line 82

def state
  @state
end

#unschedulableObject

Whether the runner is unschedulable



88
89
90
# File 'lib/daytona_api_client/models/runner.rb', line 88

def unschedulable
  @unschedulable
end

#updated_atObject

The last update timestamp of the runner



94
95
96
# File 'lib/daytona_api_client/models/runner.rb', line 94

def updated_at
  @updated_at
end

#versionObject

The version of the runner (deprecated in favor of apiVersion)



97
98
99
# File 'lib/daytona_api_client/models/runner.rb', line 97

def version
  @version
end

Class Method Details

._deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
# File 'lib/daytona_api_client/models/runner.rb', line 657

def self._deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = DaytonaApiClient.const_get(type)
    klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



163
164
165
# File 'lib/daytona_api_client/models/runner.rb', line 163

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



168
169
170
# File 'lib/daytona_api_client/models/runner.rb', line 168

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



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
159
160
# File 'lib/daytona_api_client/models/runner.rb', line 128

def self.attribute_map
  {
    :'id' => :'id',
    :'domain' => :'domain',
    :'api_url' => :'apiUrl',
    :'proxy_url' => :'proxyUrl',
    :'cpu' => :'cpu',
    :'memory' => :'memory',
    :'disk' => :'disk',
    :'gpu' => :'gpu',
    :'gpu_type' => :'gpuType',
    :'_class' => :'class',
    :'current_cpu_usage_percentage' => :'currentCpuUsagePercentage',
    :'current_memory_usage_percentage' => :'currentMemoryUsagePercentage',
    :'current_disk_usage_percentage' => :'currentDiskUsagePercentage',
    :'current_allocated_cpu' => :'currentAllocatedCpu',
    :'current_allocated_memory_gi_b' => :'currentAllocatedMemoryGiB',
    :'current_allocated_disk_gi_b' => :'currentAllocatedDiskGiB',
    :'current_snapshot_count' => :'currentSnapshotCount',
    :'current_started_sandboxes' => :'currentStartedSandboxes',
    :'availability_score' => :'availabilityScore',
    :'region' => :'region',
    :'name' => :'name',
    :'state' => :'state',
    :'last_checked' => :'lastChecked',
    :'unschedulable' => :'unschedulable',
    :'created_at' => :'createdAt',
    :'updated_at' => :'updatedAt',
    :'version' => :'version',
    :'api_version' => :'apiVersion',
    :'app_version' => :'appVersion'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
# File 'lib/daytona_api_client/models/runner.rb', line 633

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



208
209
210
211
# File 'lib/daytona_api_client/models/runner.rb', line 208

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# File 'lib/daytona_api_client/models/runner.rb', line 173

def self.openapi_types
  {
    :'id' => :'String',
    :'domain' => :'String',
    :'api_url' => :'String',
    :'proxy_url' => :'String',
    :'cpu' => :'Float',
    :'memory' => :'Float',
    :'disk' => :'Float',
    :'gpu' => :'Float',
    :'gpu_type' => :'String',
    :'_class' => :'SandboxClass',
    :'current_cpu_usage_percentage' => :'Float',
    :'current_memory_usage_percentage' => :'Float',
    :'current_disk_usage_percentage' => :'Float',
    :'current_allocated_cpu' => :'Float',
    :'current_allocated_memory_gi_b' => :'Float',
    :'current_allocated_disk_gi_b' => :'Float',
    :'current_snapshot_count' => :'Float',
    :'current_started_sandboxes' => :'Float',
    :'availability_score' => :'Float',
    :'region' => :'String',
    :'name' => :'String',
    :'state' => :'RunnerState',
    :'last_checked' => :'String',
    :'unschedulable' => :'Boolean',
    :'created_at' => :'String',
    :'updated_at' => :'String',
    :'version' => :'String',
    :'api_version' => :'String',
    :'app_version' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
# File 'lib/daytona_api_client/models/runner.rb', line 584

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      domain == o.domain &&
      api_url == o.api_url &&
      proxy_url == o.proxy_url &&
      cpu == o.cpu &&
      memory == o.memory &&
      disk == o.disk &&
      gpu == o.gpu &&
      gpu_type == o.gpu_type &&
      _class == o._class &&
      current_cpu_usage_percentage == o.current_cpu_usage_percentage &&
      current_memory_usage_percentage == o.current_memory_usage_percentage &&
      current_disk_usage_percentage == o.current_disk_usage_percentage &&
      current_allocated_cpu == o.current_allocated_cpu &&
      current_allocated_memory_gi_b == o.current_allocated_memory_gi_b &&
      current_allocated_disk_gi_b == o.current_allocated_disk_gi_b &&
      current_snapshot_count == o.current_snapshot_count &&
      current_started_sandboxes == o.current_started_sandboxes &&
      availability_score == o.availability_score &&
      region == o.region &&
      name == o.name &&
      state == o.state &&
      last_checked == o.last_checked &&
      unschedulable == o.unschedulable &&
      created_at == o.created_at &&
      updated_at == o.updated_at &&
      version == o.version &&
      api_version == o.api_version &&
      app_version == o.app_version
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



728
729
730
731
732
733
734
735
736
737
738
739
740
# File 'lib/daytona_api_client/models/runner.rb', line 728

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


620
621
622
# File 'lib/daytona_api_client/models/runner.rb', line 620

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



626
627
628
# File 'lib/daytona_api_client/models/runner.rb', line 626

def hash
  [id, domain, api_url, proxy_url, cpu, memory, disk, gpu, gpu_type, _class, current_cpu_usage_percentage, current_memory_usage_percentage, current_disk_usage_percentage, current_allocated_cpu, current_allocated_memory_gi_b, current_allocated_disk_gi_b, current_snapshot_count, current_started_sandboxes, availability_score, region, name, state, last_checked, unschedulable, created_at, updated_at, version, api_version, app_version].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
# File 'lib/daytona_api_client/models/runner.rb', line 374

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  if @id.nil?
    invalid_properties.push('invalid value for "id", id cannot be nil.')
  end

  if @cpu.nil?
    invalid_properties.push('invalid value for "cpu", cpu cannot be nil.')
  end

  if @memory.nil?
    invalid_properties.push('invalid value for "memory", memory cannot be nil.')
  end

  if @disk.nil?
    invalid_properties.push('invalid value for "disk", disk cannot be nil.')
  end

  if @_class.nil?
    invalid_properties.push('invalid value for "_class", _class cannot be nil.')
  end

  if @region.nil?
    invalid_properties.push('invalid value for "region", region cannot be nil.')
  end

  if @name.nil?
    invalid_properties.push('invalid value for "name", name cannot be nil.')
  end

  if @state.nil?
    invalid_properties.push('invalid value for "state", state cannot be nil.')
  end

  if @unschedulable.nil?
    invalid_properties.push('invalid value for "unschedulable", unschedulable cannot be nil.')
  end

  if @created_at.nil?
    invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
  end

  if @updated_at.nil?
    invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
  end

  if @version.nil?
    invalid_properties.push('invalid value for "version", version cannot be nil.')
  end

  if @api_version.nil?
    invalid_properties.push('invalid value for "api_version", api_version cannot be nil.')
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



704
705
706
# File 'lib/daytona_api_client/models/runner.rb', line 704

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



710
711
712
713
714
715
716
717
718
719
720
721
722
# File 'lib/daytona_api_client/models/runner.rb', line 710

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



698
699
700
# File 'lib/daytona_api_client/models/runner.rb', line 698

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
# File 'lib/daytona_api_client/models/runner.rb', line 434

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @id.nil?
  return false if @cpu.nil?
  return false if @memory.nil?
  return false if @disk.nil?
  return false if @_class.nil?
  return false if @region.nil?
  return false if @name.nil?
  return false if @state.nil?
  return false if @unschedulable.nil?
  return false if @created_at.nil?
  return false if @updated_at.nil?
  return false if @version.nil?
  return false if @api_version.nil?
  true
end