daytona_api_client 0.126.0.pre.alpha.4 → 0.134.0.alpha.1
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 +23 -0
- data/.openapi-generator-ignore +0 -2
- data/daytona_api_client.gemspec +1 -1
- data/fix-gemspec.sh +1 -1
- data/lib/daytona_api_client/api/admin_api.rb +325 -0
- data/lib/daytona_api_client/api/docker_registry_api.rb +3 -0
- data/lib/daytona_api_client/api/jobs_api.rb +299 -0
- data/lib/daytona_api_client/api/organizations_api.rb +518 -0
- data/lib/daytona_api_client/api/preview_api.rb +67 -0
- data/lib/daytona_api_client/api/regions_api.rb +9 -15
- data/lib/daytona_api_client/api/runners_api.rb +291 -23
- data/lib/daytona_api_client/api/sandbox_api.rb +277 -0
- data/lib/daytona_api_client/api/snapshots_api.rb +66 -0
- data/lib/daytona_api_client/models/admin_create_runner.rb +385 -0
- data/lib/daytona_api_client/models/build_info.rb +31 -4
- data/lib/daytona_api_client/models/create_region.rb +269 -0
- data/lib/daytona_api_client/models/create_region_response.rb +280 -0
- data/lib/daytona_api_client/models/create_runner.rb +31 -315
- data/lib/daytona_api_client/models/create_runner_response.rb +263 -0
- data/lib/daytona_api_client/models/create_snapshot.rb +14 -4
- data/lib/daytona_api_client/models/{create_audit_log.rb → job.rb} +166 -79
- data/lib/daytona_api_client/models/job_status.rb +42 -0
- data/lib/daytona_api_client/models/job_type.rb +49 -0
- data/lib/daytona_api_client/models/{paginated_snapshots_dto.rb → paginated_jobs.rb} +4 -4
- data/lib/daytona_api_client/models/poll_jobs_response.rb +238 -0
- data/lib/daytona_api_client/models/regenerate_api_key_response.rb +236 -0
- data/lib/daytona_api_client/models/region.rb +86 -4
- data/lib/daytona_api_client/models/region_type.rb +41 -0
- data/lib/daytona_api_client/models/runner.rb +79 -117
- data/lib/daytona_api_client/models/runner_full.rb +779 -0
- data/lib/daytona_api_client/models/runner_health_metrics.rb +533 -0
- data/lib/daytona_api_client/models/runner_healthcheck.rb +276 -0
- data/lib/daytona_api_client/models/runner_snapshot_dto.rb +0 -17
- data/lib/daytona_api_client/models/sandbox.rb +14 -4
- data/lib/daytona_api_client/models/signed_port_preview_url.rb +317 -0
- data/lib/daytona_api_client/models/snapshot_dto.rb +36 -4
- data/lib/daytona_api_client/models/snapshot_manager_credentials.rb +263 -0
- data/lib/daytona_api_client/models/ssh_access_dto.rb +31 -4
- data/lib/daytona_api_client/models/toolbox_proxy_url.rb +236 -0
- data/lib/daytona_api_client/models/update_job_status.rb +278 -0
- data/lib/daytona_api_client/models/update_region.rb +242 -0
- data/lib/daytona_api_client/models/update_sandbox_state_dto.rb +14 -4
- data/lib/daytona_api_client/models/url.rb +236 -0
- data/lib/daytona_api_client/models/workspace.rb +11 -1
- data/lib/daytona_api_client/version.rb +1 -1
- data/lib/daytona_api_client.rb +22 -0
- data/project.json +10 -4
- metadata +23 -5
- data/Gemfile +0 -9
- data/Gemfile.lock +0 -101
|
@@ -0,0 +1,299 @@
|
|
|
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 'cgi'
|
|
14
|
+
|
|
15
|
+
module DaytonaApiClient
|
|
16
|
+
class JobsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Get job details
|
|
23
|
+
# @param job_id [String] ID of the job
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @return [Job]
|
|
26
|
+
def get_job(job_id, opts = {})
|
|
27
|
+
data, _status_code, _headers = get_job_with_http_info(job_id, opts)
|
|
28
|
+
data
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Get job details
|
|
32
|
+
# @param job_id [String] ID of the job
|
|
33
|
+
# @param [Hash] opts the optional parameters
|
|
34
|
+
# @return [Array<(Job, Integer, Hash)>] Job data, response status code and response headers
|
|
35
|
+
def get_job_with_http_info(job_id, opts = {})
|
|
36
|
+
if @api_client.config.debugging
|
|
37
|
+
@api_client.config.logger.debug 'Calling API: JobsApi.get_job ...'
|
|
38
|
+
end
|
|
39
|
+
# verify the required parameter 'job_id' is set
|
|
40
|
+
if @api_client.config.client_side_validation && job_id.nil?
|
|
41
|
+
fail ArgumentError, "Missing the required parameter 'job_id' when calling JobsApi.get_job"
|
|
42
|
+
end
|
|
43
|
+
# resource path
|
|
44
|
+
local_var_path = '/jobs/{jobId}'.sub('{' + 'jobId' + '}', CGI.escape(job_id.to_s))
|
|
45
|
+
|
|
46
|
+
# query parameters
|
|
47
|
+
query_params = opts[:query_params] || {}
|
|
48
|
+
|
|
49
|
+
# header parameters
|
|
50
|
+
header_params = opts[:header_params] || {}
|
|
51
|
+
# HTTP header 'Accept' (if needed)
|
|
52
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
53
|
+
|
|
54
|
+
# form parameters
|
|
55
|
+
form_params = opts[:form_params] || {}
|
|
56
|
+
|
|
57
|
+
# http body (model)
|
|
58
|
+
post_body = opts[:debug_body]
|
|
59
|
+
|
|
60
|
+
# return_type
|
|
61
|
+
return_type = opts[:debug_return_type] || 'Job'
|
|
62
|
+
|
|
63
|
+
# auth_names
|
|
64
|
+
auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
|
|
65
|
+
|
|
66
|
+
new_options = opts.merge(
|
|
67
|
+
:operation => :"JobsApi.get_job",
|
|
68
|
+
:header_params => header_params,
|
|
69
|
+
:query_params => query_params,
|
|
70
|
+
:form_params => form_params,
|
|
71
|
+
:body => post_body,
|
|
72
|
+
:auth_names => auth_names,
|
|
73
|
+
:return_type => return_type
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
77
|
+
if @api_client.config.debugging
|
|
78
|
+
@api_client.config.logger.debug "API called: JobsApi#get_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
79
|
+
end
|
|
80
|
+
return data, status_code, headers
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# List jobs for the runner
|
|
84
|
+
# Returns a paginated list of jobs for the runner, optionally filtered by status.
|
|
85
|
+
# @param [Hash] opts the optional parameters
|
|
86
|
+
# @option opts [Float] :page Page number of the results (default to 1)
|
|
87
|
+
# @option opts [Float] :limit Maximum number of jobs to return (default: 100, max: 500) (default to 100)
|
|
88
|
+
# @option opts [JobStatus] :status Filter jobs by status
|
|
89
|
+
# @option opts [Float] :offset Number of jobs to skip for pagination (default: 0)
|
|
90
|
+
# @return [PaginatedJobs]
|
|
91
|
+
def list_jobs(opts = {})
|
|
92
|
+
data, _status_code, _headers = list_jobs_with_http_info(opts)
|
|
93
|
+
data
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# List jobs for the runner
|
|
97
|
+
# Returns a paginated list of jobs for the runner, optionally filtered by status.
|
|
98
|
+
# @param [Hash] opts the optional parameters
|
|
99
|
+
# @option opts [Float] :page Page number of the results (default to 1)
|
|
100
|
+
# @option opts [Float] :limit Maximum number of jobs to return (default: 100, max: 500) (default to 100)
|
|
101
|
+
# @option opts [JobStatus] :status Filter jobs by status
|
|
102
|
+
# @option opts [Float] :offset Number of jobs to skip for pagination (default: 0)
|
|
103
|
+
# @return [Array<(PaginatedJobs, Integer, Hash)>] PaginatedJobs data, response status code and response headers
|
|
104
|
+
def list_jobs_with_http_info(opts = {})
|
|
105
|
+
if @api_client.config.debugging
|
|
106
|
+
@api_client.config.logger.debug 'Calling API: JobsApi.list_jobs ...'
|
|
107
|
+
end
|
|
108
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
|
|
109
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling JobsApi.list_jobs, must be greater than or equal to 1.'
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 200
|
|
113
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling JobsApi.list_jobs, must be smaller than or equal to 200.'
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
117
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling JobsApi.list_jobs, must be greater than or equal to 1.'
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# resource path
|
|
121
|
+
local_var_path = '/jobs'
|
|
122
|
+
|
|
123
|
+
# query parameters
|
|
124
|
+
query_params = opts[:query_params] || {}
|
|
125
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
126
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
127
|
+
query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
|
|
128
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
|
129
|
+
|
|
130
|
+
# header parameters
|
|
131
|
+
header_params = opts[:header_params] || {}
|
|
132
|
+
# HTTP header 'Accept' (if needed)
|
|
133
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
134
|
+
|
|
135
|
+
# form parameters
|
|
136
|
+
form_params = opts[:form_params] || {}
|
|
137
|
+
|
|
138
|
+
# http body (model)
|
|
139
|
+
post_body = opts[:debug_body]
|
|
140
|
+
|
|
141
|
+
# return_type
|
|
142
|
+
return_type = opts[:debug_return_type] || 'PaginatedJobs'
|
|
143
|
+
|
|
144
|
+
# auth_names
|
|
145
|
+
auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
|
|
146
|
+
|
|
147
|
+
new_options = opts.merge(
|
|
148
|
+
:operation => :"JobsApi.list_jobs",
|
|
149
|
+
:header_params => header_params,
|
|
150
|
+
:query_params => query_params,
|
|
151
|
+
:form_params => form_params,
|
|
152
|
+
:body => post_body,
|
|
153
|
+
:auth_names => auth_names,
|
|
154
|
+
:return_type => return_type
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
158
|
+
if @api_client.config.debugging
|
|
159
|
+
@api_client.config.logger.debug "API called: JobsApi#list_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
160
|
+
end
|
|
161
|
+
return data, status_code, headers
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Long poll for jobs
|
|
165
|
+
# Long poll endpoint for runners to fetch pending jobs. Returns immediately if jobs are available, otherwise waits up to timeout seconds.
|
|
166
|
+
# @param [Hash] opts the optional parameters
|
|
167
|
+
# @option opts [Float] :timeout Timeout in seconds for long polling (default: 30, max: 60)
|
|
168
|
+
# @option opts [Float] :limit Maximum number of jobs to return (default: 10, max: 100)
|
|
169
|
+
# @return [PollJobsResponse]
|
|
170
|
+
def poll_jobs(opts = {})
|
|
171
|
+
data, _status_code, _headers = poll_jobs_with_http_info(opts)
|
|
172
|
+
data
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Long poll for jobs
|
|
176
|
+
# Long poll endpoint for runners to fetch pending jobs. Returns immediately if jobs are available, otherwise waits up to timeout seconds.
|
|
177
|
+
# @param [Hash] opts the optional parameters
|
|
178
|
+
# @option opts [Float] :timeout Timeout in seconds for long polling (default: 30, max: 60)
|
|
179
|
+
# @option opts [Float] :limit Maximum number of jobs to return (default: 10, max: 100)
|
|
180
|
+
# @return [Array<(PollJobsResponse, Integer, Hash)>] PollJobsResponse data, response status code and response headers
|
|
181
|
+
def poll_jobs_with_http_info(opts = {})
|
|
182
|
+
if @api_client.config.debugging
|
|
183
|
+
@api_client.config.logger.debug 'Calling API: JobsApi.poll_jobs ...'
|
|
184
|
+
end
|
|
185
|
+
# resource path
|
|
186
|
+
local_var_path = '/jobs/poll'
|
|
187
|
+
|
|
188
|
+
# query parameters
|
|
189
|
+
query_params = opts[:query_params] || {}
|
|
190
|
+
query_params[:'timeout'] = opts[:'timeout'] if !opts[:'timeout'].nil?
|
|
191
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
192
|
+
|
|
193
|
+
# header parameters
|
|
194
|
+
header_params = opts[:header_params] || {}
|
|
195
|
+
# HTTP header 'Accept' (if needed)
|
|
196
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
197
|
+
|
|
198
|
+
# form parameters
|
|
199
|
+
form_params = opts[:form_params] || {}
|
|
200
|
+
|
|
201
|
+
# http body (model)
|
|
202
|
+
post_body = opts[:debug_body]
|
|
203
|
+
|
|
204
|
+
# return_type
|
|
205
|
+
return_type = opts[:debug_return_type] || 'PollJobsResponse'
|
|
206
|
+
|
|
207
|
+
# auth_names
|
|
208
|
+
auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
|
|
209
|
+
|
|
210
|
+
new_options = opts.merge(
|
|
211
|
+
:operation => :"JobsApi.poll_jobs",
|
|
212
|
+
:header_params => header_params,
|
|
213
|
+
:query_params => query_params,
|
|
214
|
+
:form_params => form_params,
|
|
215
|
+
:body => post_body,
|
|
216
|
+
:auth_names => auth_names,
|
|
217
|
+
:return_type => return_type
|
|
218
|
+
)
|
|
219
|
+
|
|
220
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
221
|
+
if @api_client.config.debugging
|
|
222
|
+
@api_client.config.logger.debug "API called: JobsApi#poll_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
223
|
+
end
|
|
224
|
+
return data, status_code, headers
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
# Update job status
|
|
228
|
+
# @param job_id [String] ID of the job
|
|
229
|
+
# @param update_job_status [UpdateJobStatus]
|
|
230
|
+
# @param [Hash] opts the optional parameters
|
|
231
|
+
# @return [Job]
|
|
232
|
+
def update_job_status(job_id, update_job_status, opts = {})
|
|
233
|
+
data, _status_code, _headers = update_job_status_with_http_info(job_id, update_job_status, opts)
|
|
234
|
+
data
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
# Update job status
|
|
238
|
+
# @param job_id [String] ID of the job
|
|
239
|
+
# @param update_job_status [UpdateJobStatus]
|
|
240
|
+
# @param [Hash] opts the optional parameters
|
|
241
|
+
# @return [Array<(Job, Integer, Hash)>] Job data, response status code and response headers
|
|
242
|
+
def update_job_status_with_http_info(job_id, update_job_status, opts = {})
|
|
243
|
+
if @api_client.config.debugging
|
|
244
|
+
@api_client.config.logger.debug 'Calling API: JobsApi.update_job_status ...'
|
|
245
|
+
end
|
|
246
|
+
# verify the required parameter 'job_id' is set
|
|
247
|
+
if @api_client.config.client_side_validation && job_id.nil?
|
|
248
|
+
fail ArgumentError, "Missing the required parameter 'job_id' when calling JobsApi.update_job_status"
|
|
249
|
+
end
|
|
250
|
+
# verify the required parameter 'update_job_status' is set
|
|
251
|
+
if @api_client.config.client_side_validation && update_job_status.nil?
|
|
252
|
+
fail ArgumentError, "Missing the required parameter 'update_job_status' when calling JobsApi.update_job_status"
|
|
253
|
+
end
|
|
254
|
+
# resource path
|
|
255
|
+
local_var_path = '/jobs/{jobId}/status'.sub('{' + 'jobId' + '}', CGI.escape(job_id.to_s))
|
|
256
|
+
|
|
257
|
+
# query parameters
|
|
258
|
+
query_params = opts[:query_params] || {}
|
|
259
|
+
|
|
260
|
+
# header parameters
|
|
261
|
+
header_params = opts[:header_params] || {}
|
|
262
|
+
# HTTP header 'Accept' (if needed)
|
|
263
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
264
|
+
# HTTP header 'Content-Type'
|
|
265
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
266
|
+
if !content_type.nil?
|
|
267
|
+
header_params['Content-Type'] = content_type
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
# form parameters
|
|
271
|
+
form_params = opts[:form_params] || {}
|
|
272
|
+
|
|
273
|
+
# http body (model)
|
|
274
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(update_job_status)
|
|
275
|
+
|
|
276
|
+
# return_type
|
|
277
|
+
return_type = opts[:debug_return_type] || 'Job'
|
|
278
|
+
|
|
279
|
+
# auth_names
|
|
280
|
+
auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
|
|
281
|
+
|
|
282
|
+
new_options = opts.merge(
|
|
283
|
+
:operation => :"JobsApi.update_job_status",
|
|
284
|
+
:header_params => header_params,
|
|
285
|
+
:query_params => query_params,
|
|
286
|
+
:form_params => form_params,
|
|
287
|
+
:body => post_body,
|
|
288
|
+
:auth_names => auth_names,
|
|
289
|
+
:return_type => return_type
|
|
290
|
+
)
|
|
291
|
+
|
|
292
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
293
|
+
if @api_client.config.debugging
|
|
294
|
+
@api_client.config.logger.debug "API called: JobsApi#update_job_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
295
|
+
end
|
|
296
|
+
return data, status_code, headers
|
|
297
|
+
end
|
|
298
|
+
end
|
|
299
|
+
end
|