daytona_api_client 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 (168) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/Gemfile.lock +101 -0
  4. data/Rakefile +10 -0
  5. data/daytona_api_client.gemspec +39 -0
  6. data/lib/daytona_api_client/api/api_keys_api.rb +401 -0
  7. data/lib/daytona_api_client/api/audit_api.rb +240 -0
  8. data/lib/daytona_api_client/api/config_api.rb +77 -0
  9. data/lib/daytona_api_client/api/docker_registry_api.rb +472 -0
  10. data/lib/daytona_api_client/api/health_api.rb +75 -0
  11. data/lib/daytona_api_client/api/object_storage_api.rb +80 -0
  12. data/lib/daytona_api_client/api/organizations_api.rb +1695 -0
  13. data/lib/daytona_api_client/api/preview_api.rb +209 -0
  14. data/lib/daytona_api_client/api/runners_api.rb +321 -0
  15. data/lib/daytona_api_client/api/sandbox_api.rb +1573 -0
  16. data/lib/daytona_api_client/api/snapshots_api.rb +641 -0
  17. data/lib/daytona_api_client/api/toolbox_api.rb +5108 -0
  18. data/lib/daytona_api_client/api/users_api.rb +553 -0
  19. data/lib/daytona_api_client/api/volumes_api.rb +342 -0
  20. data/lib/daytona_api_client/api/webhooks_api.rb +413 -0
  21. data/lib/daytona_api_client/api/workspace_api.rb +955 -0
  22. data/lib/daytona_api_client/api_client.rb +393 -0
  23. data/lib/daytona_api_client/api_error.rb +58 -0
  24. data/lib/daytona_api_client/configuration.rb +306 -0
  25. data/lib/daytona_api_client/models/account_provider.rb +261 -0
  26. data/lib/daytona_api_client/models/announcement.rb +246 -0
  27. data/lib/daytona_api_client/models/api_key_list.rb +384 -0
  28. data/lib/daytona_api_client/models/api_key_response.rb +344 -0
  29. data/lib/daytona_api_client/models/audit_log.rb +422 -0
  30. data/lib/daytona_api_client/models/build_info.rb +285 -0
  31. data/lib/daytona_api_client/models/command.rb +273 -0
  32. data/lib/daytona_api_client/models/completion_context.rb +244 -0
  33. data/lib/daytona_api_client/models/completion_item.rb +289 -0
  34. data/lib/daytona_api_client/models/completion_list.rb +263 -0
  35. data/lib/daytona_api_client/models/compressed_screenshot_response.rb +256 -0
  36. data/lib/daytona_api_client/models/computer_use_start_response.rb +263 -0
  37. data/lib/daytona_api_client/models/computer_use_status_response.rb +260 -0
  38. data/lib/daytona_api_client/models/computer_use_stop_response.rb +263 -0
  39. data/lib/daytona_api_client/models/create_api_key.rb +288 -0
  40. data/lib/daytona_api_client/models/create_audit_log.rb +350 -0
  41. data/lib/daytona_api_client/models/create_build_info.rb +248 -0
  42. data/lib/daytona_api_client/models/create_docker_registry.rb +388 -0
  43. data/lib/daytona_api_client/models/create_linked_account.rb +263 -0
  44. data/lib/daytona_api_client/models/create_organization.rb +236 -0
  45. data/lib/daytona_api_client/models/create_organization_invitation.rb +326 -0
  46. data/lib/daytona_api_client/models/create_organization_quota.rb +290 -0
  47. data/lib/daytona_api_client/models/create_organization_role.rb +304 -0
  48. data/lib/daytona_api_client/models/create_runner.rb +545 -0
  49. data/lib/daytona_api_client/models/create_sandbox.rb +429 -0
  50. data/lib/daytona_api_client/models/create_session_request.rb +236 -0
  51. data/lib/daytona_api_client/models/create_snapshot.rb +318 -0
  52. data/lib/daytona_api_client/models/create_user.rb +331 -0
  53. data/lib/daytona_api_client/models/create_volume.rb +235 -0
  54. data/lib/daytona_api_client/models/create_workspace.rb +411 -0
  55. data/lib/daytona_api_client/models/daytona_configuration.rb +531 -0
  56. data/lib/daytona_api_client/models/display_info_response.rb +238 -0
  57. data/lib/daytona_api_client/models/docker_registry.rb +449 -0
  58. data/lib/daytona_api_client/models/download_files.rb +238 -0
  59. data/lib/daytona_api_client/models/execute_request.rb +255 -0
  60. data/lib/daytona_api_client/models/execute_response.rb +263 -0
  61. data/lib/daytona_api_client/models/file_info.rb +417 -0
  62. data/lib/daytona_api_client/models/file_status.rb +313 -0
  63. data/lib/daytona_api_client/models/git_add_request.rb +264 -0
  64. data/lib/daytona_api_client/models/git_branch_request.rb +261 -0
  65. data/lib/daytona_api_client/models/git_checkout_request.rb +261 -0
  66. data/lib/daytona_api_client/models/git_clone_request.rb +297 -0
  67. data/lib/daytona_api_client/models/git_commit_info.rb +339 -0
  68. data/lib/daytona_api_client/models/git_commit_request.rb +325 -0
  69. data/lib/daytona_api_client/models/git_commit_response.rb +235 -0
  70. data/lib/daytona_api_client/models/git_delete_branch_request.rb +261 -0
  71. data/lib/daytona_api_client/models/git_repo_request.rb +253 -0
  72. data/lib/daytona_api_client/models/git_status.rb +290 -0
  73. data/lib/daytona_api_client/models/health_controller_check200_response.rb +253 -0
  74. data/lib/daytona_api_client/models/health_controller_check200_response_info_value.rb +235 -0
  75. data/lib/daytona_api_client/models/health_controller_check503_response.rb +253 -0
  76. data/lib/daytona_api_client/models/keyboard_hotkey_request.rb +236 -0
  77. data/lib/daytona_api_client/models/keyboard_press_request.rb +248 -0
  78. data/lib/daytona_api_client/models/keyboard_type_request.rb +246 -0
  79. data/lib/daytona_api_client/models/list_branch_response.rb +237 -0
  80. data/lib/daytona_api_client/models/lsp_completion_params.rb +325 -0
  81. data/lib/daytona_api_client/models/lsp_document_request.rb +290 -0
  82. data/lib/daytona_api_client/models/lsp_location.rb +261 -0
  83. data/lib/daytona_api_client/models/lsp_server_request.rb +263 -0
  84. data/lib/daytona_api_client/models/lsp_symbol.rb +287 -0
  85. data/lib/daytona_api_client/models/match.rb +287 -0
  86. data/lib/daytona_api_client/models/mouse_click_request.rb +283 -0
  87. data/lib/daytona_api_client/models/mouse_click_response.rb +263 -0
  88. data/lib/daytona_api_client/models/mouse_drag_request.rb +327 -0
  89. data/lib/daytona_api_client/models/mouse_drag_response.rb +263 -0
  90. data/lib/daytona_api_client/models/mouse_move_request.rb +263 -0
  91. data/lib/daytona_api_client/models/mouse_move_response.rb +263 -0
  92. data/lib/daytona_api_client/models/mouse_position.rb +263 -0
  93. data/lib/daytona_api_client/models/mouse_scroll_request.rb +300 -0
  94. data/lib/daytona_api_client/models/mouse_scroll_response.rb +236 -0
  95. data/lib/daytona_api_client/models/oidc_config.rb +290 -0
  96. data/lib/daytona_api_client/models/organization.rb +695 -0
  97. data/lib/daytona_api_client/models/organization_invitation.rb +534 -0
  98. data/lib/daytona_api_client/models/organization_role.rb +412 -0
  99. data/lib/daytona_api_client/models/organization_sandbox_default_limited_network_egress.rb +236 -0
  100. data/lib/daytona_api_client/models/organization_suspension.rb +290 -0
  101. data/lib/daytona_api_client/models/organization_usage_overview.rb +469 -0
  102. data/lib/daytona_api_client/models/organization_user.rb +451 -0
  103. data/lib/daytona_api_client/models/paginated_audit_logs.rb +315 -0
  104. data/lib/daytona_api_client/models/paginated_sandboxes.rb +315 -0
  105. data/lib/daytona_api_client/models/paginated_snapshots.rb +315 -0
  106. data/lib/daytona_api_client/models/paginated_snapshots_dto.rb +315 -0
  107. data/lib/daytona_api_client/models/port_preview_url.rb +273 -0
  108. data/lib/daytona_api_client/models/position.rb +261 -0
  109. data/lib/daytona_api_client/models/posthog_config.rb +263 -0
  110. data/lib/daytona_api_client/models/process_errors_response.rb +263 -0
  111. data/lib/daytona_api_client/models/process_logs_response.rb +263 -0
  112. data/lib/daytona_api_client/models/process_restart_response.rb +263 -0
  113. data/lib/daytona_api_client/models/process_status_response.rb +263 -0
  114. data/lib/daytona_api_client/models/project_dir_response.rb +218 -0
  115. data/lib/daytona_api_client/models/pty_create_request.rb +288 -0
  116. data/lib/daytona_api_client/models/pty_create_response.rb +236 -0
  117. data/lib/daytona_api_client/models/pty_list_response.rb +238 -0
  118. data/lib/daytona_api_client/models/pty_resize_request.rb +263 -0
  119. data/lib/daytona_api_client/models/pty_session_info.rb +425 -0
  120. data/lib/daytona_api_client/models/range.rb +261 -0
  121. data/lib/daytona_api_client/models/region.rb +236 -0
  122. data/lib/daytona_api_client/models/region_screenshot_response.rb +256 -0
  123. data/lib/daytona_api_client/models/registry_push_access_dto.rb +371 -0
  124. data/lib/daytona_api_client/models/replace_request.rb +289 -0
  125. data/lib/daytona_api_client/models/replace_result.rb +236 -0
  126. data/lib/daytona_api_client/models/runner.rb +780 -0
  127. data/lib/daytona_api_client/models/runner_snapshot_dto.rb +290 -0
  128. data/lib/daytona_api_client/models/runner_state.rb +43 -0
  129. data/lib/daytona_api_client/models/sandbox.rb +755 -0
  130. data/lib/daytona_api_client/models/sandbox_class.rb +41 -0
  131. data/lib/daytona_api_client/models/sandbox_desired_state.rb +43 -0
  132. data/lib/daytona_api_client/models/sandbox_info.rb +273 -0
  133. data/lib/daytona_api_client/models/sandbox_labels.rb +238 -0
  134. data/lib/daytona_api_client/models/sandbox_state.rb +54 -0
  135. data/lib/daytona_api_client/models/sandbox_volume.rb +263 -0
  136. data/lib/daytona_api_client/models/screenshot_response.rb +256 -0
  137. data/lib/daytona_api_client/models/search_files_response.rb +237 -0
  138. data/lib/daytona_api_client/models/send_webhook_dto.rb +273 -0
  139. data/lib/daytona_api_client/models/session.rb +251 -0
  140. data/lib/daytona_api_client/models/session_execute_request.rb +256 -0
  141. data/lib/daytona_api_client/models/session_execute_response.rb +239 -0
  142. data/lib/daytona_api_client/models/set_snapshot_general_status_dto.rb +236 -0
  143. data/lib/daytona_api_client/models/snapshot_dto.rb +569 -0
  144. data/lib/daytona_api_client/models/snapshot_state.rb +49 -0
  145. data/lib/daytona_api_client/models/ssh_access_dto.rb +371 -0
  146. data/lib/daytona_api_client/models/ssh_access_validation_dto.rb +283 -0
  147. data/lib/daytona_api_client/models/storage_access_dto.rb +371 -0
  148. data/lib/daytona_api_client/models/update_docker_registry.rb +310 -0
  149. data/lib/daytona_api_client/models/update_organization_invitation.rb +299 -0
  150. data/lib/daytona_api_client/models/update_organization_member_access.rb +289 -0
  151. data/lib/daytona_api_client/models/update_organization_quota.rb +317 -0
  152. data/lib/daytona_api_client/models/update_organization_role.rb +304 -0
  153. data/lib/daytona_api_client/models/update_sandbox_state_dto.rb +260 -0
  154. data/lib/daytona_api_client/models/user.rb +346 -0
  155. data/lib/daytona_api_client/models/user_home_dir_response.rb +218 -0
  156. data/lib/daytona_api_client/models/user_public_key.rb +263 -0
  157. data/lib/daytona_api_client/models/volume_dto.rb +417 -0
  158. data/lib/daytona_api_client/models/volume_state.rb +45 -0
  159. data/lib/daytona_api_client/models/webhook_app_portal_access.rb +236 -0
  160. data/lib/daytona_api_client/models/webhook_controller_get_status200_response.rb +218 -0
  161. data/lib/daytona_api_client/models/webhook_initialization_status.rb +343 -0
  162. data/lib/daytona_api_client/models/windows_response.rb +265 -0
  163. data/lib/daytona_api_client/models/work_dir_response.rb +218 -0
  164. data/lib/daytona_api_client/models/workspace.rb +834 -0
  165. data/lib/daytona_api_client/version.rb +15 -0
  166. data/lib/daytona_api_client.rb +194 -0
  167. data/project.json +37 -0
  168. metadata +246 -0
@@ -0,0 +1,1573 @@
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 SandboxApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Archive sandbox
23
+ # @param sandbox_id [String]
24
+ # @param [Hash] opts the optional parameters
25
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
26
+ # @return [nil]
27
+ def archive_sandbox(sandbox_id, opts = {})
28
+ archive_sandbox_with_http_info(sandbox_id, opts)
29
+ nil
30
+ end
31
+
32
+ # Archive sandbox
33
+ # @param sandbox_id [String]
34
+ # @param [Hash] opts the optional parameters
35
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
36
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
37
+ def archive_sandbox_with_http_info(sandbox_id, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: SandboxApi.archive_sandbox ...'
40
+ end
41
+ # verify the required parameter 'sandbox_id' is set
42
+ if @api_client.config.client_side_validation && sandbox_id.nil?
43
+ fail ArgumentError, "Missing the required parameter 'sandbox_id' when calling SandboxApi.archive_sandbox"
44
+ end
45
+ # resource path
46
+ local_var_path = '/sandbox/{sandboxId}/archive'.sub('{' + 'sandboxId' + '}', CGI.escape(sandbox_id.to_s))
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+
51
+ # header parameters
52
+ header_params = opts[:header_params] || {}
53
+ header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?
54
+
55
+ # form parameters
56
+ form_params = opts[:form_params] || {}
57
+
58
+ # http body (model)
59
+ post_body = opts[:debug_body]
60
+
61
+ # return_type
62
+ return_type = opts[:debug_return_type]
63
+
64
+ # auth_names
65
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
66
+
67
+ new_options = opts.merge(
68
+ :operation => :"SandboxApi.archive_sandbox",
69
+ :header_params => header_params,
70
+ :query_params => query_params,
71
+ :form_params => form_params,
72
+ :body => post_body,
73
+ :auth_names => auth_names,
74
+ :return_type => return_type
75
+ )
76
+
77
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
78
+ if @api_client.config.debugging
79
+ @api_client.config.logger.debug "API called: SandboxApi#archive_sandbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
80
+ end
81
+ return data, status_code, headers
82
+ end
83
+
84
+ # Create sandbox backup
85
+ # @param sandbox_id [String] ID of the sandbox
86
+ # @param [Hash] opts the optional parameters
87
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
88
+ # @return [Sandbox]
89
+ def create_backup(sandbox_id, opts = {})
90
+ data, _status_code, _headers = create_backup_with_http_info(sandbox_id, opts)
91
+ data
92
+ end
93
+
94
+ # Create sandbox backup
95
+ # @param sandbox_id [String] ID of the sandbox
96
+ # @param [Hash] opts the optional parameters
97
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
98
+ # @return [Array<(Sandbox, Integer, Hash)>] Sandbox data, response status code and response headers
99
+ def create_backup_with_http_info(sandbox_id, opts = {})
100
+ if @api_client.config.debugging
101
+ @api_client.config.logger.debug 'Calling API: SandboxApi.create_backup ...'
102
+ end
103
+ # verify the required parameter 'sandbox_id' is set
104
+ if @api_client.config.client_side_validation && sandbox_id.nil?
105
+ fail ArgumentError, "Missing the required parameter 'sandbox_id' when calling SandboxApi.create_backup"
106
+ end
107
+ # resource path
108
+ local_var_path = '/sandbox/{sandboxId}/backup'.sub('{' + 'sandboxId' + '}', CGI.escape(sandbox_id.to_s))
109
+
110
+ # query parameters
111
+ query_params = opts[:query_params] || {}
112
+
113
+ # header parameters
114
+ header_params = opts[:header_params] || {}
115
+ # HTTP header 'Accept' (if needed)
116
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
117
+ header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?
118
+
119
+ # form parameters
120
+ form_params = opts[:form_params] || {}
121
+
122
+ # http body (model)
123
+ post_body = opts[:debug_body]
124
+
125
+ # return_type
126
+ return_type = opts[:debug_return_type] || 'Sandbox'
127
+
128
+ # auth_names
129
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
130
+
131
+ new_options = opts.merge(
132
+ :operation => :"SandboxApi.create_backup",
133
+ :header_params => header_params,
134
+ :query_params => query_params,
135
+ :form_params => form_params,
136
+ :body => post_body,
137
+ :auth_names => auth_names,
138
+ :return_type => return_type
139
+ )
140
+
141
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
142
+ if @api_client.config.debugging
143
+ @api_client.config.logger.debug "API called: SandboxApi#create_backup\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
144
+ end
145
+ return data, status_code, headers
146
+ end
147
+
148
+ # Create a new sandbox
149
+ # @param create_sandbox [CreateSandbox]
150
+ # @param [Hash] opts the optional parameters
151
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
152
+ # @return [Sandbox]
153
+ def create_sandbox(create_sandbox, opts = {})
154
+ data, _status_code, _headers = create_sandbox_with_http_info(create_sandbox, opts)
155
+ data
156
+ end
157
+
158
+ # Create a new sandbox
159
+ # @param create_sandbox [CreateSandbox]
160
+ # @param [Hash] opts the optional parameters
161
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
162
+ # @return [Array<(Sandbox, Integer, Hash)>] Sandbox data, response status code and response headers
163
+ def create_sandbox_with_http_info(create_sandbox, opts = {})
164
+ if @api_client.config.debugging
165
+ @api_client.config.logger.debug 'Calling API: SandboxApi.create_sandbox ...'
166
+ end
167
+ # verify the required parameter 'create_sandbox' is set
168
+ if @api_client.config.client_side_validation && create_sandbox.nil?
169
+ fail ArgumentError, "Missing the required parameter 'create_sandbox' when calling SandboxApi.create_sandbox"
170
+ end
171
+ # resource path
172
+ local_var_path = '/sandbox'
173
+
174
+ # query parameters
175
+ query_params = opts[:query_params] || {}
176
+
177
+ # header parameters
178
+ header_params = opts[:header_params] || {}
179
+ # HTTP header 'Accept' (if needed)
180
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
181
+ # HTTP header 'Content-Type'
182
+ content_type = @api_client.select_header_content_type(['application/json'])
183
+ if !content_type.nil?
184
+ header_params['Content-Type'] = content_type
185
+ end
186
+ header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?
187
+
188
+ # form parameters
189
+ form_params = opts[:form_params] || {}
190
+
191
+ # http body (model)
192
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_sandbox)
193
+
194
+ # return_type
195
+ return_type = opts[:debug_return_type] || 'Sandbox'
196
+
197
+ # auth_names
198
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
199
+
200
+ new_options = opts.merge(
201
+ :operation => :"SandboxApi.create_sandbox",
202
+ :header_params => header_params,
203
+ :query_params => query_params,
204
+ :form_params => form_params,
205
+ :body => post_body,
206
+ :auth_names => auth_names,
207
+ :return_type => return_type
208
+ )
209
+
210
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
211
+ if @api_client.config.debugging
212
+ @api_client.config.logger.debug "API called: SandboxApi#create_sandbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
213
+ end
214
+ return data, status_code, headers
215
+ end
216
+
217
+ # Create SSH access for sandbox
218
+ # @param sandbox_id [String] ID of the sandbox
219
+ # @param [Hash] opts the optional parameters
220
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
221
+ # @option opts [Float] :expires_in_minutes Expiration time in minutes (default: 60)
222
+ # @return [SshAccessDto]
223
+ def create_ssh_access(sandbox_id, opts = {})
224
+ data, _status_code, _headers = create_ssh_access_with_http_info(sandbox_id, opts)
225
+ data
226
+ end
227
+
228
+ # Create SSH access for sandbox
229
+ # @param sandbox_id [String] ID of the sandbox
230
+ # @param [Hash] opts the optional parameters
231
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
232
+ # @option opts [Float] :expires_in_minutes Expiration time in minutes (default: 60)
233
+ # @return [Array<(SshAccessDto, Integer, Hash)>] SshAccessDto data, response status code and response headers
234
+ def create_ssh_access_with_http_info(sandbox_id, opts = {})
235
+ if @api_client.config.debugging
236
+ @api_client.config.logger.debug 'Calling API: SandboxApi.create_ssh_access ...'
237
+ end
238
+ # verify the required parameter 'sandbox_id' is set
239
+ if @api_client.config.client_side_validation && sandbox_id.nil?
240
+ fail ArgumentError, "Missing the required parameter 'sandbox_id' when calling SandboxApi.create_ssh_access"
241
+ end
242
+ # resource path
243
+ local_var_path = '/sandbox/{sandboxId}/ssh-access'.sub('{' + 'sandboxId' + '}', CGI.escape(sandbox_id.to_s))
244
+
245
+ # query parameters
246
+ query_params = opts[:query_params] || {}
247
+ query_params[:'expiresInMinutes'] = opts[:'expires_in_minutes'] if !opts[:'expires_in_minutes'].nil?
248
+
249
+ # header parameters
250
+ header_params = opts[:header_params] || {}
251
+ # HTTP header 'Accept' (if needed)
252
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
253
+ header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?
254
+
255
+ # form parameters
256
+ form_params = opts[:form_params] || {}
257
+
258
+ # http body (model)
259
+ post_body = opts[:debug_body]
260
+
261
+ # return_type
262
+ return_type = opts[:debug_return_type] || 'SshAccessDto'
263
+
264
+ # auth_names
265
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
266
+
267
+ new_options = opts.merge(
268
+ :operation => :"SandboxApi.create_ssh_access",
269
+ :header_params => header_params,
270
+ :query_params => query_params,
271
+ :form_params => form_params,
272
+ :body => post_body,
273
+ :auth_names => auth_names,
274
+ :return_type => return_type
275
+ )
276
+
277
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
278
+ if @api_client.config.debugging
279
+ @api_client.config.logger.debug "API called: SandboxApi#create_ssh_access\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
280
+ end
281
+ return data, status_code, headers
282
+ end
283
+
284
+ # Delete sandbox
285
+ # @param sandbox_id [String] ID of the sandbox
286
+ # @param [Hash] opts the optional parameters
287
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
288
+ # @return [nil]
289
+ def delete_sandbox(sandbox_id, opts = {})
290
+ delete_sandbox_with_http_info(sandbox_id, opts)
291
+ nil
292
+ end
293
+
294
+ # Delete sandbox
295
+ # @param sandbox_id [String] ID of the sandbox
296
+ # @param [Hash] opts the optional parameters
297
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
298
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
299
+ def delete_sandbox_with_http_info(sandbox_id, opts = {})
300
+ if @api_client.config.debugging
301
+ @api_client.config.logger.debug 'Calling API: SandboxApi.delete_sandbox ...'
302
+ end
303
+ # verify the required parameter 'sandbox_id' is set
304
+ if @api_client.config.client_side_validation && sandbox_id.nil?
305
+ fail ArgumentError, "Missing the required parameter 'sandbox_id' when calling SandboxApi.delete_sandbox"
306
+ end
307
+ # resource path
308
+ local_var_path = '/sandbox/{sandboxId}'.sub('{' + 'sandboxId' + '}', CGI.escape(sandbox_id.to_s))
309
+
310
+ # query parameters
311
+ query_params = opts[:query_params] || {}
312
+
313
+ # header parameters
314
+ header_params = opts[:header_params] || {}
315
+ header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?
316
+
317
+ # form parameters
318
+ form_params = opts[:form_params] || {}
319
+
320
+ # http body (model)
321
+ post_body = opts[:debug_body]
322
+
323
+ # return_type
324
+ return_type = opts[:debug_return_type]
325
+
326
+ # auth_names
327
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
328
+
329
+ new_options = opts.merge(
330
+ :operation => :"SandboxApi.delete_sandbox",
331
+ :header_params => header_params,
332
+ :query_params => query_params,
333
+ :form_params => form_params,
334
+ :body => post_body,
335
+ :auth_names => auth_names,
336
+ :return_type => return_type
337
+ )
338
+
339
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
340
+ if @api_client.config.debugging
341
+ @api_client.config.logger.debug "API called: SandboxApi#delete_sandbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
342
+ end
343
+ return data, status_code, headers
344
+ end
345
+
346
+ # Get build logs
347
+ # @param sandbox_id [String] ID of the sandbox
348
+ # @param [Hash] opts the optional parameters
349
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
350
+ # @option opts [Boolean] :follow Whether to follow the logs stream
351
+ # @return [nil]
352
+ def get_build_logs(sandbox_id, opts = {})
353
+ get_build_logs_with_http_info(sandbox_id, opts)
354
+ nil
355
+ end
356
+
357
+ # Get build logs
358
+ # @param sandbox_id [String] ID of the sandbox
359
+ # @param [Hash] opts the optional parameters
360
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
361
+ # @option opts [Boolean] :follow Whether to follow the logs stream
362
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
363
+ def get_build_logs_with_http_info(sandbox_id, opts = {})
364
+ if @api_client.config.debugging
365
+ @api_client.config.logger.debug 'Calling API: SandboxApi.get_build_logs ...'
366
+ end
367
+ # verify the required parameter 'sandbox_id' is set
368
+ if @api_client.config.client_side_validation && sandbox_id.nil?
369
+ fail ArgumentError, "Missing the required parameter 'sandbox_id' when calling SandboxApi.get_build_logs"
370
+ end
371
+ # resource path
372
+ local_var_path = '/sandbox/{sandboxId}/build-logs'.sub('{' + 'sandboxId' + '}', CGI.escape(sandbox_id.to_s))
373
+
374
+ # query parameters
375
+ query_params = opts[:query_params] || {}
376
+ query_params[:'follow'] = opts[:'follow'] if !opts[:'follow'].nil?
377
+
378
+ # header parameters
379
+ header_params = opts[:header_params] || {}
380
+ header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?
381
+
382
+ # form parameters
383
+ form_params = opts[:form_params] || {}
384
+
385
+ # http body (model)
386
+ post_body = opts[:debug_body]
387
+
388
+ # return_type
389
+ return_type = opts[:debug_return_type]
390
+
391
+ # auth_names
392
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
393
+
394
+ new_options = opts.merge(
395
+ :operation => :"SandboxApi.get_build_logs",
396
+ :header_params => header_params,
397
+ :query_params => query_params,
398
+ :form_params => form_params,
399
+ :body => post_body,
400
+ :auth_names => auth_names,
401
+ :return_type => return_type
402
+ )
403
+
404
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
405
+ if @api_client.config.debugging
406
+ @api_client.config.logger.debug "API called: SandboxApi#get_build_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
407
+ end
408
+ return data, status_code, headers
409
+ end
410
+
411
+ # Get preview URL for a sandbox port
412
+ # @param sandbox_id [String] ID of the sandbox
413
+ # @param port [Float] Port number to get preview URL for
414
+ # @param [Hash] opts the optional parameters
415
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
416
+ # @return [PortPreviewUrl]
417
+ def get_port_preview_url(sandbox_id, port, opts = {})
418
+ data, _status_code, _headers = get_port_preview_url_with_http_info(sandbox_id, port, opts)
419
+ data
420
+ end
421
+
422
+ # Get preview URL for a sandbox port
423
+ # @param sandbox_id [String] ID of the sandbox
424
+ # @param port [Float] Port number to get preview URL for
425
+ # @param [Hash] opts the optional parameters
426
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
427
+ # @return [Array<(PortPreviewUrl, Integer, Hash)>] PortPreviewUrl data, response status code and response headers
428
+ def get_port_preview_url_with_http_info(sandbox_id, port, opts = {})
429
+ if @api_client.config.debugging
430
+ @api_client.config.logger.debug 'Calling API: SandboxApi.get_port_preview_url ...'
431
+ end
432
+ # verify the required parameter 'sandbox_id' is set
433
+ if @api_client.config.client_side_validation && sandbox_id.nil?
434
+ fail ArgumentError, "Missing the required parameter 'sandbox_id' when calling SandboxApi.get_port_preview_url"
435
+ end
436
+ # verify the required parameter 'port' is set
437
+ if @api_client.config.client_side_validation && port.nil?
438
+ fail ArgumentError, "Missing the required parameter 'port' when calling SandboxApi.get_port_preview_url"
439
+ end
440
+ # resource path
441
+ local_var_path = '/sandbox/{sandboxId}/ports/{port}/preview-url'.sub('{' + 'sandboxId' + '}', CGI.escape(sandbox_id.to_s)).sub('{' + 'port' + '}', CGI.escape(port.to_s))
442
+
443
+ # query parameters
444
+ query_params = opts[:query_params] || {}
445
+
446
+ # header parameters
447
+ header_params = opts[:header_params] || {}
448
+ # HTTP header 'Accept' (if needed)
449
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
450
+ header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?
451
+
452
+ # form parameters
453
+ form_params = opts[:form_params] || {}
454
+
455
+ # http body (model)
456
+ post_body = opts[:debug_body]
457
+
458
+ # return_type
459
+ return_type = opts[:debug_return_type] || 'PortPreviewUrl'
460
+
461
+ # auth_names
462
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
463
+
464
+ new_options = opts.merge(
465
+ :operation => :"SandboxApi.get_port_preview_url",
466
+ :header_params => header_params,
467
+ :query_params => query_params,
468
+ :form_params => form_params,
469
+ :body => post_body,
470
+ :auth_names => auth_names,
471
+ :return_type => return_type
472
+ )
473
+
474
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
475
+ if @api_client.config.debugging
476
+ @api_client.config.logger.debug "API called: SandboxApi#get_port_preview_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
477
+ end
478
+ return data, status_code, headers
479
+ end
480
+
481
+ # Get sandbox details
482
+ # @param sandbox_id [String] ID of the sandbox
483
+ # @param [Hash] opts the optional parameters
484
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
485
+ # @option opts [Boolean] :verbose Include verbose output
486
+ # @return [Sandbox]
487
+ def get_sandbox(sandbox_id, opts = {})
488
+ data, _status_code, _headers = get_sandbox_with_http_info(sandbox_id, opts)
489
+ data
490
+ end
491
+
492
+ # Get sandbox details
493
+ # @param sandbox_id [String] ID of the sandbox
494
+ # @param [Hash] opts the optional parameters
495
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
496
+ # @option opts [Boolean] :verbose Include verbose output
497
+ # @return [Array<(Sandbox, Integer, Hash)>] Sandbox data, response status code and response headers
498
+ def get_sandbox_with_http_info(sandbox_id, opts = {})
499
+ if @api_client.config.debugging
500
+ @api_client.config.logger.debug 'Calling API: SandboxApi.get_sandbox ...'
501
+ end
502
+ # verify the required parameter 'sandbox_id' is set
503
+ if @api_client.config.client_side_validation && sandbox_id.nil?
504
+ fail ArgumentError, "Missing the required parameter 'sandbox_id' when calling SandboxApi.get_sandbox"
505
+ end
506
+ # resource path
507
+ local_var_path = '/sandbox/{sandboxId}'.sub('{' + 'sandboxId' + '}', CGI.escape(sandbox_id.to_s))
508
+
509
+ # query parameters
510
+ query_params = opts[:query_params] || {}
511
+ query_params[:'verbose'] = opts[:'verbose'] if !opts[:'verbose'].nil?
512
+
513
+ # header parameters
514
+ header_params = opts[:header_params] || {}
515
+ # HTTP header 'Accept' (if needed)
516
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
517
+ header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?
518
+
519
+ # form parameters
520
+ form_params = opts[:form_params] || {}
521
+
522
+ # http body (model)
523
+ post_body = opts[:debug_body]
524
+
525
+ # return_type
526
+ return_type = opts[:debug_return_type] || 'Sandbox'
527
+
528
+ # auth_names
529
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
530
+
531
+ new_options = opts.merge(
532
+ :operation => :"SandboxApi.get_sandbox",
533
+ :header_params => header_params,
534
+ :query_params => query_params,
535
+ :form_params => form_params,
536
+ :body => post_body,
537
+ :auth_names => auth_names,
538
+ :return_type => return_type
539
+ )
540
+
541
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
542
+ if @api_client.config.debugging
543
+ @api_client.config.logger.debug "API called: SandboxApi#get_sandbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
544
+ end
545
+ return data, status_code, headers
546
+ end
547
+
548
+ # List all regions where sandboxes have been created
549
+ # @param [Hash] opts the optional parameters
550
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
551
+ # @return [Array<Region>]
552
+ def get_sandbox_regions(opts = {})
553
+ data, _status_code, _headers = get_sandbox_regions_with_http_info(opts)
554
+ data
555
+ end
556
+
557
+ # List all regions where sandboxes have been created
558
+ # @param [Hash] opts the optional parameters
559
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
560
+ # @return [Array<(Array<Region>, Integer, Hash)>] Array<Region> data, response status code and response headers
561
+ def get_sandbox_regions_with_http_info(opts = {})
562
+ if @api_client.config.debugging
563
+ @api_client.config.logger.debug 'Calling API: SandboxApi.get_sandbox_regions ...'
564
+ end
565
+ # resource path
566
+ local_var_path = '/sandbox/regions'
567
+
568
+ # query parameters
569
+ query_params = opts[:query_params] || {}
570
+
571
+ # header parameters
572
+ header_params = opts[:header_params] || {}
573
+ # HTTP header 'Accept' (if needed)
574
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
575
+ header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?
576
+
577
+ # form parameters
578
+ form_params = opts[:form_params] || {}
579
+
580
+ # http body (model)
581
+ post_body = opts[:debug_body]
582
+
583
+ # return_type
584
+ return_type = opts[:debug_return_type] || 'Array<Region>'
585
+
586
+ # auth_names
587
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
588
+
589
+ new_options = opts.merge(
590
+ :operation => :"SandboxApi.get_sandbox_regions",
591
+ :header_params => header_params,
592
+ :query_params => query_params,
593
+ :form_params => form_params,
594
+ :body => post_body,
595
+ :auth_names => auth_names,
596
+ :return_type => return_type
597
+ )
598
+
599
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
600
+ if @api_client.config.debugging
601
+ @api_client.config.logger.debug "API called: SandboxApi#get_sandbox_regions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
602
+ end
603
+ return data, status_code, headers
604
+ end
605
+
606
+ # Get sandboxes for the authenticated runner
607
+ # @param [Hash] opts the optional parameters
608
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
609
+ # @option opts [String] :states Comma-separated list of sandbox states to filter by
610
+ # @option opts [Boolean] :skip_reconciling_sandboxes Skip sandboxes where state differs from desired state
611
+ # @return [Array<Sandbox>]
612
+ def get_sandboxes_for_runner(opts = {})
613
+ data, _status_code, _headers = get_sandboxes_for_runner_with_http_info(opts)
614
+ data
615
+ end
616
+
617
+ # Get sandboxes for the authenticated runner
618
+ # @param [Hash] opts the optional parameters
619
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
620
+ # @option opts [String] :states Comma-separated list of sandbox states to filter by
621
+ # @option opts [Boolean] :skip_reconciling_sandboxes Skip sandboxes where state differs from desired state
622
+ # @return [Array<(Array<Sandbox>, Integer, Hash)>] Array<Sandbox> data, response status code and response headers
623
+ def get_sandboxes_for_runner_with_http_info(opts = {})
624
+ if @api_client.config.debugging
625
+ @api_client.config.logger.debug 'Calling API: SandboxApi.get_sandboxes_for_runner ...'
626
+ end
627
+ # resource path
628
+ local_var_path = '/sandbox/for-runner'
629
+
630
+ # query parameters
631
+ query_params = opts[:query_params] || {}
632
+ query_params[:'states'] = opts[:'states'] if !opts[:'states'].nil?
633
+ query_params[:'skipReconcilingSandboxes'] = opts[:'skip_reconciling_sandboxes'] if !opts[:'skip_reconciling_sandboxes'].nil?
634
+
635
+ # header parameters
636
+ header_params = opts[:header_params] || {}
637
+ # HTTP header 'Accept' (if needed)
638
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
639
+ header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?
640
+
641
+ # form parameters
642
+ form_params = opts[:form_params] || {}
643
+
644
+ # http body (model)
645
+ post_body = opts[:debug_body]
646
+
647
+ # return_type
648
+ return_type = opts[:debug_return_type] || 'Array<Sandbox>'
649
+
650
+ # auth_names
651
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
652
+
653
+ new_options = opts.merge(
654
+ :operation => :"SandboxApi.get_sandboxes_for_runner",
655
+ :header_params => header_params,
656
+ :query_params => query_params,
657
+ :form_params => form_params,
658
+ :body => post_body,
659
+ :auth_names => auth_names,
660
+ :return_type => return_type
661
+ )
662
+
663
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
664
+ if @api_client.config.debugging
665
+ @api_client.config.logger.debug "API called: SandboxApi#get_sandboxes_for_runner\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
666
+ end
667
+ return data, status_code, headers
668
+ end
669
+
670
+ # List all sandboxes
671
+ # @param [Hash] opts the optional parameters
672
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
673
+ # @option opts [Boolean] :verbose Include verbose output
674
+ # @option opts [String] :labels JSON encoded labels to filter by
675
+ # @option opts [Boolean] :include_errored_deleted Include errored and deleted sandboxes
676
+ # @return [Array<Sandbox>]
677
+ def list_sandboxes(opts = {})
678
+ data, _status_code, _headers = list_sandboxes_with_http_info(opts)
679
+ data
680
+ end
681
+
682
+ # List all sandboxes
683
+ # @param [Hash] opts the optional parameters
684
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
685
+ # @option opts [Boolean] :verbose Include verbose output
686
+ # @option opts [String] :labels JSON encoded labels to filter by
687
+ # @option opts [Boolean] :include_errored_deleted Include errored and deleted sandboxes
688
+ # @return [Array<(Array<Sandbox>, Integer, Hash)>] Array<Sandbox> data, response status code and response headers
689
+ def list_sandboxes_with_http_info(opts = {})
690
+ if @api_client.config.debugging
691
+ @api_client.config.logger.debug 'Calling API: SandboxApi.list_sandboxes ...'
692
+ end
693
+ # resource path
694
+ local_var_path = '/sandbox'
695
+
696
+ # query parameters
697
+ query_params = opts[:query_params] || {}
698
+ query_params[:'verbose'] = opts[:'verbose'] if !opts[:'verbose'].nil?
699
+ query_params[:'labels'] = opts[:'labels'] if !opts[:'labels'].nil?
700
+ query_params[:'includeErroredDeleted'] = opts[:'include_errored_deleted'] if !opts[:'include_errored_deleted'].nil?
701
+
702
+ # header parameters
703
+ header_params = opts[:header_params] || {}
704
+ # HTTP header 'Accept' (if needed)
705
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
706
+ header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?
707
+
708
+ # form parameters
709
+ form_params = opts[:form_params] || {}
710
+
711
+ # http body (model)
712
+ post_body = opts[:debug_body]
713
+
714
+ # return_type
715
+ return_type = opts[:debug_return_type] || 'Array<Sandbox>'
716
+
717
+ # auth_names
718
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
719
+
720
+ new_options = opts.merge(
721
+ :operation => :"SandboxApi.list_sandboxes",
722
+ :header_params => header_params,
723
+ :query_params => query_params,
724
+ :form_params => form_params,
725
+ :body => post_body,
726
+ :auth_names => auth_names,
727
+ :return_type => return_type
728
+ )
729
+
730
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
731
+ if @api_client.config.debugging
732
+ @api_client.config.logger.debug "API called: SandboxApi#list_sandboxes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
733
+ end
734
+ return data, status_code, headers
735
+ end
736
+
737
+ # List all sandboxes paginated
738
+ # @param [Hash] opts the optional parameters
739
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
740
+ # @option opts [Float] :page Page number of the results (default to 1)
741
+ # @option opts [Float] :limit Number of results per page (default to 100)
742
+ # @option opts [String] :id Filter by partial ID match
743
+ # @option opts [String] :labels JSON encoded labels to filter by
744
+ # @option opts [Boolean] :include_errored_deleted Include results with errored state and deleted desired state (default to false)
745
+ # @option opts [Array<String>] :states List of states to filter by
746
+ # @option opts [Array<String>] :snapshots List of snapshot names to filter by
747
+ # @option opts [Array<String>] :regions List of regions to filter by
748
+ # @option opts [Float] :min_cpu Minimum CPU
749
+ # @option opts [Float] :max_cpu Maximum CPU
750
+ # @option opts [Float] :min_memory_gi_b Minimum memory in GiB
751
+ # @option opts [Float] :max_memory_gi_b Maximum memory in GiB
752
+ # @option opts [Float] :min_disk_gi_b Minimum disk space in GiB
753
+ # @option opts [Float] :max_disk_gi_b Maximum disk space in GiB
754
+ # @option opts [Time] :last_event_after Include items with last event after this timestamp
755
+ # @option opts [Time] :last_event_before Include items with last event before this timestamp
756
+ # @option opts [String] :sort Field to sort by (default to 'createdAt')
757
+ # @option opts [String] :order Direction to sort by (default to 'desc')
758
+ # @return [PaginatedSandboxes]
759
+ def list_sandboxes_paginated(opts = {})
760
+ data, _status_code, _headers = list_sandboxes_paginated_with_http_info(opts)
761
+ data
762
+ end
763
+
764
+ # List all sandboxes paginated
765
+ # @param [Hash] opts the optional parameters
766
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
767
+ # @option opts [Float] :page Page number of the results (default to 1)
768
+ # @option opts [Float] :limit Number of results per page (default to 100)
769
+ # @option opts [String] :id Filter by partial ID match
770
+ # @option opts [String] :labels JSON encoded labels to filter by
771
+ # @option opts [Boolean] :include_errored_deleted Include results with errored state and deleted desired state (default to false)
772
+ # @option opts [Array<String>] :states List of states to filter by
773
+ # @option opts [Array<String>] :snapshots List of snapshot names to filter by
774
+ # @option opts [Array<String>] :regions List of regions to filter by
775
+ # @option opts [Float] :min_cpu Minimum CPU
776
+ # @option opts [Float] :max_cpu Maximum CPU
777
+ # @option opts [Float] :min_memory_gi_b Minimum memory in GiB
778
+ # @option opts [Float] :max_memory_gi_b Maximum memory in GiB
779
+ # @option opts [Float] :min_disk_gi_b Minimum disk space in GiB
780
+ # @option opts [Float] :max_disk_gi_b Maximum disk space in GiB
781
+ # @option opts [Time] :last_event_after Include items with last event after this timestamp
782
+ # @option opts [Time] :last_event_before Include items with last event before this timestamp
783
+ # @option opts [String] :sort Field to sort by (default to 'createdAt')
784
+ # @option opts [String] :order Direction to sort by (default to 'desc')
785
+ # @return [Array<(PaginatedSandboxes, Integer, Hash)>] PaginatedSandboxes data, response status code and response headers
786
+ def list_sandboxes_paginated_with_http_info(opts = {})
787
+ if @api_client.config.debugging
788
+ @api_client.config.logger.debug 'Calling API: SandboxApi.list_sandboxes_paginated ...'
789
+ end
790
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
791
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling SandboxApi.list_sandboxes_paginated, must be greater than or equal to 1.'
792
+ end
793
+
794
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 200
795
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SandboxApi.list_sandboxes_paginated, must be smaller than or equal to 200.'
796
+ end
797
+
798
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
799
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SandboxApi.list_sandboxes_paginated, must be greater than or equal to 1.'
800
+ end
801
+
802
+ allowable_values = ["creating", "restoring", "destroying", "started", "stopped", "starting", "stopping", "error", "build_failed", "pending_build", "building_snapshot", "unknown", "pulling_snapshot", "archived", "archiving"]
803
+ if @api_client.config.client_side_validation && opts[:'states'] && !opts[:'states'].all? { |item| allowable_values.include?(item) }
804
+ fail ArgumentError, "invalid value for \"states\", must include one of #{allowable_values}"
805
+ end
806
+ if @api_client.config.client_side_validation && !opts[:'min_cpu'].nil? && opts[:'min_cpu'] < 1
807
+ fail ArgumentError, 'invalid value for "opts[:"min_cpu"]" when calling SandboxApi.list_sandboxes_paginated, must be greater than or equal to 1.'
808
+ end
809
+
810
+ if @api_client.config.client_side_validation && !opts[:'max_cpu'].nil? && opts[:'max_cpu'] < 1
811
+ fail ArgumentError, 'invalid value for "opts[:"max_cpu"]" when calling SandboxApi.list_sandboxes_paginated, must be greater than or equal to 1.'
812
+ end
813
+
814
+ if @api_client.config.client_side_validation && !opts[:'min_memory_gi_b'].nil? && opts[:'min_memory_gi_b'] < 1
815
+ fail ArgumentError, 'invalid value for "opts[:"min_memory_gi_b"]" when calling SandboxApi.list_sandboxes_paginated, must be greater than or equal to 1.'
816
+ end
817
+
818
+ if @api_client.config.client_side_validation && !opts[:'max_memory_gi_b'].nil? && opts[:'max_memory_gi_b'] < 1
819
+ fail ArgumentError, 'invalid value for "opts[:"max_memory_gi_b"]" when calling SandboxApi.list_sandboxes_paginated, must be greater than or equal to 1.'
820
+ end
821
+
822
+ if @api_client.config.client_side_validation && !opts[:'min_disk_gi_b'].nil? && opts[:'min_disk_gi_b'] < 1
823
+ fail ArgumentError, 'invalid value for "opts[:"min_disk_gi_b"]" when calling SandboxApi.list_sandboxes_paginated, must be greater than or equal to 1.'
824
+ end
825
+
826
+ if @api_client.config.client_side_validation && !opts[:'max_disk_gi_b'].nil? && opts[:'max_disk_gi_b'] < 1
827
+ fail ArgumentError, 'invalid value for "opts[:"max_disk_gi_b"]" when calling SandboxApi.list_sandboxes_paginated, must be greater than or equal to 1.'
828
+ end
829
+
830
+ allowable_values = ["id", "state", "snapshot", "region", "updatedAt", "createdAt"]
831
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
832
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
833
+ end
834
+ allowable_values = ["asc", "desc"]
835
+ if @api_client.config.client_side_validation && opts[:'order'] && !allowable_values.include?(opts[:'order'])
836
+ fail ArgumentError, "invalid value for \"order\", must be one of #{allowable_values}"
837
+ end
838
+ # resource path
839
+ local_var_path = '/sandbox/paginated'
840
+
841
+ # query parameters
842
+ query_params = opts[:query_params] || {}
843
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
844
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
845
+ query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?
846
+ query_params[:'labels'] = opts[:'labels'] if !opts[:'labels'].nil?
847
+ query_params[:'includeErroredDeleted'] = opts[:'include_errored_deleted'] if !opts[:'include_errored_deleted'].nil?
848
+ query_params[:'states'] = @api_client.build_collection_param(opts[:'states'], :multi) if !opts[:'states'].nil?
849
+ query_params[:'snapshots'] = @api_client.build_collection_param(opts[:'snapshots'], :multi) if !opts[:'snapshots'].nil?
850
+ query_params[:'regions'] = @api_client.build_collection_param(opts[:'regions'], :multi) if !opts[:'regions'].nil?
851
+ query_params[:'minCpu'] = opts[:'min_cpu'] if !opts[:'min_cpu'].nil?
852
+ query_params[:'maxCpu'] = opts[:'max_cpu'] if !opts[:'max_cpu'].nil?
853
+ query_params[:'minMemoryGiB'] = opts[:'min_memory_gi_b'] if !opts[:'min_memory_gi_b'].nil?
854
+ query_params[:'maxMemoryGiB'] = opts[:'max_memory_gi_b'] if !opts[:'max_memory_gi_b'].nil?
855
+ query_params[:'minDiskGiB'] = opts[:'min_disk_gi_b'] if !opts[:'min_disk_gi_b'].nil?
856
+ query_params[:'maxDiskGiB'] = opts[:'max_disk_gi_b'] if !opts[:'max_disk_gi_b'].nil?
857
+ query_params[:'lastEventAfter'] = opts[:'last_event_after'] if !opts[:'last_event_after'].nil?
858
+ query_params[:'lastEventBefore'] = opts[:'last_event_before'] if !opts[:'last_event_before'].nil?
859
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
860
+ query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
861
+
862
+ # header parameters
863
+ header_params = opts[:header_params] || {}
864
+ # HTTP header 'Accept' (if needed)
865
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
866
+ header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?
867
+
868
+ # form parameters
869
+ form_params = opts[:form_params] || {}
870
+
871
+ # http body (model)
872
+ post_body = opts[:debug_body]
873
+
874
+ # return_type
875
+ return_type = opts[:debug_return_type] || 'PaginatedSandboxes'
876
+
877
+ # auth_names
878
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
879
+
880
+ new_options = opts.merge(
881
+ :operation => :"SandboxApi.list_sandboxes_paginated",
882
+ :header_params => header_params,
883
+ :query_params => query_params,
884
+ :form_params => form_params,
885
+ :body => post_body,
886
+ :auth_names => auth_names,
887
+ :return_type => return_type
888
+ )
889
+
890
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
891
+ if @api_client.config.debugging
892
+ @api_client.config.logger.debug "API called: SandboxApi#list_sandboxes_paginated\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
893
+ end
894
+ return data, status_code, headers
895
+ end
896
+
897
+ # Replace sandbox labels
898
+ # @param sandbox_id [String] ID of the sandbox
899
+ # @param sandbox_labels [SandboxLabels]
900
+ # @param [Hash] opts the optional parameters
901
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
902
+ # @return [SandboxLabels]
903
+ def replace_labels(sandbox_id, sandbox_labels, opts = {})
904
+ data, _status_code, _headers = replace_labels_with_http_info(sandbox_id, sandbox_labels, opts)
905
+ data
906
+ end
907
+
908
+ # Replace sandbox labels
909
+ # @param sandbox_id [String] ID of the sandbox
910
+ # @param sandbox_labels [SandboxLabels]
911
+ # @param [Hash] opts the optional parameters
912
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
913
+ # @return [Array<(SandboxLabels, Integer, Hash)>] SandboxLabels data, response status code and response headers
914
+ def replace_labels_with_http_info(sandbox_id, sandbox_labels, opts = {})
915
+ if @api_client.config.debugging
916
+ @api_client.config.logger.debug 'Calling API: SandboxApi.replace_labels ...'
917
+ end
918
+ # verify the required parameter 'sandbox_id' is set
919
+ if @api_client.config.client_side_validation && sandbox_id.nil?
920
+ fail ArgumentError, "Missing the required parameter 'sandbox_id' when calling SandboxApi.replace_labels"
921
+ end
922
+ # verify the required parameter 'sandbox_labels' is set
923
+ if @api_client.config.client_side_validation && sandbox_labels.nil?
924
+ fail ArgumentError, "Missing the required parameter 'sandbox_labels' when calling SandboxApi.replace_labels"
925
+ end
926
+ # resource path
927
+ local_var_path = '/sandbox/{sandboxId}/labels'.sub('{' + 'sandboxId' + '}', CGI.escape(sandbox_id.to_s))
928
+
929
+ # query parameters
930
+ query_params = opts[:query_params] || {}
931
+
932
+ # header parameters
933
+ header_params = opts[:header_params] || {}
934
+ # HTTP header 'Accept' (if needed)
935
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
936
+ # HTTP header 'Content-Type'
937
+ content_type = @api_client.select_header_content_type(['application/json'])
938
+ if !content_type.nil?
939
+ header_params['Content-Type'] = content_type
940
+ end
941
+ header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?
942
+
943
+ # form parameters
944
+ form_params = opts[:form_params] || {}
945
+
946
+ # http body (model)
947
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(sandbox_labels)
948
+
949
+ # return_type
950
+ return_type = opts[:debug_return_type] || 'SandboxLabels'
951
+
952
+ # auth_names
953
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
954
+
955
+ new_options = opts.merge(
956
+ :operation => :"SandboxApi.replace_labels",
957
+ :header_params => header_params,
958
+ :query_params => query_params,
959
+ :form_params => form_params,
960
+ :body => post_body,
961
+ :auth_names => auth_names,
962
+ :return_type => return_type
963
+ )
964
+
965
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
966
+ if @api_client.config.debugging
967
+ @api_client.config.logger.debug "API called: SandboxApi#replace_labels\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
968
+ end
969
+ return data, status_code, headers
970
+ end
971
+
972
+ # Revoke SSH access for sandbox
973
+ # @param sandbox_id [String] ID of the sandbox
974
+ # @param [Hash] opts the optional parameters
975
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
976
+ # @option opts [String] :token SSH access token to revoke. If not provided, all SSH access for the sandbox will be revoked.
977
+ # @return [nil]
978
+ def revoke_ssh_access(sandbox_id, opts = {})
979
+ revoke_ssh_access_with_http_info(sandbox_id, opts)
980
+ nil
981
+ end
982
+
983
+ # Revoke SSH access for sandbox
984
+ # @param sandbox_id [String] ID of the sandbox
985
+ # @param [Hash] opts the optional parameters
986
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
987
+ # @option opts [String] :token SSH access token to revoke. If not provided, all SSH access for the sandbox will be revoked.
988
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
989
+ def revoke_ssh_access_with_http_info(sandbox_id, opts = {})
990
+ if @api_client.config.debugging
991
+ @api_client.config.logger.debug 'Calling API: SandboxApi.revoke_ssh_access ...'
992
+ end
993
+ # verify the required parameter 'sandbox_id' is set
994
+ if @api_client.config.client_side_validation && sandbox_id.nil?
995
+ fail ArgumentError, "Missing the required parameter 'sandbox_id' when calling SandboxApi.revoke_ssh_access"
996
+ end
997
+ # resource path
998
+ local_var_path = '/sandbox/{sandboxId}/ssh-access'.sub('{' + 'sandboxId' + '}', CGI.escape(sandbox_id.to_s))
999
+
1000
+ # query parameters
1001
+ query_params = opts[:query_params] || {}
1002
+ query_params[:'token'] = opts[:'token'] if !opts[:'token'].nil?
1003
+
1004
+ # header parameters
1005
+ header_params = opts[:header_params] || {}
1006
+ header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?
1007
+
1008
+ # form parameters
1009
+ form_params = opts[:form_params] || {}
1010
+
1011
+ # http body (model)
1012
+ post_body = opts[:debug_body]
1013
+
1014
+ # return_type
1015
+ return_type = opts[:debug_return_type]
1016
+
1017
+ # auth_names
1018
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
1019
+
1020
+ new_options = opts.merge(
1021
+ :operation => :"SandboxApi.revoke_ssh_access",
1022
+ :header_params => header_params,
1023
+ :query_params => query_params,
1024
+ :form_params => form_params,
1025
+ :body => post_body,
1026
+ :auth_names => auth_names,
1027
+ :return_type => return_type
1028
+ )
1029
+
1030
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
1031
+ if @api_client.config.debugging
1032
+ @api_client.config.logger.debug "API called: SandboxApi#revoke_ssh_access\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1033
+ end
1034
+ return data, status_code, headers
1035
+ end
1036
+
1037
+ # Set sandbox auto-archive interval
1038
+ # @param sandbox_id [String] ID of the sandbox
1039
+ # @param interval [Float] Auto-archive interval in minutes (0 means the maximum interval will be used)
1040
+ # @param [Hash] opts the optional parameters
1041
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
1042
+ # @return [nil]
1043
+ def set_auto_archive_interval(sandbox_id, interval, opts = {})
1044
+ set_auto_archive_interval_with_http_info(sandbox_id, interval, opts)
1045
+ nil
1046
+ end
1047
+
1048
+ # Set sandbox auto-archive interval
1049
+ # @param sandbox_id [String] ID of the sandbox
1050
+ # @param interval [Float] Auto-archive interval in minutes (0 means the maximum interval will be used)
1051
+ # @param [Hash] opts the optional parameters
1052
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
1053
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
1054
+ def set_auto_archive_interval_with_http_info(sandbox_id, interval, opts = {})
1055
+ if @api_client.config.debugging
1056
+ @api_client.config.logger.debug 'Calling API: SandboxApi.set_auto_archive_interval ...'
1057
+ end
1058
+ # verify the required parameter 'sandbox_id' is set
1059
+ if @api_client.config.client_side_validation && sandbox_id.nil?
1060
+ fail ArgumentError, "Missing the required parameter 'sandbox_id' when calling SandboxApi.set_auto_archive_interval"
1061
+ end
1062
+ # verify the required parameter 'interval' is set
1063
+ if @api_client.config.client_side_validation && interval.nil?
1064
+ fail ArgumentError, "Missing the required parameter 'interval' when calling SandboxApi.set_auto_archive_interval"
1065
+ end
1066
+ # resource path
1067
+ local_var_path = '/sandbox/{sandboxId}/autoarchive/{interval}'.sub('{' + 'sandboxId' + '}', CGI.escape(sandbox_id.to_s)).sub('{' + 'interval' + '}', CGI.escape(interval.to_s))
1068
+
1069
+ # query parameters
1070
+ query_params = opts[:query_params] || {}
1071
+
1072
+ # header parameters
1073
+ header_params = opts[:header_params] || {}
1074
+ header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?
1075
+
1076
+ # form parameters
1077
+ form_params = opts[:form_params] || {}
1078
+
1079
+ # http body (model)
1080
+ post_body = opts[:debug_body]
1081
+
1082
+ # return_type
1083
+ return_type = opts[:debug_return_type]
1084
+
1085
+ # auth_names
1086
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
1087
+
1088
+ new_options = opts.merge(
1089
+ :operation => :"SandboxApi.set_auto_archive_interval",
1090
+ :header_params => header_params,
1091
+ :query_params => query_params,
1092
+ :form_params => form_params,
1093
+ :body => post_body,
1094
+ :auth_names => auth_names,
1095
+ :return_type => return_type
1096
+ )
1097
+
1098
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1099
+ if @api_client.config.debugging
1100
+ @api_client.config.logger.debug "API called: SandboxApi#set_auto_archive_interval\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1101
+ end
1102
+ return data, status_code, headers
1103
+ end
1104
+
1105
+ # Set sandbox auto-delete interval
1106
+ # @param sandbox_id [String] ID of the sandbox
1107
+ # @param interval [Float] Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)
1108
+ # @param [Hash] opts the optional parameters
1109
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
1110
+ # @return [nil]
1111
+ def set_auto_delete_interval(sandbox_id, interval, opts = {})
1112
+ set_auto_delete_interval_with_http_info(sandbox_id, interval, opts)
1113
+ nil
1114
+ end
1115
+
1116
+ # Set sandbox auto-delete interval
1117
+ # @param sandbox_id [String] ID of the sandbox
1118
+ # @param interval [Float] Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)
1119
+ # @param [Hash] opts the optional parameters
1120
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
1121
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
1122
+ def set_auto_delete_interval_with_http_info(sandbox_id, interval, opts = {})
1123
+ if @api_client.config.debugging
1124
+ @api_client.config.logger.debug 'Calling API: SandboxApi.set_auto_delete_interval ...'
1125
+ end
1126
+ # verify the required parameter 'sandbox_id' is set
1127
+ if @api_client.config.client_side_validation && sandbox_id.nil?
1128
+ fail ArgumentError, "Missing the required parameter 'sandbox_id' when calling SandboxApi.set_auto_delete_interval"
1129
+ end
1130
+ # verify the required parameter 'interval' is set
1131
+ if @api_client.config.client_side_validation && interval.nil?
1132
+ fail ArgumentError, "Missing the required parameter 'interval' when calling SandboxApi.set_auto_delete_interval"
1133
+ end
1134
+ # resource path
1135
+ local_var_path = '/sandbox/{sandboxId}/autodelete/{interval}'.sub('{' + 'sandboxId' + '}', CGI.escape(sandbox_id.to_s)).sub('{' + 'interval' + '}', CGI.escape(interval.to_s))
1136
+
1137
+ # query parameters
1138
+ query_params = opts[:query_params] || {}
1139
+
1140
+ # header parameters
1141
+ header_params = opts[:header_params] || {}
1142
+ header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?
1143
+
1144
+ # form parameters
1145
+ form_params = opts[:form_params] || {}
1146
+
1147
+ # http body (model)
1148
+ post_body = opts[:debug_body]
1149
+
1150
+ # return_type
1151
+ return_type = opts[:debug_return_type]
1152
+
1153
+ # auth_names
1154
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
1155
+
1156
+ new_options = opts.merge(
1157
+ :operation => :"SandboxApi.set_auto_delete_interval",
1158
+ :header_params => header_params,
1159
+ :query_params => query_params,
1160
+ :form_params => form_params,
1161
+ :body => post_body,
1162
+ :auth_names => auth_names,
1163
+ :return_type => return_type
1164
+ )
1165
+
1166
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1167
+ if @api_client.config.debugging
1168
+ @api_client.config.logger.debug "API called: SandboxApi#set_auto_delete_interval\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1169
+ end
1170
+ return data, status_code, headers
1171
+ end
1172
+
1173
+ # Set sandbox auto-stop interval
1174
+ # @param sandbox_id [String] ID of the sandbox
1175
+ # @param interval [Float] Auto-stop interval in minutes (0 to disable)
1176
+ # @param [Hash] opts the optional parameters
1177
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
1178
+ # @return [nil]
1179
+ def set_autostop_interval(sandbox_id, interval, opts = {})
1180
+ set_autostop_interval_with_http_info(sandbox_id, interval, opts)
1181
+ nil
1182
+ end
1183
+
1184
+ # Set sandbox auto-stop interval
1185
+ # @param sandbox_id [String] ID of the sandbox
1186
+ # @param interval [Float] Auto-stop interval in minutes (0 to disable)
1187
+ # @param [Hash] opts the optional parameters
1188
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
1189
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
1190
+ def set_autostop_interval_with_http_info(sandbox_id, interval, opts = {})
1191
+ if @api_client.config.debugging
1192
+ @api_client.config.logger.debug 'Calling API: SandboxApi.set_autostop_interval ...'
1193
+ end
1194
+ # verify the required parameter 'sandbox_id' is set
1195
+ if @api_client.config.client_side_validation && sandbox_id.nil?
1196
+ fail ArgumentError, "Missing the required parameter 'sandbox_id' when calling SandboxApi.set_autostop_interval"
1197
+ end
1198
+ # verify the required parameter 'interval' is set
1199
+ if @api_client.config.client_side_validation && interval.nil?
1200
+ fail ArgumentError, "Missing the required parameter 'interval' when calling SandboxApi.set_autostop_interval"
1201
+ end
1202
+ # resource path
1203
+ local_var_path = '/sandbox/{sandboxId}/autostop/{interval}'.sub('{' + 'sandboxId' + '}', CGI.escape(sandbox_id.to_s)).sub('{' + 'interval' + '}', CGI.escape(interval.to_s))
1204
+
1205
+ # query parameters
1206
+ query_params = opts[:query_params] || {}
1207
+
1208
+ # header parameters
1209
+ header_params = opts[:header_params] || {}
1210
+ header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?
1211
+
1212
+ # form parameters
1213
+ form_params = opts[:form_params] || {}
1214
+
1215
+ # http body (model)
1216
+ post_body = opts[:debug_body]
1217
+
1218
+ # return_type
1219
+ return_type = opts[:debug_return_type]
1220
+
1221
+ # auth_names
1222
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
1223
+
1224
+ new_options = opts.merge(
1225
+ :operation => :"SandboxApi.set_autostop_interval",
1226
+ :header_params => header_params,
1227
+ :query_params => query_params,
1228
+ :form_params => form_params,
1229
+ :body => post_body,
1230
+ :auth_names => auth_names,
1231
+ :return_type => return_type
1232
+ )
1233
+
1234
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1235
+ if @api_client.config.debugging
1236
+ @api_client.config.logger.debug "API called: SandboxApi#set_autostop_interval\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1237
+ end
1238
+ return data, status_code, headers
1239
+ end
1240
+
1241
+ # Start sandbox
1242
+ # @param sandbox_id [String] ID of the sandbox
1243
+ # @param [Hash] opts the optional parameters
1244
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
1245
+ # @return [Sandbox]
1246
+ def start_sandbox(sandbox_id, opts = {})
1247
+ data, _status_code, _headers = start_sandbox_with_http_info(sandbox_id, opts)
1248
+ data
1249
+ end
1250
+
1251
+ # Start sandbox
1252
+ # @param sandbox_id [String] ID of the sandbox
1253
+ # @param [Hash] opts the optional parameters
1254
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
1255
+ # @return [Array<(Sandbox, Integer, Hash)>] Sandbox data, response status code and response headers
1256
+ def start_sandbox_with_http_info(sandbox_id, opts = {})
1257
+ if @api_client.config.debugging
1258
+ @api_client.config.logger.debug 'Calling API: SandboxApi.start_sandbox ...'
1259
+ end
1260
+ # verify the required parameter 'sandbox_id' is set
1261
+ if @api_client.config.client_side_validation && sandbox_id.nil?
1262
+ fail ArgumentError, "Missing the required parameter 'sandbox_id' when calling SandboxApi.start_sandbox"
1263
+ end
1264
+ # resource path
1265
+ local_var_path = '/sandbox/{sandboxId}/start'.sub('{' + 'sandboxId' + '}', CGI.escape(sandbox_id.to_s))
1266
+
1267
+ # query parameters
1268
+ query_params = opts[:query_params] || {}
1269
+
1270
+ # header parameters
1271
+ header_params = opts[:header_params] || {}
1272
+ # HTTP header 'Accept' (if needed)
1273
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1274
+ header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?
1275
+
1276
+ # form parameters
1277
+ form_params = opts[:form_params] || {}
1278
+
1279
+ # http body (model)
1280
+ post_body = opts[:debug_body]
1281
+
1282
+ # return_type
1283
+ return_type = opts[:debug_return_type] || 'Sandbox'
1284
+
1285
+ # auth_names
1286
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
1287
+
1288
+ new_options = opts.merge(
1289
+ :operation => :"SandboxApi.start_sandbox",
1290
+ :header_params => header_params,
1291
+ :query_params => query_params,
1292
+ :form_params => form_params,
1293
+ :body => post_body,
1294
+ :auth_names => auth_names,
1295
+ :return_type => return_type
1296
+ )
1297
+
1298
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1299
+ if @api_client.config.debugging
1300
+ @api_client.config.logger.debug "API called: SandboxApi#start_sandbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1301
+ end
1302
+ return data, status_code, headers
1303
+ end
1304
+
1305
+ # Stop sandbox
1306
+ # @param sandbox_id [String] ID of the sandbox
1307
+ # @param [Hash] opts the optional parameters
1308
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
1309
+ # @return [nil]
1310
+ def stop_sandbox(sandbox_id, opts = {})
1311
+ stop_sandbox_with_http_info(sandbox_id, opts)
1312
+ nil
1313
+ end
1314
+
1315
+ # Stop sandbox
1316
+ # @param sandbox_id [String] ID of the sandbox
1317
+ # @param [Hash] opts the optional parameters
1318
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
1319
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
1320
+ def stop_sandbox_with_http_info(sandbox_id, opts = {})
1321
+ if @api_client.config.debugging
1322
+ @api_client.config.logger.debug 'Calling API: SandboxApi.stop_sandbox ...'
1323
+ end
1324
+ # verify the required parameter 'sandbox_id' is set
1325
+ if @api_client.config.client_side_validation && sandbox_id.nil?
1326
+ fail ArgumentError, "Missing the required parameter 'sandbox_id' when calling SandboxApi.stop_sandbox"
1327
+ end
1328
+ # resource path
1329
+ local_var_path = '/sandbox/{sandboxId}/stop'.sub('{' + 'sandboxId' + '}', CGI.escape(sandbox_id.to_s))
1330
+
1331
+ # query parameters
1332
+ query_params = opts[:query_params] || {}
1333
+
1334
+ # header parameters
1335
+ header_params = opts[:header_params] || {}
1336
+ header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?
1337
+
1338
+ # form parameters
1339
+ form_params = opts[:form_params] || {}
1340
+
1341
+ # http body (model)
1342
+ post_body = opts[:debug_body]
1343
+
1344
+ # return_type
1345
+ return_type = opts[:debug_return_type]
1346
+
1347
+ # auth_names
1348
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
1349
+
1350
+ new_options = opts.merge(
1351
+ :operation => :"SandboxApi.stop_sandbox",
1352
+ :header_params => header_params,
1353
+ :query_params => query_params,
1354
+ :form_params => form_params,
1355
+ :body => post_body,
1356
+ :auth_names => auth_names,
1357
+ :return_type => return_type
1358
+ )
1359
+
1360
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1361
+ if @api_client.config.debugging
1362
+ @api_client.config.logger.debug "API called: SandboxApi#stop_sandbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1363
+ end
1364
+ return data, status_code, headers
1365
+ end
1366
+
1367
+ # Update public status
1368
+ # @param sandbox_id [String] ID of the sandbox
1369
+ # @param is_public [Boolean] Public status to set
1370
+ # @param [Hash] opts the optional parameters
1371
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
1372
+ # @return [nil]
1373
+ def update_public_status(sandbox_id, is_public, opts = {})
1374
+ update_public_status_with_http_info(sandbox_id, is_public, opts)
1375
+ nil
1376
+ end
1377
+
1378
+ # Update public status
1379
+ # @param sandbox_id [String] ID of the sandbox
1380
+ # @param is_public [Boolean] Public status to set
1381
+ # @param [Hash] opts the optional parameters
1382
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
1383
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
1384
+ def update_public_status_with_http_info(sandbox_id, is_public, opts = {})
1385
+ if @api_client.config.debugging
1386
+ @api_client.config.logger.debug 'Calling API: SandboxApi.update_public_status ...'
1387
+ end
1388
+ # verify the required parameter 'sandbox_id' is set
1389
+ if @api_client.config.client_side_validation && sandbox_id.nil?
1390
+ fail ArgumentError, "Missing the required parameter 'sandbox_id' when calling SandboxApi.update_public_status"
1391
+ end
1392
+ # verify the required parameter 'is_public' is set
1393
+ if @api_client.config.client_side_validation && is_public.nil?
1394
+ fail ArgumentError, "Missing the required parameter 'is_public' when calling SandboxApi.update_public_status"
1395
+ end
1396
+ # resource path
1397
+ local_var_path = '/sandbox/{sandboxId}/public/{isPublic}'.sub('{' + 'sandboxId' + '}', CGI.escape(sandbox_id.to_s)).sub('{' + 'isPublic' + '}', CGI.escape(is_public.to_s))
1398
+
1399
+ # query parameters
1400
+ query_params = opts[:query_params] || {}
1401
+
1402
+ # header parameters
1403
+ header_params = opts[:header_params] || {}
1404
+ header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?
1405
+
1406
+ # form parameters
1407
+ form_params = opts[:form_params] || {}
1408
+
1409
+ # http body (model)
1410
+ post_body = opts[:debug_body]
1411
+
1412
+ # return_type
1413
+ return_type = opts[:debug_return_type]
1414
+
1415
+ # auth_names
1416
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
1417
+
1418
+ new_options = opts.merge(
1419
+ :operation => :"SandboxApi.update_public_status",
1420
+ :header_params => header_params,
1421
+ :query_params => query_params,
1422
+ :form_params => form_params,
1423
+ :body => post_body,
1424
+ :auth_names => auth_names,
1425
+ :return_type => return_type
1426
+ )
1427
+
1428
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1429
+ if @api_client.config.debugging
1430
+ @api_client.config.logger.debug "API called: SandboxApi#update_public_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1431
+ end
1432
+ return data, status_code, headers
1433
+ end
1434
+
1435
+ # Update sandbox state
1436
+ # @param sandbox_id [String] ID of the sandbox
1437
+ # @param update_sandbox_state_dto [UpdateSandboxStateDto]
1438
+ # @param [Hash] opts the optional parameters
1439
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
1440
+ # @return [nil]
1441
+ def update_sandbox_state(sandbox_id, update_sandbox_state_dto, opts = {})
1442
+ update_sandbox_state_with_http_info(sandbox_id, update_sandbox_state_dto, opts)
1443
+ nil
1444
+ end
1445
+
1446
+ # Update sandbox state
1447
+ # @param sandbox_id [String] ID of the sandbox
1448
+ # @param update_sandbox_state_dto [UpdateSandboxStateDto]
1449
+ # @param [Hash] opts the optional parameters
1450
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
1451
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
1452
+ def update_sandbox_state_with_http_info(sandbox_id, update_sandbox_state_dto, opts = {})
1453
+ if @api_client.config.debugging
1454
+ @api_client.config.logger.debug 'Calling API: SandboxApi.update_sandbox_state ...'
1455
+ end
1456
+ # verify the required parameter 'sandbox_id' is set
1457
+ if @api_client.config.client_side_validation && sandbox_id.nil?
1458
+ fail ArgumentError, "Missing the required parameter 'sandbox_id' when calling SandboxApi.update_sandbox_state"
1459
+ end
1460
+ # verify the required parameter 'update_sandbox_state_dto' is set
1461
+ if @api_client.config.client_side_validation && update_sandbox_state_dto.nil?
1462
+ fail ArgumentError, "Missing the required parameter 'update_sandbox_state_dto' when calling SandboxApi.update_sandbox_state"
1463
+ end
1464
+ # resource path
1465
+ local_var_path = '/sandbox/{sandboxId}/state'.sub('{' + 'sandboxId' + '}', CGI.escape(sandbox_id.to_s))
1466
+
1467
+ # query parameters
1468
+ query_params = opts[:query_params] || {}
1469
+
1470
+ # header parameters
1471
+ header_params = opts[:header_params] || {}
1472
+ # HTTP header 'Content-Type'
1473
+ content_type = @api_client.select_header_content_type(['application/json'])
1474
+ if !content_type.nil?
1475
+ header_params['Content-Type'] = content_type
1476
+ end
1477
+ header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?
1478
+
1479
+ # form parameters
1480
+ form_params = opts[:form_params] || {}
1481
+
1482
+ # http body (model)
1483
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_sandbox_state_dto)
1484
+
1485
+ # return_type
1486
+ return_type = opts[:debug_return_type]
1487
+
1488
+ # auth_names
1489
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
1490
+
1491
+ new_options = opts.merge(
1492
+ :operation => :"SandboxApi.update_sandbox_state",
1493
+ :header_params => header_params,
1494
+ :query_params => query_params,
1495
+ :form_params => form_params,
1496
+ :body => post_body,
1497
+ :auth_names => auth_names,
1498
+ :return_type => return_type
1499
+ )
1500
+
1501
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
1502
+ if @api_client.config.debugging
1503
+ @api_client.config.logger.debug "API called: SandboxApi#update_sandbox_state\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1504
+ end
1505
+ return data, status_code, headers
1506
+ end
1507
+
1508
+ # Validate SSH access for sandbox
1509
+ # @param token [String] SSH access token to validate
1510
+ # @param [Hash] opts the optional parameters
1511
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
1512
+ # @return [SshAccessValidationDto]
1513
+ def validate_ssh_access(token, opts = {})
1514
+ data, _status_code, _headers = validate_ssh_access_with_http_info(token, opts)
1515
+ data
1516
+ end
1517
+
1518
+ # Validate SSH access for sandbox
1519
+ # @param token [String] SSH access token to validate
1520
+ # @param [Hash] opts the optional parameters
1521
+ # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
1522
+ # @return [Array<(SshAccessValidationDto, Integer, Hash)>] SshAccessValidationDto data, response status code and response headers
1523
+ def validate_ssh_access_with_http_info(token, opts = {})
1524
+ if @api_client.config.debugging
1525
+ @api_client.config.logger.debug 'Calling API: SandboxApi.validate_ssh_access ...'
1526
+ end
1527
+ # verify the required parameter 'token' is set
1528
+ if @api_client.config.client_side_validation && token.nil?
1529
+ fail ArgumentError, "Missing the required parameter 'token' when calling SandboxApi.validate_ssh_access"
1530
+ end
1531
+ # resource path
1532
+ local_var_path = '/sandbox/ssh-access/validate'
1533
+
1534
+ # query parameters
1535
+ query_params = opts[:query_params] || {}
1536
+ query_params[:'token'] = token
1537
+
1538
+ # header parameters
1539
+ header_params = opts[:header_params] || {}
1540
+ # HTTP header 'Accept' (if needed)
1541
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1542
+ header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?
1543
+
1544
+ # form parameters
1545
+ form_params = opts[:form_params] || {}
1546
+
1547
+ # http body (model)
1548
+ post_body = opts[:debug_body]
1549
+
1550
+ # return_type
1551
+ return_type = opts[:debug_return_type] || 'SshAccessValidationDto'
1552
+
1553
+ # auth_names
1554
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
1555
+
1556
+ new_options = opts.merge(
1557
+ :operation => :"SandboxApi.validate_ssh_access",
1558
+ :header_params => header_params,
1559
+ :query_params => query_params,
1560
+ :form_params => form_params,
1561
+ :body => post_body,
1562
+ :auth_names => auth_names,
1563
+ :return_type => return_type
1564
+ )
1565
+
1566
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1567
+ if @api_client.config.debugging
1568
+ @api_client.config.logger.debug "API called: SandboxApi#validate_ssh_access\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1569
+ end
1570
+ return data, status_code, headers
1571
+ end
1572
+ end
1573
+ end