daytona_api_client 0.139.0 → 0.140.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.openapi-generator/FILES +1 -0
- data/lib/daytona_api_client/api/admin_api.rb +61 -0
- data/lib/daytona_api_client/api/sandbox_api.rb +76 -1
- data/lib/daytona_api_client/models/job_type.rb +2 -1
- data/lib/daytona_api_client/models/organization_suspension.rb +7 -5
- data/lib/daytona_api_client/models/resize_sandbox.rb +296 -0
- data/lib/daytona_api_client/models/sandbox_state.rb +2 -1
- data/lib/daytona_api_client/models/update_sandbox_state_dto.rb +2 -2
- data/lib/daytona_api_client/version.rb +1 -1
- data/lib/daytona_api_client.rb +1 -0
- data/project.json +9 -4
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ae54be0deb2e73339d853f8bffb393a1da9692e8546f5c68bd26096bd3994b5c
|
|
4
|
+
data.tar.gz: f01c592372f09bd2bab841f421fdec67efcfc8a3310ad67c97c412e1cfa4fbf8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 85ee7bd74ec916fc3ad4d284117a0aa217ae11b435515238374899ec3b6f49de2f3cfdf5612be12a282c2b4846a7c58dd53f0453e354124d39e40b7710a961ad
|
|
7
|
+
data.tar.gz: 3adc6d599e6dec5269d701fd53b5ec71dce6f85f5ed776cf3882d2d97bc01e4db471add17b0f571a122d403b6dce70805c9bfa183a7f687779410b404aac2fcb
|
data/.openapi-generator/FILES
CHANGED
|
@@ -140,6 +140,7 @@ lib/daytona_api_client/models/region_usage_overview.rb
|
|
|
140
140
|
lib/daytona_api_client/models/registry_push_access_dto.rb
|
|
141
141
|
lib/daytona_api_client/models/replace_request.rb
|
|
142
142
|
lib/daytona_api_client/models/replace_result.rb
|
|
143
|
+
lib/daytona_api_client/models/resize_sandbox.rb
|
|
143
144
|
lib/daytona_api_client/models/runner.rb
|
|
144
145
|
lib/daytona_api_client/models/runner_full.rb
|
|
145
146
|
lib/daytona_api_client/models/runner_health_metrics.rb
|
|
@@ -263,6 +263,67 @@ module DaytonaApiClient
|
|
|
263
263
|
return data, status_code, headers
|
|
264
264
|
end
|
|
265
265
|
|
|
266
|
+
# Recover sandbox from error state as an admin
|
|
267
|
+
# @param sandbox_id [String] ID of the sandbox
|
|
268
|
+
# @param [Hash] opts the optional parameters
|
|
269
|
+
# @return [Sandbox]
|
|
270
|
+
def admin_recover_sandbox(sandbox_id, opts = {})
|
|
271
|
+
data, _status_code, _headers = admin_recover_sandbox_with_http_info(sandbox_id, opts)
|
|
272
|
+
data
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
# Recover sandbox from error state as an admin
|
|
276
|
+
# @param sandbox_id [String] ID of the sandbox
|
|
277
|
+
# @param [Hash] opts the optional parameters
|
|
278
|
+
# @return [Array<(Sandbox, Integer, Hash)>] Sandbox data, response status code and response headers
|
|
279
|
+
def admin_recover_sandbox_with_http_info(sandbox_id, opts = {})
|
|
280
|
+
if @api_client.config.debugging
|
|
281
|
+
@api_client.config.logger.debug 'Calling API: AdminApi.admin_recover_sandbox ...'
|
|
282
|
+
end
|
|
283
|
+
# verify the required parameter 'sandbox_id' is set
|
|
284
|
+
if @api_client.config.client_side_validation && sandbox_id.nil?
|
|
285
|
+
fail ArgumentError, "Missing the required parameter 'sandbox_id' when calling AdminApi.admin_recover_sandbox"
|
|
286
|
+
end
|
|
287
|
+
# resource path
|
|
288
|
+
local_var_path = '/admin/sandbox/{sandboxId}/recover'.sub('{' + 'sandboxId' + '}', CGI.escape(sandbox_id.to_s))
|
|
289
|
+
|
|
290
|
+
# query parameters
|
|
291
|
+
query_params = opts[:query_params] || {}
|
|
292
|
+
|
|
293
|
+
# header parameters
|
|
294
|
+
header_params = opts[:header_params] || {}
|
|
295
|
+
# HTTP header 'Accept' (if needed)
|
|
296
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
297
|
+
|
|
298
|
+
# form parameters
|
|
299
|
+
form_params = opts[:form_params] || {}
|
|
300
|
+
|
|
301
|
+
# http body (model)
|
|
302
|
+
post_body = opts[:debug_body]
|
|
303
|
+
|
|
304
|
+
# return_type
|
|
305
|
+
return_type = opts[:debug_return_type] || 'Sandbox'
|
|
306
|
+
|
|
307
|
+
# auth_names
|
|
308
|
+
auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
|
|
309
|
+
|
|
310
|
+
new_options = opts.merge(
|
|
311
|
+
:operation => :"AdminApi.admin_recover_sandbox",
|
|
312
|
+
:header_params => header_params,
|
|
313
|
+
:query_params => query_params,
|
|
314
|
+
:form_params => form_params,
|
|
315
|
+
:body => post_body,
|
|
316
|
+
:auth_names => auth_names,
|
|
317
|
+
:return_type => return_type
|
|
318
|
+
)
|
|
319
|
+
|
|
320
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
321
|
+
if @api_client.config.debugging
|
|
322
|
+
@api_client.config.logger.debug "API called: AdminApi#admin_recover_sandbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
323
|
+
end
|
|
324
|
+
return data, status_code, headers
|
|
325
|
+
end
|
|
326
|
+
|
|
266
327
|
# Update runner scheduling status
|
|
267
328
|
# @param id [String]
|
|
268
329
|
# @param [Hash] opts the optional parameters
|
|
@@ -1024,7 +1024,7 @@ module DaytonaApiClient
|
|
|
1024
1024
|
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SandboxApi.list_sandboxes_paginated, must be greater than or equal to 1.'
|
|
1025
1025
|
end
|
|
1026
1026
|
|
|
1027
|
-
allowable_values = ["creating", "restoring", "destroying", "started", "stopped", "starting", "stopping", "error", "build_failed", "pending_build", "building_snapshot", "unknown", "pulling_snapshot", "archived", "archiving"]
|
|
1027
|
+
allowable_values = ["creating", "restoring", "destroying", "started", "stopped", "starting", "stopping", "error", "build_failed", "pending_build", "building_snapshot", "unknown", "pulling_snapshot", "archived", "archiving", "resizing"]
|
|
1028
1028
|
if @api_client.config.client_side_validation && opts[:'states'] && !opts[:'states'].all? { |item| allowable_values.include?(item) }
|
|
1029
1029
|
fail ArgumentError, "invalid value for \"states\", must include one of #{allowable_values}"
|
|
1030
1030
|
end
|
|
@@ -1259,6 +1259,81 @@ module DaytonaApiClient
|
|
|
1259
1259
|
return data, status_code, headers
|
|
1260
1260
|
end
|
|
1261
1261
|
|
|
1262
|
+
# Resize sandbox resources
|
|
1263
|
+
# @param sandbox_id_or_name [String] ID or name of the sandbox
|
|
1264
|
+
# @param resize_sandbox [ResizeSandbox]
|
|
1265
|
+
# @param [Hash] opts the optional parameters
|
|
1266
|
+
# @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
|
|
1267
|
+
# @return [Sandbox]
|
|
1268
|
+
def resize_sandbox(sandbox_id_or_name, resize_sandbox, opts = {})
|
|
1269
|
+
data, _status_code, _headers = resize_sandbox_with_http_info(sandbox_id_or_name, resize_sandbox, opts)
|
|
1270
|
+
data
|
|
1271
|
+
end
|
|
1272
|
+
|
|
1273
|
+
# Resize sandbox resources
|
|
1274
|
+
# @param sandbox_id_or_name [String] ID or name of the sandbox
|
|
1275
|
+
# @param resize_sandbox [ResizeSandbox]
|
|
1276
|
+
# @param [Hash] opts the optional parameters
|
|
1277
|
+
# @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
|
|
1278
|
+
# @return [Array<(Sandbox, Integer, Hash)>] Sandbox data, response status code and response headers
|
|
1279
|
+
def resize_sandbox_with_http_info(sandbox_id_or_name, resize_sandbox, opts = {})
|
|
1280
|
+
if @api_client.config.debugging
|
|
1281
|
+
@api_client.config.logger.debug 'Calling API: SandboxApi.resize_sandbox ...'
|
|
1282
|
+
end
|
|
1283
|
+
# verify the required parameter 'sandbox_id_or_name' is set
|
|
1284
|
+
if @api_client.config.client_side_validation && sandbox_id_or_name.nil?
|
|
1285
|
+
fail ArgumentError, "Missing the required parameter 'sandbox_id_or_name' when calling SandboxApi.resize_sandbox"
|
|
1286
|
+
end
|
|
1287
|
+
# verify the required parameter 'resize_sandbox' is set
|
|
1288
|
+
if @api_client.config.client_side_validation && resize_sandbox.nil?
|
|
1289
|
+
fail ArgumentError, "Missing the required parameter 'resize_sandbox' when calling SandboxApi.resize_sandbox"
|
|
1290
|
+
end
|
|
1291
|
+
# resource path
|
|
1292
|
+
local_var_path = '/sandbox/{sandboxIdOrName}/resize'.sub('{' + 'sandboxIdOrName' + '}', CGI.escape(sandbox_id_or_name.to_s))
|
|
1293
|
+
|
|
1294
|
+
# query parameters
|
|
1295
|
+
query_params = opts[:query_params] || {}
|
|
1296
|
+
|
|
1297
|
+
# header parameters
|
|
1298
|
+
header_params = opts[:header_params] || {}
|
|
1299
|
+
# HTTP header 'Accept' (if needed)
|
|
1300
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1301
|
+
# HTTP header 'Content-Type'
|
|
1302
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
1303
|
+
if !content_type.nil?
|
|
1304
|
+
header_params['Content-Type'] = content_type
|
|
1305
|
+
end
|
|
1306
|
+
header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?
|
|
1307
|
+
|
|
1308
|
+
# form parameters
|
|
1309
|
+
form_params = opts[:form_params] || {}
|
|
1310
|
+
|
|
1311
|
+
# http body (model)
|
|
1312
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(resize_sandbox)
|
|
1313
|
+
|
|
1314
|
+
# return_type
|
|
1315
|
+
return_type = opts[:debug_return_type] || 'Sandbox'
|
|
1316
|
+
|
|
1317
|
+
# auth_names
|
|
1318
|
+
auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
|
|
1319
|
+
|
|
1320
|
+
new_options = opts.merge(
|
|
1321
|
+
:operation => :"SandboxApi.resize_sandbox",
|
|
1322
|
+
:header_params => header_params,
|
|
1323
|
+
:query_params => query_params,
|
|
1324
|
+
:form_params => form_params,
|
|
1325
|
+
:body => post_body,
|
|
1326
|
+
:auth_names => auth_names,
|
|
1327
|
+
:return_type => return_type
|
|
1328
|
+
)
|
|
1329
|
+
|
|
1330
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
1331
|
+
if @api_client.config.debugging
|
|
1332
|
+
@api_client.config.logger.debug "API called: SandboxApi#resize_sandbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1333
|
+
end
|
|
1334
|
+
return data, status_code, headers
|
|
1335
|
+
end
|
|
1336
|
+
|
|
1262
1337
|
# Revoke SSH access for sandbox
|
|
1263
1338
|
# @param sandbox_id_or_name [String] ID or name of the sandbox
|
|
1264
1339
|
# @param [Hash] opts the optional parameters
|
|
@@ -19,6 +19,7 @@ module DaytonaApiClient
|
|
|
19
19
|
START_SANDBOX = "START_SANDBOX".freeze
|
|
20
20
|
STOP_SANDBOX = "STOP_SANDBOX".freeze
|
|
21
21
|
DESTROY_SANDBOX = "DESTROY_SANDBOX".freeze
|
|
22
|
+
RESIZE_SANDBOX = "RESIZE_SANDBOX".freeze
|
|
22
23
|
CREATE_BACKUP = "CREATE_BACKUP".freeze
|
|
23
24
|
BUILD_SNAPSHOT = "BUILD_SNAPSHOT".freeze
|
|
24
25
|
PULL_SNAPSHOT = "PULL_SNAPSHOT".freeze
|
|
@@ -28,7 +29,7 @@ module DaytonaApiClient
|
|
|
28
29
|
UPDATE_SANDBOX_NETWORK_SETTINGS = "UPDATE_SANDBOX_NETWORK_SETTINGS".freeze
|
|
29
30
|
|
|
30
31
|
def self.all_vars
|
|
31
|
-
@all_vars ||= [CREATE_SANDBOX, START_SANDBOX, STOP_SANDBOX, DESTROY_SANDBOX, CREATE_BACKUP, BUILD_SNAPSHOT, PULL_SNAPSHOT, RECOVER_SANDBOX, INSPECT_SNAPSHOT_IN_REGISTRY, REMOVE_SNAPSHOT, UPDATE_SANDBOX_NETWORK_SETTINGS].freeze
|
|
32
|
+
@all_vars ||= [CREATE_SANDBOX, START_SANDBOX, STOP_SANDBOX, DESTROY_SANDBOX, RESIZE_SANDBOX, CREATE_BACKUP, BUILD_SNAPSHOT, PULL_SNAPSHOT, RECOVER_SANDBOX, INSPECT_SNAPSHOT_IN_REGISTRY, REMOVE_SNAPSHOT, UPDATE_SANDBOX_NETWORK_SETTINGS].freeze
|
|
32
33
|
end
|
|
33
34
|
|
|
34
35
|
# Builds the enum from string
|
|
@@ -88,8 +88,6 @@ module DaytonaApiClient
|
|
|
88
88
|
|
|
89
89
|
if attributes.key?(:'suspension_cleanup_grace_period_hours')
|
|
90
90
|
self.suspension_cleanup_grace_period_hours = attributes[:'suspension_cleanup_grace_period_hours']
|
|
91
|
-
else
|
|
92
|
-
self.suspension_cleanup_grace_period_hours = nil
|
|
93
91
|
end
|
|
94
92
|
end
|
|
95
93
|
|
|
@@ -106,8 +104,8 @@ module DaytonaApiClient
|
|
|
106
104
|
invalid_properties.push('invalid value for "_until", _until cannot be nil.')
|
|
107
105
|
end
|
|
108
106
|
|
|
109
|
-
if
|
|
110
|
-
invalid_properties.push('invalid value for "suspension_cleanup_grace_period_hours",
|
|
107
|
+
if !@suspension_cleanup_grace_period_hours.nil? && @suspension_cleanup_grace_period_hours < 0
|
|
108
|
+
invalid_properties.push('invalid value for "suspension_cleanup_grace_period_hours", must be greater than or equal to 0.')
|
|
111
109
|
end
|
|
112
110
|
|
|
113
111
|
invalid_properties
|
|
@@ -119,7 +117,7 @@ module DaytonaApiClient
|
|
|
119
117
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
120
118
|
return false if @reason.nil?
|
|
121
119
|
return false if @_until.nil?
|
|
122
|
-
return false if
|
|
120
|
+
return false if !@suspension_cleanup_grace_period_hours.nil? && @suspension_cleanup_grace_period_hours < 0
|
|
123
121
|
true
|
|
124
122
|
end
|
|
125
123
|
|
|
@@ -150,6 +148,10 @@ module DaytonaApiClient
|
|
|
150
148
|
fail ArgumentError, 'suspension_cleanup_grace_period_hours cannot be nil'
|
|
151
149
|
end
|
|
152
150
|
|
|
151
|
+
if suspension_cleanup_grace_period_hours < 0
|
|
152
|
+
fail ArgumentError, 'invalid value for "suspension_cleanup_grace_period_hours", must be greater than or equal to 0.'
|
|
153
|
+
end
|
|
154
|
+
|
|
153
155
|
@suspension_cleanup_grace_period_hours = suspension_cleanup_grace_period_hours
|
|
154
156
|
end
|
|
155
157
|
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Daytona
|
|
3
|
+
|
|
4
|
+
#Daytona AI platform API Docs
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0
|
|
7
|
+
Contact: support@daytona.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.12.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module DaytonaApiClient
|
|
17
|
+
class ResizeSandbox
|
|
18
|
+
# CPU cores to allocate to the sandbox (minimum: 1)
|
|
19
|
+
attr_accessor :cpu
|
|
20
|
+
|
|
21
|
+
# Memory in GB to allocate to the sandbox (minimum: 1)
|
|
22
|
+
attr_accessor :memory
|
|
23
|
+
|
|
24
|
+
# Disk space in GB to allocate to the sandbox (can only be increased)
|
|
25
|
+
attr_accessor :disk
|
|
26
|
+
|
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
28
|
+
def self.attribute_map
|
|
29
|
+
{
|
|
30
|
+
:'cpu' => :'cpu',
|
|
31
|
+
:'memory' => :'memory',
|
|
32
|
+
:'disk' => :'disk'
|
|
33
|
+
}
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Returns attribute mapping this model knows about
|
|
37
|
+
def self.acceptable_attribute_map
|
|
38
|
+
attribute_map
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Returns all the JSON keys this model knows about
|
|
42
|
+
def self.acceptable_attributes
|
|
43
|
+
acceptable_attribute_map.values
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Attribute type mapping.
|
|
47
|
+
def self.openapi_types
|
|
48
|
+
{
|
|
49
|
+
:'cpu' => :'Integer',
|
|
50
|
+
:'memory' => :'Integer',
|
|
51
|
+
:'disk' => :'Integer'
|
|
52
|
+
}
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# List of attributes with nullable: true
|
|
56
|
+
def self.openapi_nullable
|
|
57
|
+
Set.new([
|
|
58
|
+
])
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Initializes the object
|
|
62
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
63
|
+
def initialize(attributes = {})
|
|
64
|
+
if (!attributes.is_a?(Hash))
|
|
65
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::ResizeSandbox` initialize method"
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
69
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
70
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
71
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
72
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::ResizeSandbox`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
73
|
+
end
|
|
74
|
+
h[k.to_sym] = v
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if attributes.key?(:'cpu')
|
|
78
|
+
self.cpu = attributes[:'cpu']
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
if attributes.key?(:'memory')
|
|
82
|
+
self.memory = attributes[:'memory']
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
if attributes.key?(:'disk')
|
|
86
|
+
self.disk = attributes[:'disk']
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
91
|
+
# @return Array for valid properties with the reasons
|
|
92
|
+
def list_invalid_properties
|
|
93
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
94
|
+
invalid_properties = Array.new
|
|
95
|
+
if !@cpu.nil? && @cpu < 1
|
|
96
|
+
invalid_properties.push('invalid value for "cpu", must be greater than or equal to 1.')
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
if !@memory.nil? && @memory < 1
|
|
100
|
+
invalid_properties.push('invalid value for "memory", must be greater than or equal to 1.')
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
if !@disk.nil? && @disk < 1
|
|
104
|
+
invalid_properties.push('invalid value for "disk", must be greater than or equal to 1.')
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
invalid_properties
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Check to see if the all the properties in the model are valid
|
|
111
|
+
# @return true if the model is valid
|
|
112
|
+
def valid?
|
|
113
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
114
|
+
return false if !@cpu.nil? && @cpu < 1
|
|
115
|
+
return false if !@memory.nil? && @memory < 1
|
|
116
|
+
return false if !@disk.nil? && @disk < 1
|
|
117
|
+
true
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Custom attribute writer method with validation
|
|
121
|
+
# @param [Object] cpu Value to be assigned
|
|
122
|
+
def cpu=(cpu)
|
|
123
|
+
if cpu.nil?
|
|
124
|
+
fail ArgumentError, 'cpu cannot be nil'
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
if cpu < 1
|
|
128
|
+
fail ArgumentError, 'invalid value for "cpu", must be greater than or equal to 1.'
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
@cpu = cpu
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Custom attribute writer method with validation
|
|
135
|
+
# @param [Object] memory Value to be assigned
|
|
136
|
+
def memory=(memory)
|
|
137
|
+
if memory.nil?
|
|
138
|
+
fail ArgumentError, 'memory cannot be nil'
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
if memory < 1
|
|
142
|
+
fail ArgumentError, 'invalid value for "memory", must be greater than or equal to 1.'
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
@memory = memory
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# Custom attribute writer method with validation
|
|
149
|
+
# @param [Object] disk Value to be assigned
|
|
150
|
+
def disk=(disk)
|
|
151
|
+
if disk.nil?
|
|
152
|
+
fail ArgumentError, 'disk cannot be nil'
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
if disk < 1
|
|
156
|
+
fail ArgumentError, 'invalid value for "disk", must be greater than or equal to 1.'
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
@disk = disk
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# Checks equality by comparing each attribute.
|
|
163
|
+
# @param [Object] Object to be compared
|
|
164
|
+
def ==(o)
|
|
165
|
+
return true if self.equal?(o)
|
|
166
|
+
self.class == o.class &&
|
|
167
|
+
cpu == o.cpu &&
|
|
168
|
+
memory == o.memory &&
|
|
169
|
+
disk == o.disk
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# @see the `==` method
|
|
173
|
+
# @param [Object] Object to be compared
|
|
174
|
+
def eql?(o)
|
|
175
|
+
self == o
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# Calculates hash code according to all attributes.
|
|
179
|
+
# @return [Integer] Hash code
|
|
180
|
+
def hash
|
|
181
|
+
[cpu, memory, disk].hash
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# Builds the object from hash
|
|
185
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
186
|
+
# @return [Object] Returns the model itself
|
|
187
|
+
def self.build_from_hash(attributes)
|
|
188
|
+
return nil unless attributes.is_a?(Hash)
|
|
189
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
190
|
+
transformed_hash = {}
|
|
191
|
+
openapi_types.each_pair do |key, type|
|
|
192
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
193
|
+
transformed_hash["#{key}"] = nil
|
|
194
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
195
|
+
# check to ensure the input is an array given that the attribute
|
|
196
|
+
# is documented as an array but the input is not
|
|
197
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
198
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
199
|
+
end
|
|
200
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
201
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
202
|
+
end
|
|
203
|
+
end
|
|
204
|
+
new(transformed_hash)
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
# Deserializes the data based on type
|
|
208
|
+
# @param string type Data type
|
|
209
|
+
# @param string value Value to be deserialized
|
|
210
|
+
# @return [Object] Deserialized data
|
|
211
|
+
def self._deserialize(type, value)
|
|
212
|
+
case type.to_sym
|
|
213
|
+
when :Time
|
|
214
|
+
Time.parse(value)
|
|
215
|
+
when :Date
|
|
216
|
+
Date.parse(value)
|
|
217
|
+
when :String
|
|
218
|
+
value.to_s
|
|
219
|
+
when :Integer
|
|
220
|
+
value.to_i
|
|
221
|
+
when :Float
|
|
222
|
+
value.to_f
|
|
223
|
+
when :Boolean
|
|
224
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
225
|
+
true
|
|
226
|
+
else
|
|
227
|
+
false
|
|
228
|
+
end
|
|
229
|
+
when :Object
|
|
230
|
+
# generic object (usually a Hash), return directly
|
|
231
|
+
value
|
|
232
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
233
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
234
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
235
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
236
|
+
k_type = Regexp.last_match[:k_type]
|
|
237
|
+
v_type = Regexp.last_match[:v_type]
|
|
238
|
+
{}.tap do |hash|
|
|
239
|
+
value.each do |k, v|
|
|
240
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
241
|
+
end
|
|
242
|
+
end
|
|
243
|
+
else # model
|
|
244
|
+
# models (e.g. Pet) or oneOf
|
|
245
|
+
klass = DaytonaApiClient.const_get(type)
|
|
246
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
247
|
+
end
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
# Returns the string representation of the object
|
|
251
|
+
# @return [String] String presentation of the object
|
|
252
|
+
def to_s
|
|
253
|
+
to_hash.to_s
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
257
|
+
# @return [Hash] Returns the object in the form of hash
|
|
258
|
+
def to_body
|
|
259
|
+
to_hash
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
# Returns the object in the form of hash
|
|
263
|
+
# @return [Hash] Returns the object in the form of hash
|
|
264
|
+
def to_hash
|
|
265
|
+
hash = {}
|
|
266
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
267
|
+
value = self.send(attr)
|
|
268
|
+
if value.nil?
|
|
269
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
270
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
hash[param] = _to_hash(value)
|
|
274
|
+
end
|
|
275
|
+
hash
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
# Outputs non-array value in the form of hash
|
|
279
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
280
|
+
# @param [Object] value Any valid value
|
|
281
|
+
# @return [Hash] Returns the value in the form of hash
|
|
282
|
+
def _to_hash(value)
|
|
283
|
+
if value.is_a?(Array)
|
|
284
|
+
value.compact.map { |v| _to_hash(v) }
|
|
285
|
+
elsif value.is_a?(Hash)
|
|
286
|
+
{}.tap do |hash|
|
|
287
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
288
|
+
end
|
|
289
|
+
elsif value.respond_to? :to_hash
|
|
290
|
+
value.to_hash
|
|
291
|
+
else
|
|
292
|
+
value
|
|
293
|
+
end
|
|
294
|
+
end
|
|
295
|
+
end
|
|
296
|
+
end
|
|
@@ -31,9 +31,10 @@ module DaytonaApiClient
|
|
|
31
31
|
PULLING_SNAPSHOT = "pulling_snapshot".freeze
|
|
32
32
|
ARCHIVED = "archived".freeze
|
|
33
33
|
ARCHIVING = "archiving".freeze
|
|
34
|
+
RESIZING = "resizing".freeze
|
|
34
35
|
|
|
35
36
|
def self.all_vars
|
|
36
|
-
@all_vars ||= [CREATING, RESTORING, DESTROYED, DESTROYING, STARTED, STOPPED, STARTING, STOPPING, ERROR, BUILD_FAILED, PENDING_BUILD, BUILDING_SNAPSHOT, UNKNOWN, PULLING_SNAPSHOT, ARCHIVED, ARCHIVING].freeze
|
|
37
|
+
@all_vars ||= [CREATING, RESTORING, DESTROYED, DESTROYING, STARTED, STOPPED, STARTING, STOPPING, ERROR, BUILD_FAILED, PENDING_BUILD, BUILDING_SNAPSHOT, UNKNOWN, PULLING_SNAPSHOT, ARCHIVED, ARCHIVING, RESIZING].freeze
|
|
37
38
|
end
|
|
38
39
|
|
|
39
40
|
# Builds the enum from string
|
|
@@ -128,7 +128,7 @@ module DaytonaApiClient
|
|
|
128
128
|
def valid?
|
|
129
129
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
130
130
|
return false if @state.nil?
|
|
131
|
-
state_validator = EnumAttributeValidator.new('String', ["creating", "restoring", "destroyed", "destroying", "started", "stopped", "starting", "stopping", "error", "build_failed", "pending_build", "building_snapshot", "unknown", "pulling_snapshot", "archived", "archiving"])
|
|
131
|
+
state_validator = EnumAttributeValidator.new('String', ["creating", "restoring", "destroyed", "destroying", "started", "stopped", "starting", "stopping", "error", "build_failed", "pending_build", "building_snapshot", "unknown", "pulling_snapshot", "archived", "archiving", "resizing"])
|
|
132
132
|
return false unless state_validator.valid?(@state)
|
|
133
133
|
true
|
|
134
134
|
end
|
|
@@ -136,7 +136,7 @@ module DaytonaApiClient
|
|
|
136
136
|
# Custom attribute writer method checking allowed values (enum).
|
|
137
137
|
# @param [Object] state Object to be assigned
|
|
138
138
|
def state=(state)
|
|
139
|
-
validator = EnumAttributeValidator.new('String', ["creating", "restoring", "destroyed", "destroying", "started", "stopped", "starting", "stopping", "error", "build_failed", "pending_build", "building_snapshot", "unknown", "pulling_snapshot", "archived", "archiving"])
|
|
139
|
+
validator = EnumAttributeValidator.new('String', ["creating", "restoring", "destroyed", "destroying", "started", "stopped", "starting", "stopping", "error", "build_failed", "pending_build", "building_snapshot", "unknown", "pulling_snapshot", "archived", "archiving", "resizing"])
|
|
140
140
|
unless validator.valid?(state)
|
|
141
141
|
fail ArgumentError, "invalid value for \"state\", must be one of #{validator.allowable_values}."
|
|
142
142
|
end
|
data/lib/daytona_api_client.rb
CHANGED
|
@@ -131,6 +131,7 @@ require 'daytona_api_client/models/region_usage_overview'
|
|
|
131
131
|
require 'daytona_api_client/models/registry_push_access_dto'
|
|
132
132
|
require 'daytona_api_client/models/replace_request'
|
|
133
133
|
require 'daytona_api_client/models/replace_result'
|
|
134
|
+
require 'daytona_api_client/models/resize_sandbox'
|
|
134
135
|
require 'daytona_api_client/models/runner'
|
|
135
136
|
require 'daytona_api_client/models/runner_full'
|
|
136
137
|
require 'daytona_api_client/models/runner_health_metrics'
|
data/project.json
CHANGED
|
@@ -13,8 +13,10 @@
|
|
|
13
13
|
"parallel": false
|
|
14
14
|
},
|
|
15
15
|
"dependsOn": ["set-version"],
|
|
16
|
-
"
|
|
17
|
-
|
|
16
|
+
"inputs": [
|
|
17
|
+
"default",
|
|
18
|
+
{ "dependentTasksOutputFiles": "**/*", "transitive": true }
|
|
19
|
+
],
|
|
18
20
|
"outputs": ["{projectRoot}/**/*.gem"]
|
|
19
21
|
},
|
|
20
22
|
"set-version": {
|
|
@@ -36,6 +38,7 @@
|
|
|
36
38
|
},
|
|
37
39
|
"generate:api-client": {
|
|
38
40
|
"executor": "nx:run-commands",
|
|
41
|
+
"outputs": ["{projectRoot}/lib"],
|
|
39
42
|
"options": {
|
|
40
43
|
"commands": [
|
|
41
44
|
"rm -rf libs/api-client-ruby/lib",
|
|
@@ -47,8 +50,10 @@
|
|
|
47
50
|
"parallel": false
|
|
48
51
|
},
|
|
49
52
|
"cache": true,
|
|
50
|
-
"inputs": [
|
|
51
|
-
|
|
53
|
+
"inputs": [
|
|
54
|
+
"apiClient",
|
|
55
|
+
{ "env": "DEFAULT_GEM_VERSION" }
|
|
56
|
+
],
|
|
52
57
|
"dependsOn": [
|
|
53
58
|
{
|
|
54
59
|
"target": "openapi",
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: daytona_api_client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.140.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- daytonaio
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-02-
|
|
11
|
+
date: 2026-02-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: typhoeus
|
|
@@ -203,6 +203,7 @@ files:
|
|
|
203
203
|
- lib/daytona_api_client/models/registry_push_access_dto.rb
|
|
204
204
|
- lib/daytona_api_client/models/replace_request.rb
|
|
205
205
|
- lib/daytona_api_client/models/replace_result.rb
|
|
206
|
+
- lib/daytona_api_client/models/resize_sandbox.rb
|
|
206
207
|
- lib/daytona_api_client/models/runner.rb
|
|
207
208
|
- lib/daytona_api_client/models/runner_full.rb
|
|
208
209
|
- lib/daytona_api_client/models/runner_health_metrics.rb
|