daytona_api_client 0.134.0.alpha.1 → 1.0.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.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +9 -0
  3. data/Gemfile.lock +101 -0
  4. data/daytona_api_client.gemspec +2 -2
  5. data/lib/daytona_api_client/api/audit_api.rb +66 -18
  6. data/lib/daytona_api_client/api/docker_registry_api.rb +0 -3
  7. data/lib/daytona_api_client/api/organizations_api.rb +29 -754
  8. data/lib/daytona_api_client/api/preview_api.rb +5 -74
  9. data/lib/daytona_api_client/api/runners_api.rb +20 -343
  10. data/lib/daytona_api_client/api/sandbox_api.rb +194 -558
  11. data/lib/daytona_api_client/api/snapshots_api.rb +0 -66
  12. data/lib/daytona_api_client/api/toolbox_api.rb +711 -711
  13. data/lib/daytona_api_client/api/workspace_api.rb +3 -3
  14. data/lib/daytona_api_client/models/build_info.rb +4 -31
  15. data/lib/daytona_api_client/models/{job.rb → create_audit_log.rb} +79 -166
  16. data/lib/daytona_api_client/models/create_organization.rb +4 -31
  17. data/lib/daytona_api_client/models/create_runner.rb +315 -31
  18. data/lib/daytona_api_client/models/create_sandbox.rb +1 -11
  19. data/lib/daytona_api_client/models/create_snapshot.rb +4 -14
  20. data/lib/daytona_api_client/models/create_user.rb +1 -10
  21. data/lib/daytona_api_client/models/daytona_configuration.rb +4 -41
  22. data/lib/daytona_api_client/models/organization.rb +85 -53
  23. data/lib/daytona_api_client/models/organization_usage_overview.rb +146 -18
  24. data/lib/daytona_api_client/models/paginated_audit_logs.rb +4 -14
  25. data/lib/daytona_api_client/models/{paginated_jobs.rb → paginated_snapshots_dto.rb} +4 -4
  26. data/lib/daytona_api_client/models/port_preview_url.rb +14 -31
  27. data/lib/daytona_api_client/models/region.rb +4 -178
  28. data/lib/daytona_api_client/models/runner.rb +117 -79
  29. data/lib/daytona_api_client/models/runner_snapshot_dto.rb +17 -0
  30. data/lib/daytona_api_client/models/sandbox.rb +14 -51
  31. data/lib/daytona_api_client/models/sandbox_volume.rb +4 -14
  32. data/lib/daytona_api_client/models/snapshot_dto.rb +4 -36
  33. data/lib/daytona_api_client/models/snapshot_state.rb +4 -1
  34. data/lib/daytona_api_client/models/ssh_access_dto.rb +4 -31
  35. data/lib/daytona_api_client/models/ssh_access_validation_dto.rb +24 -4
  36. data/lib/daytona_api_client/models/update_organization_quota.rb +41 -41
  37. data/lib/daytona_api_client/models/update_sandbox_state_dto.rb +4 -24
  38. data/lib/daytona_api_client/models/workspace.rb +35 -45
  39. data/lib/daytona_api_client/version.rb +1 -1
  40. data/lib/daytona_api_client.rb +1 -30
  41. data/project.json +6 -34
  42. metadata +5 -38
  43. data/.gitignore +0 -39
  44. data/.openapi-generator/FILES +0 -194
  45. data/.openapi-generator/VERSION +0 -1
  46. data/.openapi-generator-ignore +0 -31
  47. data/.rspec +0 -2
  48. data/.rubocop.yml +0 -148
  49. data/fix-gemspec.sh +0 -11
  50. data/lib/daytona_api_client/api/admin_api.rb +0 -325
  51. data/lib/daytona_api_client/api/jobs_api.rb +0 -299
  52. data/lib/daytona_api_client/api/regions_api.rb +0 -77
  53. data/lib/daytona_api_client/models/admin_create_runner.rb +0 -385
  54. data/lib/daytona_api_client/models/create_region.rb +0 -269
  55. data/lib/daytona_api_client/models/create_region_response.rb +0 -280
  56. data/lib/daytona_api_client/models/create_runner_response.rb +0 -263
  57. data/lib/daytona_api_client/models/job_status.rb +0 -42
  58. data/lib/daytona_api_client/models/job_type.rb +0 -49
  59. data/lib/daytona_api_client/models/poll_jobs_response.rb +0 -238
  60. data/lib/daytona_api_client/models/rate_limit_config.rb +0 -249
  61. data/lib/daytona_api_client/models/rate_limit_entry.rb +0 -229
  62. data/lib/daytona_api_client/models/regenerate_api_key_response.rb +0 -236
  63. data/lib/daytona_api_client/models/region_quota.rb +0 -339
  64. data/lib/daytona_api_client/models/region_type.rb +0 -41
  65. data/lib/daytona_api_client/models/region_usage_overview.rb +0 -391
  66. data/lib/daytona_api_client/models/runner_full.rb +0 -779
  67. data/lib/daytona_api_client/models/runner_health_metrics.rb +0 -533
  68. data/lib/daytona_api_client/models/runner_healthcheck.rb +0 -276
  69. data/lib/daytona_api_client/models/signed_port_preview_url.rb +0 -317
  70. data/lib/daytona_api_client/models/snapshot_manager_credentials.rb +0 -263
  71. data/lib/daytona_api_client/models/toolbox_proxy_url.rb +0 -236
  72. data/lib/daytona_api_client/models/update_job_status.rb +0 -278
  73. data/lib/daytona_api_client/models/update_organization_default_region.rb +0 -236
  74. data/lib/daytona_api_client/models/update_organization_region_quota.rb +0 -245
  75. data/lib/daytona_api_client/models/update_region.rb +0 -242
  76. data/lib/daytona_api_client/models/url.rb +0 -236
  77. data/lib/daytona_api_client/models/workspace_port_preview_url.rb +0 -263
@@ -1,325 +0,0 @@
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 AdminApi
17
- attr_accessor :api_client
18
-
19
- def initialize(api_client = ApiClient.default)
20
- @api_client = api_client
21
- end
22
- # Create runner
23
- # @param admin_create_runner [AdminCreateRunner]
24
- # @param [Hash] opts the optional parameters
25
- # @return [CreateRunnerResponse]
26
- def admin_create_runner(admin_create_runner, opts = {})
27
- data, _status_code, _headers = admin_create_runner_with_http_info(admin_create_runner, opts)
28
- data
29
- end
30
-
31
- # Create runner
32
- # @param admin_create_runner [AdminCreateRunner]
33
- # @param [Hash] opts the optional parameters
34
- # @return [Array<(CreateRunnerResponse, Integer, Hash)>] CreateRunnerResponse data, response status code and response headers
35
- def admin_create_runner_with_http_info(admin_create_runner, opts = {})
36
- if @api_client.config.debugging
37
- @api_client.config.logger.debug 'Calling API: AdminApi.admin_create_runner ...'
38
- end
39
- # verify the required parameter 'admin_create_runner' is set
40
- if @api_client.config.client_side_validation && admin_create_runner.nil?
41
- fail ArgumentError, "Missing the required parameter 'admin_create_runner' when calling AdminApi.admin_create_runner"
42
- end
43
- # resource path
44
- local_var_path = '/admin/runners'
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
- # HTTP header 'Content-Type'
54
- content_type = @api_client.select_header_content_type(['application/json'])
55
- if !content_type.nil?
56
- header_params['Content-Type'] = content_type
57
- end
58
-
59
- # form parameters
60
- form_params = opts[:form_params] || {}
61
-
62
- # http body (model)
63
- post_body = opts[:debug_body] || @api_client.object_to_http_body(admin_create_runner)
64
-
65
- # return_type
66
- return_type = opts[:debug_return_type] || 'CreateRunnerResponse'
67
-
68
- # auth_names
69
- auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
70
-
71
- new_options = opts.merge(
72
- :operation => :"AdminApi.admin_create_runner",
73
- :header_params => header_params,
74
- :query_params => query_params,
75
- :form_params => form_params,
76
- :body => post_body,
77
- :auth_names => auth_names,
78
- :return_type => return_type
79
- )
80
-
81
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
82
- if @api_client.config.debugging
83
- @api_client.config.logger.debug "API called: AdminApi#admin_create_runner\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
84
- end
85
- return data, status_code, headers
86
- end
87
-
88
- # Delete runner
89
- # @param id [String] Runner ID
90
- # @param [Hash] opts the optional parameters
91
- # @return [nil]
92
- def admin_delete_runner(id, opts = {})
93
- admin_delete_runner_with_http_info(id, opts)
94
- nil
95
- end
96
-
97
- # Delete runner
98
- # @param id [String] Runner ID
99
- # @param [Hash] opts the optional parameters
100
- # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
101
- def admin_delete_runner_with_http_info(id, opts = {})
102
- if @api_client.config.debugging
103
- @api_client.config.logger.debug 'Calling API: AdminApi.admin_delete_runner ...'
104
- end
105
- # verify the required parameter 'id' is set
106
- if @api_client.config.client_side_validation && id.nil?
107
- fail ArgumentError, "Missing the required parameter 'id' when calling AdminApi.admin_delete_runner"
108
- end
109
- # resource path
110
- local_var_path = '/admin/runners/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
111
-
112
- # query parameters
113
- query_params = opts[:query_params] || {}
114
-
115
- # header parameters
116
- header_params = opts[:header_params] || {}
117
-
118
- # form parameters
119
- form_params = opts[:form_params] || {}
120
-
121
- # http body (model)
122
- post_body = opts[:debug_body]
123
-
124
- # return_type
125
- return_type = opts[:debug_return_type]
126
-
127
- # auth_names
128
- auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
129
-
130
- new_options = opts.merge(
131
- :operation => :"AdminApi.admin_delete_runner",
132
- :header_params => header_params,
133
- :query_params => query_params,
134
- :form_params => form_params,
135
- :body => post_body,
136
- :auth_names => auth_names,
137
- :return_type => return_type
138
- )
139
-
140
- data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
141
- if @api_client.config.debugging
142
- @api_client.config.logger.debug "API called: AdminApi#admin_delete_runner\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
143
- end
144
- return data, status_code, headers
145
- end
146
-
147
- # Get runner by ID
148
- # @param id [String] Runner ID
149
- # @param [Hash] opts the optional parameters
150
- # @return [RunnerFull]
151
- def admin_get_runner_by_id(id, opts = {})
152
- data, _status_code, _headers = admin_get_runner_by_id_with_http_info(id, opts)
153
- data
154
- end
155
-
156
- # Get runner by ID
157
- # @param id [String] Runner ID
158
- # @param [Hash] opts the optional parameters
159
- # @return [Array<(RunnerFull, Integer, Hash)>] RunnerFull data, response status code and response headers
160
- def admin_get_runner_by_id_with_http_info(id, opts = {})
161
- if @api_client.config.debugging
162
- @api_client.config.logger.debug 'Calling API: AdminApi.admin_get_runner_by_id ...'
163
- end
164
- # verify the required parameter 'id' is set
165
- if @api_client.config.client_side_validation && id.nil?
166
- fail ArgumentError, "Missing the required parameter 'id' when calling AdminApi.admin_get_runner_by_id"
167
- end
168
- # resource path
169
- local_var_path = '/admin/runners/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
170
-
171
- # query parameters
172
- query_params = opts[:query_params] || {}
173
-
174
- # header parameters
175
- header_params = opts[:header_params] || {}
176
- # HTTP header 'Accept' (if needed)
177
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
178
-
179
- # form parameters
180
- form_params = opts[:form_params] || {}
181
-
182
- # http body (model)
183
- post_body = opts[:debug_body]
184
-
185
- # return_type
186
- return_type = opts[:debug_return_type] || 'RunnerFull'
187
-
188
- # auth_names
189
- auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
190
-
191
- new_options = opts.merge(
192
- :operation => :"AdminApi.admin_get_runner_by_id",
193
- :header_params => header_params,
194
- :query_params => query_params,
195
- :form_params => form_params,
196
- :body => post_body,
197
- :auth_names => auth_names,
198
- :return_type => return_type
199
- )
200
-
201
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
202
- if @api_client.config.debugging
203
- @api_client.config.logger.debug "API called: AdminApi#admin_get_runner_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
204
- end
205
- return data, status_code, headers
206
- end
207
-
208
- # List all runners
209
- # @param [Hash] opts the optional parameters
210
- # @option opts [String] :region_id Filter runners by region ID
211
- # @return [Array<RunnerFull>]
212
- def admin_list_runners(opts = {})
213
- data, _status_code, _headers = admin_list_runners_with_http_info(opts)
214
- data
215
- end
216
-
217
- # List all runners
218
- # @param [Hash] opts the optional parameters
219
- # @option opts [String] :region_id Filter runners by region ID
220
- # @return [Array<(Array<RunnerFull>, Integer, Hash)>] Array<RunnerFull> data, response status code and response headers
221
- def admin_list_runners_with_http_info(opts = {})
222
- if @api_client.config.debugging
223
- @api_client.config.logger.debug 'Calling API: AdminApi.admin_list_runners ...'
224
- end
225
- # resource path
226
- local_var_path = '/admin/runners'
227
-
228
- # query parameters
229
- query_params = opts[:query_params] || {}
230
- query_params[:'regionId'] = opts[:'region_id'] if !opts[:'region_id'].nil?
231
-
232
- # header parameters
233
- header_params = opts[:header_params] || {}
234
- # HTTP header 'Accept' (if needed)
235
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
236
-
237
- # form parameters
238
- form_params = opts[:form_params] || {}
239
-
240
- # http body (model)
241
- post_body = opts[:debug_body]
242
-
243
- # return_type
244
- return_type = opts[:debug_return_type] || 'Array<RunnerFull>'
245
-
246
- # auth_names
247
- auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
248
-
249
- new_options = opts.merge(
250
- :operation => :"AdminApi.admin_list_runners",
251
- :header_params => header_params,
252
- :query_params => query_params,
253
- :form_params => form_params,
254
- :body => post_body,
255
- :auth_names => auth_names,
256
- :return_type => return_type
257
- )
258
-
259
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
260
- if @api_client.config.debugging
261
- @api_client.config.logger.debug "API called: AdminApi#admin_list_runners\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
262
- end
263
- return data, status_code, headers
264
- end
265
-
266
- # Update runner scheduling status
267
- # @param id [String]
268
- # @param [Hash] opts the optional parameters
269
- # @return [nil]
270
- def admin_update_runner_scheduling(id, opts = {})
271
- admin_update_runner_scheduling_with_http_info(id, opts)
272
- nil
273
- end
274
-
275
- # Update runner scheduling status
276
- # @param id [String]
277
- # @param [Hash] opts the optional parameters
278
- # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
279
- def admin_update_runner_scheduling_with_http_info(id, opts = {})
280
- if @api_client.config.debugging
281
- @api_client.config.logger.debug 'Calling API: AdminApi.admin_update_runner_scheduling ...'
282
- end
283
- # verify the required parameter 'id' is set
284
- if @api_client.config.client_side_validation && id.nil?
285
- fail ArgumentError, "Missing the required parameter 'id' when calling AdminApi.admin_update_runner_scheduling"
286
- end
287
- # resource path
288
- local_var_path = '/admin/runners/{id}/scheduling'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
289
-
290
- # query parameters
291
- query_params = opts[:query_params] || {}
292
-
293
- # header parameters
294
- header_params = opts[:header_params] || {}
295
-
296
- # form parameters
297
- form_params = opts[:form_params] || {}
298
-
299
- # http body (model)
300
- post_body = opts[:debug_body]
301
-
302
- # return_type
303
- return_type = opts[:debug_return_type]
304
-
305
- # auth_names
306
- auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
307
-
308
- new_options = opts.merge(
309
- :operation => :"AdminApi.admin_update_runner_scheduling",
310
- :header_params => header_params,
311
- :query_params => query_params,
312
- :form_params => form_params,
313
- :body => post_body,
314
- :auth_names => auth_names,
315
- :return_type => return_type
316
- )
317
-
318
- data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
319
- if @api_client.config.debugging
320
- @api_client.config.logger.debug "API called: AdminApi#admin_update_runner_scheduling\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
321
- end
322
- return data, status_code, headers
323
- end
324
- end
325
- end
@@ -1,299 +0,0 @@
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
@@ -1,77 +0,0 @@
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 RegionsApi
17
- attr_accessor :api_client
18
-
19
- def initialize(api_client = ApiClient.default)
20
- @api_client = api_client
21
- end
22
- # List all shared regions
23
- # @param [Hash] opts the optional parameters
24
- # @return [Array<Region>]
25
- def list_shared_regions(opts = {})
26
- data, _status_code, _headers = list_shared_regions_with_http_info(opts)
27
- data
28
- end
29
-
30
- # List all shared regions
31
- # @param [Hash] opts the optional parameters
32
- # @return [Array<(Array<Region>, Integer, Hash)>] Array<Region> data, response status code and response headers
33
- def list_shared_regions_with_http_info(opts = {})
34
- if @api_client.config.debugging
35
- @api_client.config.logger.debug 'Calling API: RegionsApi.list_shared_regions ...'
36
- end
37
- # resource path
38
- local_var_path = '/shared-regions'
39
-
40
- # query parameters
41
- query_params = opts[:query_params] || {}
42
-
43
- # header parameters
44
- header_params = opts[:header_params] || {}
45
- # HTTP header 'Accept' (if needed)
46
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
47
-
48
- # form parameters
49
- form_params = opts[:form_params] || {}
50
-
51
- # http body (model)
52
- post_body = opts[:debug_body]
53
-
54
- # return_type
55
- return_type = opts[:debug_return_type] || 'Array<Region>'
56
-
57
- # auth_names
58
- auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
59
-
60
- new_options = opts.merge(
61
- :operation => :"RegionsApi.list_shared_regions",
62
- :header_params => header_params,
63
- :query_params => query_params,
64
- :form_params => form_params,
65
- :body => post_body,
66
- :auth_names => auth_names,
67
- :return_type => return_type
68
- )
69
-
70
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
71
- if @api_client.config.debugging
72
- @api_client.config.logger.debug "API called: RegionsApi#list_shared_regions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
73
- end
74
- return data, status_code, headers
75
- end
76
- end
77
- end