nightona_api_client 0.191.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 (219) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +39 -0
  3. data/.openapi-generator/FILES +212 -0
  4. data/.openapi-generator/VERSION +1 -0
  5. data/.openapi-generator-ignore +31 -0
  6. data/.rspec +2 -0
  7. data/.rubocop.yml +148 -0
  8. data/Rakefile +10 -0
  9. data/fix-gemspec.sh +11 -0
  10. data/lib/nightona_api_client/api/admin_api.rb +1449 -0
  11. data/lib/nightona_api_client/api/api_keys_api.rb +401 -0
  12. data/lib/nightona_api_client/api/audit_api.rb +110 -0
  13. data/lib/nightona_api_client/api/config_api.rb +77 -0
  14. data/lib/nightona_api_client/api/docker_registry_api.rb +411 -0
  15. data/lib/nightona_api_client/api/health_api.rb +126 -0
  16. data/lib/nightona_api_client/api/jobs_api.rb +299 -0
  17. data/lib/nightona_api_client/api/object_storage_api.rb +80 -0
  18. data/lib/nightona_api_client/api/organizations_api.rb +2615 -0
  19. data/lib/nightona_api_client/api/preview_api.rb +278 -0
  20. data/lib/nightona_api_client/api/regions_api.rb +77 -0
  21. data/lib/nightona_api_client/api/runners_api.rb +711 -0
  22. data/lib/nightona_api_client/api/sandbox_api.rb +3064 -0
  23. data/lib/nightona_api_client/api/snapshots_api.rb +567 -0
  24. data/lib/nightona_api_client/api/toolbox_api.rb +5108 -0
  25. data/lib/nightona_api_client/api/users_api.rb +316 -0
  26. data/lib/nightona_api_client/api/volumes_api.rb +342 -0
  27. data/lib/nightona_api_client/api/webhooks_api.rb +276 -0
  28. data/lib/nightona_api_client/api_client.rb +397 -0
  29. data/lib/nightona_api_client/api_error.rb +58 -0
  30. data/lib/nightona_api_client/api_model_base.rb +88 -0
  31. data/lib/nightona_api_client/configuration.rb +309 -0
  32. data/lib/nightona_api_client/models/account_provider.rb +190 -0
  33. data/lib/nightona_api_client/models/admin_create_runner.rb +326 -0
  34. data/lib/nightona_api_client/models/admin_get_webhook_status200_response.rb +147 -0
  35. data/lib/nightona_api_client/models/announcement.rb +175 -0
  36. data/lib/nightona_api_client/models/api_key_list.rb +313 -0
  37. data/lib/nightona_api_client/models/api_key_response.rb +273 -0
  38. data/lib/nightona_api_client/models/audit_log.rb +369 -0
  39. data/lib/nightona_api_client/models/build_info.rb +241 -0
  40. data/lib/nightona_api_client/models/command.rb +202 -0
  41. data/lib/nightona_api_client/models/completion_context.rb +173 -0
  42. data/lib/nightona_api_client/models/completion_item.rb +218 -0
  43. data/lib/nightona_api_client/models/completion_list.rb +192 -0
  44. data/lib/nightona_api_client/models/compressed_screenshot_response.rb +185 -0
  45. data/lib/nightona_api_client/models/computer_use_start_response.rb +192 -0
  46. data/lib/nightona_api_client/models/computer_use_status_response.rb +189 -0
  47. data/lib/nightona_api_client/models/computer_use_stop_response.rb +192 -0
  48. data/lib/nightona_api_client/models/create_api_key.rb +217 -0
  49. data/lib/nightona_api_client/models/create_build_info.rb +177 -0
  50. data/lib/nightona_api_client/models/create_docker_registry.rb +256 -0
  51. data/lib/nightona_api_client/models/create_linked_account.rb +192 -0
  52. data/lib/nightona_api_client/models/create_organization.rb +192 -0
  53. data/lib/nightona_api_client/models/create_organization_invitation.rb +255 -0
  54. data/lib/nightona_api_client/models/create_organization_quota.rb +219 -0
  55. data/lib/nightona_api_client/models/create_organization_region_quota.rb +372 -0
  56. data/lib/nightona_api_client/models/create_organization_role.rb +233 -0
  57. data/lib/nightona_api_client/models/create_region.rb +198 -0
  58. data/lib/nightona_api_client/models/create_region_response.rb +209 -0
  59. data/lib/nightona_api_client/models/create_runner.rb +202 -0
  60. data/lib/nightona_api_client/models/create_runner_response.rb +192 -0
  61. data/lib/nightona_api_client/models/create_sandbox.rb +356 -0
  62. data/lib/nightona_api_client/models/create_sandbox_snapshot.rb +177 -0
  63. data/lib/nightona_api_client/models/create_session_request.rb +165 -0
  64. data/lib/nightona_api_client/models/create_snapshot.rb +291 -0
  65. data/lib/nightona_api_client/models/create_user.rb +269 -0
  66. data/lib/nightona_api_client/models/create_volume.rb +164 -0
  67. data/lib/nightona_api_client/models/display_info_response.rb +167 -0
  68. data/lib/nightona_api_client/models/docker_registry.rb +378 -0
  69. data/lib/nightona_api_client/models/download_files.rb +167 -0
  70. data/lib/nightona_api_client/models/execute_request.rb +184 -0
  71. data/lib/nightona_api_client/models/execute_response.rb +192 -0
  72. data/lib/nightona_api_client/models/file_info.rb +346 -0
  73. data/lib/nightona_api_client/models/file_status.rb +242 -0
  74. data/lib/nightona_api_client/models/fork_sandbox.rb +148 -0
  75. data/lib/nightona_api_client/models/git_add_request.rb +193 -0
  76. data/lib/nightona_api_client/models/git_branch_request.rb +190 -0
  77. data/lib/nightona_api_client/models/git_checkout_request.rb +190 -0
  78. data/lib/nightona_api_client/models/git_clone_request.rb +226 -0
  79. data/lib/nightona_api_client/models/git_commit_info.rb +268 -0
  80. data/lib/nightona_api_client/models/git_commit_request.rb +254 -0
  81. data/lib/nightona_api_client/models/git_commit_response.rb +164 -0
  82. data/lib/nightona_api_client/models/git_delete_branch_request.rb +190 -0
  83. data/lib/nightona_api_client/models/git_repo_request.rb +182 -0
  84. data/lib/nightona_api_client/models/git_status.rb +219 -0
  85. data/lib/nightona_api_client/models/gpu_type.rb +41 -0
  86. data/lib/nightona_api_client/models/health_controller_check200_response.rb +182 -0
  87. data/lib/nightona_api_client/models/health_controller_check200_response_info_value.rb +164 -0
  88. data/lib/nightona_api_client/models/health_controller_check503_response.rb +182 -0
  89. data/lib/nightona_api_client/models/job.rb +366 -0
  90. data/lib/nightona_api_client/models/job_status.rb +43 -0
  91. data/lib/nightona_api_client/models/job_type.rb +54 -0
  92. data/lib/nightona_api_client/models/keyboard_hotkey_request.rb +165 -0
  93. data/lib/nightona_api_client/models/keyboard_press_request.rb +177 -0
  94. data/lib/nightona_api_client/models/keyboard_type_request.rb +175 -0
  95. data/lib/nightona_api_client/models/list_branch_response.rb +166 -0
  96. data/lib/nightona_api_client/models/list_sandboxes_response.rb +180 -0
  97. data/lib/nightona_api_client/models/log_entry.rb +334 -0
  98. data/lib/nightona_api_client/models/lsp_completion_params.rb +254 -0
  99. data/lib/nightona_api_client/models/lsp_document_request.rb +219 -0
  100. data/lib/nightona_api_client/models/lsp_location.rb +190 -0
  101. data/lib/nightona_api_client/models/lsp_server_request.rb +192 -0
  102. data/lib/nightona_api_client/models/lsp_symbol.rb +216 -0
  103. data/lib/nightona_api_client/models/match.rb +216 -0
  104. data/lib/nightona_api_client/models/metric_data_point.rb +192 -0
  105. data/lib/nightona_api_client/models/metric_series.rb +194 -0
  106. data/lib/nightona_api_client/models/metrics_response.rb +167 -0
  107. data/lib/nightona_api_client/models/mouse_click_request.rb +212 -0
  108. data/lib/nightona_api_client/models/mouse_click_response.rb +192 -0
  109. data/lib/nightona_api_client/models/mouse_drag_request.rb +256 -0
  110. data/lib/nightona_api_client/models/mouse_drag_response.rb +192 -0
  111. data/lib/nightona_api_client/models/mouse_move_request.rb +192 -0
  112. data/lib/nightona_api_client/models/mouse_move_response.rb +192 -0
  113. data/lib/nightona_api_client/models/mouse_position.rb +192 -0
  114. data/lib/nightona_api_client/models/mouse_scroll_request.rb +229 -0
  115. data/lib/nightona_api_client/models/mouse_scroll_response.rb +165 -0
  116. data/lib/nightona_api_client/models/nightona_configuration.rb +507 -0
  117. data/lib/nightona_api_client/models/oidc_config.rb +219 -0
  118. data/lib/nightona_api_client/models/organization.rb +698 -0
  119. data/lib/nightona_api_client/models/organization_invitation.rb +463 -0
  120. data/lib/nightona_api_client/models/organization_role.rb +341 -0
  121. data/lib/nightona_api_client/models/organization_sandbox_default_limited_network_egress.rb +165 -0
  122. data/lib/nightona_api_client/models/organization_suspension.rb +221 -0
  123. data/lib/nightona_api_client/models/organization_usage_overview.rb +270 -0
  124. data/lib/nightona_api_client/models/organization_user.rb +380 -0
  125. data/lib/nightona_api_client/models/otel_config.rb +178 -0
  126. data/lib/nightona_api_client/models/paginated_audit_logs.rb +254 -0
  127. data/lib/nightona_api_client/models/paginated_jobs.rb +244 -0
  128. data/lib/nightona_api_client/models/paginated_logs.rb +248 -0
  129. data/lib/nightona_api_client/models/paginated_sandboxes_deprecated.rb +244 -0
  130. data/lib/nightona_api_client/models/paginated_snapshots.rb +244 -0
  131. data/lib/nightona_api_client/models/paginated_traces.rb +248 -0
  132. data/lib/nightona_api_client/models/poll_jobs_response.rb +167 -0
  133. data/lib/nightona_api_client/models/port_preview_url.rb +219 -0
  134. data/lib/nightona_api_client/models/position.rb +190 -0
  135. data/lib/nightona_api_client/models/posthog_config.rb +192 -0
  136. data/lib/nightona_api_client/models/process_errors_response.rb +192 -0
  137. data/lib/nightona_api_client/models/process_logs_response.rb +192 -0
  138. data/lib/nightona_api_client/models/process_restart_response.rb +192 -0
  139. data/lib/nightona_api_client/models/process_status_response.rb +192 -0
  140. data/lib/nightona_api_client/models/project_dir_response.rb +147 -0
  141. data/lib/nightona_api_client/models/pty_create_request.rb +217 -0
  142. data/lib/nightona_api_client/models/pty_create_response.rb +165 -0
  143. data/lib/nightona_api_client/models/pty_list_response.rb +167 -0
  144. data/lib/nightona_api_client/models/pty_resize_request.rb +192 -0
  145. data/lib/nightona_api_client/models/pty_session_info.rb +354 -0
  146. data/lib/nightona_api_client/models/range.rb +190 -0
  147. data/lib/nightona_api_client/models/rate_limit_config.rb +178 -0
  148. data/lib/nightona_api_client/models/rate_limit_entry.rb +158 -0
  149. data/lib/nightona_api_client/models/regenerate_api_key_response.rb +165 -0
  150. data/lib/nightona_api_client/models/region.rb +339 -0
  151. data/lib/nightona_api_client/models/region_quota.rb +437 -0
  152. data/lib/nightona_api_client/models/region_screenshot_response.rb +185 -0
  153. data/lib/nightona_api_client/models/region_type.rb +42 -0
  154. data/lib/nightona_api_client/models/region_usage_overview.rb +515 -0
  155. data/lib/nightona_api_client/models/registry_push_access_dto.rb +300 -0
  156. data/lib/nightona_api_client/models/replace_request.rb +218 -0
  157. data/lib/nightona_api_client/models/replace_result.rb +165 -0
  158. data/lib/nightona_api_client/models/resize_sandbox.rb +225 -0
  159. data/lib/nightona_api_client/models/runner.rb +710 -0
  160. data/lib/nightona_api_client/models/runner_class.rb +40 -0
  161. data/lib/nightona_api_client/models/runner_full.rb +747 -0
  162. data/lib/nightona_api_client/models/runner_health_metrics.rb +482 -0
  163. data/lib/nightona_api_client/models/runner_healthcheck.rb +217 -0
  164. data/lib/nightona_api_client/models/runner_service_health.rb +202 -0
  165. data/lib/nightona_api_client/models/runner_snapshot_dto.rb +202 -0
  166. data/lib/nightona_api_client/models/runner_state.rb +44 -0
  167. data/lib/nightona_api_client/models/sandbox.rb +788 -0
  168. data/lib/nightona_api_client/models/sandbox_class.rb +43 -0
  169. data/lib/nightona_api_client/models/sandbox_desired_state.rb +45 -0
  170. data/lib/nightona_api_client/models/sandbox_labels.rb +167 -0
  171. data/lib/nightona_api_client/models/sandbox_list_item.rb +658 -0
  172. data/lib/nightona_api_client/models/sandbox_list_sort_direction.rb +41 -0
  173. data/lib/nightona_api_client/models/sandbox_list_sort_field.rb +45 -0
  174. data/lib/nightona_api_client/models/sandbox_state.rb +61 -0
  175. data/lib/nightona_api_client/models/sandbox_volume.rb +202 -0
  176. data/lib/nightona_api_client/models/screenshot_response.rb +185 -0
  177. data/lib/nightona_api_client/models/search_files_response.rb +166 -0
  178. data/lib/nightona_api_client/models/send_webhook_dto.rb +224 -0
  179. data/lib/nightona_api_client/models/session.rb +180 -0
  180. data/lib/nightona_api_client/models/session_execute_request.rb +185 -0
  181. data/lib/nightona_api_client/models/session_execute_response.rb +168 -0
  182. data/lib/nightona_api_client/models/set_snapshot_general_status_dto.rb +165 -0
  183. data/lib/nightona_api_client/models/signed_port_preview_url.rb +246 -0
  184. data/lib/nightona_api_client/models/snapshot_dto.rb +562 -0
  185. data/lib/nightona_api_client/models/snapshot_manager_credentials.rb +192 -0
  186. data/lib/nightona_api_client/models/snapshot_state.rb +47 -0
  187. data/lib/nightona_api_client/models/ssh_access_dto.rb +327 -0
  188. data/lib/nightona_api_client/models/ssh_access_validation_dto.rb +192 -0
  189. data/lib/nightona_api_client/models/storage_access_dto.rb +300 -0
  190. data/lib/nightona_api_client/models/toolbox_proxy_url.rb +165 -0
  191. data/lib/nightona_api_client/models/trace_span.rb +332 -0
  192. data/lib/nightona_api_client/models/trace_summary.rb +310 -0
  193. data/lib/nightona_api_client/models/update_docker_registry.rb +239 -0
  194. data/lib/nightona_api_client/models/update_job_status.rb +207 -0
  195. data/lib/nightona_api_client/models/update_organization_default_region.rb +165 -0
  196. data/lib/nightona_api_client/models/update_organization_invitation.rb +228 -0
  197. data/lib/nightona_api_client/models/update_organization_member_access.rb +218 -0
  198. data/lib/nightona_api_client/models/update_organization_quota.rb +295 -0
  199. data/lib/nightona_api_client/models/update_organization_region_quota.rb +299 -0
  200. data/lib/nightona_api_client/models/update_organization_role.rb +233 -0
  201. data/lib/nightona_api_client/models/update_region.rb +171 -0
  202. data/lib/nightona_api_client/models/update_sandbox_network_settings.rb +168 -0
  203. data/lib/nightona_api_client/models/update_sandbox_state_dto.rb +209 -0
  204. data/lib/nightona_api_client/models/url.rb +165 -0
  205. data/lib/nightona_api_client/models/user.rb +275 -0
  206. data/lib/nightona_api_client/models/user_home_dir_response.rb +147 -0
  207. data/lib/nightona_api_client/models/user_public_key.rb +192 -0
  208. data/lib/nightona_api_client/models/volume_dto.rb +346 -0
  209. data/lib/nightona_api_client/models/volume_state.rb +46 -0
  210. data/lib/nightona_api_client/models/webhook_app_portal_access.rb +192 -0
  211. data/lib/nightona_api_client/models/webhook_event.rb +46 -0
  212. data/lib/nightona_api_client/models/webhook_initialization_status.rb +272 -0
  213. data/lib/nightona_api_client/models/windows_response.rb +194 -0
  214. data/lib/nightona_api_client/models/work_dir_response.rb +147 -0
  215. data/lib/nightona_api_client/version.rb +15 -0
  216. data/lib/nightona_api_client.rb +241 -0
  217. data/nightona_api_client.gemspec +39 -0
  218. data/project.json +68 -0
  219. metadata +299 -0
@@ -0,0 +1,3064 @@
1
+ =begin
2
+ #Nightona
3
+
4
+ #Nightona AI platform API Docs
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: amaraaamka0404@gmail.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.21.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module NightonaApiClient
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_or_name [String]
24
+ # @param [Hash] opts the optional parameters
25
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
26
+ # @return [Sandbox]
27
+ def archive_sandbox(sandbox_id_or_name, opts = {})
28
+ data, _status_code, _headers = archive_sandbox_with_http_info(sandbox_id_or_name, opts)
29
+ data
30
+ end
31
+
32
+ # Archive sandbox
33
+ # @param sandbox_id_or_name [String]
34
+ # @param [Hash] opts the optional parameters
35
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
36
+ # @return [Array<(Sandbox, Integer, Hash)>] Sandbox data, response status code and response headers
37
+ def archive_sandbox_with_http_info(sandbox_id_or_name, 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_or_name' is set
42
+ if @api_client.config.client_side_validation && sandbox_id_or_name.nil?
43
+ fail ArgumentError, "Missing the required parameter 'sandbox_id_or_name' when calling SandboxApi.archive_sandbox"
44
+ end
45
+ # resource path
46
+ local_var_path = '/sandbox/{sandboxIdOrName}/archive'.sub('{' + 'sandboxIdOrName' + '}', CGI.escape(sandbox_id_or_name.to_s))
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+
51
+ # header parameters
52
+ header_params = opts[:header_params] || {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
55
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
56
+
57
+ # form parameters
58
+ form_params = opts[:form_params] || {}
59
+
60
+ # http body (model)
61
+ post_body = opts[:debug_body]
62
+
63
+ # return_type
64
+ return_type = opts[:debug_return_type] || 'Sandbox'
65
+
66
+ # auth_names
67
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
68
+
69
+ new_options = opts.merge(
70
+ :operation => :"SandboxApi.archive_sandbox",
71
+ :header_params => header_params,
72
+ :query_params => query_params,
73
+ :form_params => form_params,
74
+ :body => post_body,
75
+ :auth_names => auth_names,
76
+ :return_type => return_type
77
+ )
78
+
79
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
80
+ if @api_client.config.debugging
81
+ @api_client.config.logger.debug "API called: SandboxApi#archive_sandbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
82
+ end
83
+ return data, status_code, headers
84
+ end
85
+
86
+ # Create sandbox backup
87
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
88
+ # @param [Hash] opts the optional parameters
89
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
90
+ # @return [Sandbox]
91
+ def create_backup(sandbox_id_or_name, opts = {})
92
+ data, _status_code, _headers = create_backup_with_http_info(sandbox_id_or_name, opts)
93
+ data
94
+ end
95
+
96
+ # Create sandbox backup
97
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
98
+ # @param [Hash] opts the optional parameters
99
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
100
+ # @return [Array<(Sandbox, Integer, Hash)>] Sandbox data, response status code and response headers
101
+ def create_backup_with_http_info(sandbox_id_or_name, opts = {})
102
+ if @api_client.config.debugging
103
+ @api_client.config.logger.debug 'Calling API: SandboxApi.create_backup ...'
104
+ end
105
+ # verify the required parameter 'sandbox_id_or_name' is set
106
+ if @api_client.config.client_side_validation && sandbox_id_or_name.nil?
107
+ fail ArgumentError, "Missing the required parameter 'sandbox_id_or_name' when calling SandboxApi.create_backup"
108
+ end
109
+ # resource path
110
+ local_var_path = '/sandbox/{sandboxIdOrName}/backup'.sub('{' + 'sandboxIdOrName' + '}', CGI.escape(sandbox_id_or_name.to_s))
111
+
112
+ # query parameters
113
+ query_params = opts[:query_params] || {}
114
+
115
+ # header parameters
116
+ header_params = opts[:header_params] || {}
117
+ # HTTP header 'Accept' (if needed)
118
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
119
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
120
+
121
+ # form parameters
122
+ form_params = opts[:form_params] || {}
123
+
124
+ # http body (model)
125
+ post_body = opts[:debug_body]
126
+
127
+ # return_type
128
+ return_type = opts[:debug_return_type] || 'Sandbox'
129
+
130
+ # auth_names
131
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
132
+
133
+ new_options = opts.merge(
134
+ :operation => :"SandboxApi.create_backup",
135
+ :header_params => header_params,
136
+ :query_params => query_params,
137
+ :form_params => form_params,
138
+ :body => post_body,
139
+ :auth_names => auth_names,
140
+ :return_type => return_type
141
+ )
142
+
143
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
144
+ if @api_client.config.debugging
145
+ @api_client.config.logger.debug "API called: SandboxApi#create_backup\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
146
+ end
147
+ return data, status_code, headers
148
+ end
149
+
150
+ # Create a new sandbox
151
+ # @param create_sandbox [CreateSandbox]
152
+ # @param [Hash] opts the optional parameters
153
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
154
+ # @return [Sandbox]
155
+ def create_sandbox(create_sandbox, opts = {})
156
+ data, _status_code, _headers = create_sandbox_with_http_info(create_sandbox, opts)
157
+ data
158
+ end
159
+
160
+ # Create a new sandbox
161
+ # @param create_sandbox [CreateSandbox]
162
+ # @param [Hash] opts the optional parameters
163
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
164
+ # @return [Array<(Sandbox, Integer, Hash)>] Sandbox data, response status code and response headers
165
+ def create_sandbox_with_http_info(create_sandbox, opts = {})
166
+ if @api_client.config.debugging
167
+ @api_client.config.logger.debug 'Calling API: SandboxApi.create_sandbox ...'
168
+ end
169
+ # verify the required parameter 'create_sandbox' is set
170
+ if @api_client.config.client_side_validation && create_sandbox.nil?
171
+ fail ArgumentError, "Missing the required parameter 'create_sandbox' when calling SandboxApi.create_sandbox"
172
+ end
173
+ # resource path
174
+ local_var_path = '/sandbox'
175
+
176
+ # query parameters
177
+ query_params = opts[:query_params] || {}
178
+
179
+ # header parameters
180
+ header_params = opts[:header_params] || {}
181
+ # HTTP header 'Accept' (if needed)
182
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
183
+ # HTTP header 'Content-Type'
184
+ content_type = @api_client.select_header_content_type(['application/json'])
185
+ if !content_type.nil?
186
+ header_params['Content-Type'] = content_type
187
+ end
188
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
189
+
190
+ # form parameters
191
+ form_params = opts[:form_params] || {}
192
+
193
+ # http body (model)
194
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_sandbox)
195
+
196
+ # return_type
197
+ return_type = opts[:debug_return_type] || 'Sandbox'
198
+
199
+ # auth_names
200
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
201
+
202
+ new_options = opts.merge(
203
+ :operation => :"SandboxApi.create_sandbox",
204
+ :header_params => header_params,
205
+ :query_params => query_params,
206
+ :form_params => form_params,
207
+ :body => post_body,
208
+ :auth_names => auth_names,
209
+ :return_type => return_type
210
+ )
211
+
212
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
213
+ if @api_client.config.debugging
214
+ @api_client.config.logger.debug "API called: SandboxApi#create_sandbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
215
+ end
216
+ return data, status_code, headers
217
+ end
218
+
219
+ # Create a snapshot from a sandbox
220
+ # @param sandbox_id_or_name [String]
221
+ # @param create_sandbox_snapshot [CreateSandboxSnapshot]
222
+ # @param [Hash] opts the optional parameters
223
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
224
+ # @return [Sandbox]
225
+ def create_sandbox_snapshot(sandbox_id_or_name, create_sandbox_snapshot, opts = {})
226
+ data, _status_code, _headers = create_sandbox_snapshot_with_http_info(sandbox_id_or_name, create_sandbox_snapshot, opts)
227
+ data
228
+ end
229
+
230
+ # Create a snapshot from a sandbox
231
+ # @param sandbox_id_or_name [String]
232
+ # @param create_sandbox_snapshot [CreateSandboxSnapshot]
233
+ # @param [Hash] opts the optional parameters
234
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
235
+ # @return [Array<(Sandbox, Integer, Hash)>] Sandbox data, response status code and response headers
236
+ def create_sandbox_snapshot_with_http_info(sandbox_id_or_name, create_sandbox_snapshot, opts = {})
237
+ if @api_client.config.debugging
238
+ @api_client.config.logger.debug 'Calling API: SandboxApi.create_sandbox_snapshot ...'
239
+ end
240
+ # verify the required parameter 'sandbox_id_or_name' is set
241
+ if @api_client.config.client_side_validation && sandbox_id_or_name.nil?
242
+ fail ArgumentError, "Missing the required parameter 'sandbox_id_or_name' when calling SandboxApi.create_sandbox_snapshot"
243
+ end
244
+ # verify the required parameter 'create_sandbox_snapshot' is set
245
+ if @api_client.config.client_side_validation && create_sandbox_snapshot.nil?
246
+ fail ArgumentError, "Missing the required parameter 'create_sandbox_snapshot' when calling SandboxApi.create_sandbox_snapshot"
247
+ end
248
+ # resource path
249
+ local_var_path = '/sandbox/{sandboxIdOrName}/snapshot'.sub('{' + 'sandboxIdOrName' + '}', CGI.escape(sandbox_id_or_name.to_s))
250
+
251
+ # query parameters
252
+ query_params = opts[:query_params] || {}
253
+
254
+ # header parameters
255
+ header_params = opts[:header_params] || {}
256
+ # HTTP header 'Accept' (if needed)
257
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
258
+ # HTTP header 'Content-Type'
259
+ content_type = @api_client.select_header_content_type(['application/json'])
260
+ if !content_type.nil?
261
+ header_params['Content-Type'] = content_type
262
+ end
263
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
264
+
265
+ # form parameters
266
+ form_params = opts[:form_params] || {}
267
+
268
+ # http body (model)
269
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_sandbox_snapshot)
270
+
271
+ # return_type
272
+ return_type = opts[:debug_return_type] || 'Sandbox'
273
+
274
+ # auth_names
275
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
276
+
277
+ new_options = opts.merge(
278
+ :operation => :"SandboxApi.create_sandbox_snapshot",
279
+ :header_params => header_params,
280
+ :query_params => query_params,
281
+ :form_params => form_params,
282
+ :body => post_body,
283
+ :auth_names => auth_names,
284
+ :return_type => return_type
285
+ )
286
+
287
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
288
+ if @api_client.config.debugging
289
+ @api_client.config.logger.debug "API called: SandboxApi#create_sandbox_snapshot\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
290
+ end
291
+ return data, status_code, headers
292
+ end
293
+
294
+ # Create SSH access for sandbox
295
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
296
+ # @param [Hash] opts the optional parameters
297
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
298
+ # @option opts [Float] :expires_in_minutes Expiration time in minutes (default: 60)
299
+ # @return [SshAccessDto]
300
+ def create_ssh_access(sandbox_id_or_name, opts = {})
301
+ data, _status_code, _headers = create_ssh_access_with_http_info(sandbox_id_or_name, opts)
302
+ data
303
+ end
304
+
305
+ # Create SSH access for sandbox
306
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
307
+ # @param [Hash] opts the optional parameters
308
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
309
+ # @option opts [Float] :expires_in_minutes Expiration time in minutes (default: 60)
310
+ # @return [Array<(SshAccessDto, Integer, Hash)>] SshAccessDto data, response status code and response headers
311
+ def create_ssh_access_with_http_info(sandbox_id_or_name, opts = {})
312
+ if @api_client.config.debugging
313
+ @api_client.config.logger.debug 'Calling API: SandboxApi.create_ssh_access ...'
314
+ end
315
+ # verify the required parameter 'sandbox_id_or_name' is set
316
+ if @api_client.config.client_side_validation && sandbox_id_or_name.nil?
317
+ fail ArgumentError, "Missing the required parameter 'sandbox_id_or_name' when calling SandboxApi.create_ssh_access"
318
+ end
319
+ # resource path
320
+ local_var_path = '/sandbox/{sandboxIdOrName}/ssh-access'.sub('{' + 'sandboxIdOrName' + '}', CGI.escape(sandbox_id_or_name.to_s))
321
+
322
+ # query parameters
323
+ query_params = opts[:query_params] || {}
324
+ query_params[:'expiresInMinutes'] = opts[:'expires_in_minutes'] if !opts[:'expires_in_minutes'].nil?
325
+
326
+ # header parameters
327
+ header_params = opts[:header_params] || {}
328
+ # HTTP header 'Accept' (if needed)
329
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
330
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
331
+
332
+ # form parameters
333
+ form_params = opts[:form_params] || {}
334
+
335
+ # http body (model)
336
+ post_body = opts[:debug_body]
337
+
338
+ # return_type
339
+ return_type = opts[:debug_return_type] || 'SshAccessDto'
340
+
341
+ # auth_names
342
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
343
+
344
+ new_options = opts.merge(
345
+ :operation => :"SandboxApi.create_ssh_access",
346
+ :header_params => header_params,
347
+ :query_params => query_params,
348
+ :form_params => form_params,
349
+ :body => post_body,
350
+ :auth_names => auth_names,
351
+ :return_type => return_type
352
+ )
353
+
354
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
355
+ if @api_client.config.debugging
356
+ @api_client.config.logger.debug "API called: SandboxApi#create_ssh_access\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
357
+ end
358
+ return data, status_code, headers
359
+ end
360
+
361
+ # Delete sandbox
362
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
363
+ # @param [Hash] opts the optional parameters
364
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
365
+ # @return [Sandbox]
366
+ def delete_sandbox(sandbox_id_or_name, opts = {})
367
+ data, _status_code, _headers = delete_sandbox_with_http_info(sandbox_id_or_name, opts)
368
+ data
369
+ end
370
+
371
+ # Delete sandbox
372
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
373
+ # @param [Hash] opts the optional parameters
374
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
375
+ # @return [Array<(Sandbox, Integer, Hash)>] Sandbox data, response status code and response headers
376
+ def delete_sandbox_with_http_info(sandbox_id_or_name, opts = {})
377
+ if @api_client.config.debugging
378
+ @api_client.config.logger.debug 'Calling API: SandboxApi.delete_sandbox ...'
379
+ end
380
+ # verify the required parameter 'sandbox_id_or_name' is set
381
+ if @api_client.config.client_side_validation && sandbox_id_or_name.nil?
382
+ fail ArgumentError, "Missing the required parameter 'sandbox_id_or_name' when calling SandboxApi.delete_sandbox"
383
+ end
384
+ # resource path
385
+ local_var_path = '/sandbox/{sandboxIdOrName}'.sub('{' + 'sandboxIdOrName' + '}', CGI.escape(sandbox_id_or_name.to_s))
386
+
387
+ # query parameters
388
+ query_params = opts[:query_params] || {}
389
+
390
+ # header parameters
391
+ header_params = opts[:header_params] || {}
392
+ # HTTP header 'Accept' (if needed)
393
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
394
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
395
+
396
+ # form parameters
397
+ form_params = opts[:form_params] || {}
398
+
399
+ # http body (model)
400
+ post_body = opts[:debug_body]
401
+
402
+ # return_type
403
+ return_type = opts[:debug_return_type] || 'Sandbox'
404
+
405
+ # auth_names
406
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
407
+
408
+ new_options = opts.merge(
409
+ :operation => :"SandboxApi.delete_sandbox",
410
+ :header_params => header_params,
411
+ :query_params => query_params,
412
+ :form_params => form_params,
413
+ :body => post_body,
414
+ :auth_names => auth_names,
415
+ :return_type => return_type
416
+ )
417
+
418
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
419
+ if @api_client.config.debugging
420
+ @api_client.config.logger.debug "API called: SandboxApi#delete_sandbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
421
+ end
422
+ return data, status_code, headers
423
+ end
424
+
425
+ # Expire signed preview URL for a sandbox port
426
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
427
+ # @param port [Integer] Port number to expire signed preview URL for
428
+ # @param token [String] Token to expire signed preview URL for
429
+ # @param [Hash] opts the optional parameters
430
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
431
+ # @return [nil]
432
+ def expire_signed_port_preview_url(sandbox_id_or_name, port, token, opts = {})
433
+ expire_signed_port_preview_url_with_http_info(sandbox_id_or_name, port, token, opts)
434
+ nil
435
+ end
436
+
437
+ # Expire signed preview URL for a sandbox port
438
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
439
+ # @param port [Integer] Port number to expire signed preview URL for
440
+ # @param token [String] Token to expire signed preview URL for
441
+ # @param [Hash] opts the optional parameters
442
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
443
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
444
+ def expire_signed_port_preview_url_with_http_info(sandbox_id_or_name, port, token, opts = {})
445
+ if @api_client.config.debugging
446
+ @api_client.config.logger.debug 'Calling API: SandboxApi.expire_signed_port_preview_url ...'
447
+ end
448
+ # verify the required parameter 'sandbox_id_or_name' is set
449
+ if @api_client.config.client_side_validation && sandbox_id_or_name.nil?
450
+ fail ArgumentError, "Missing the required parameter 'sandbox_id_or_name' when calling SandboxApi.expire_signed_port_preview_url"
451
+ end
452
+ # verify the required parameter 'port' is set
453
+ if @api_client.config.client_side_validation && port.nil?
454
+ fail ArgumentError, "Missing the required parameter 'port' when calling SandboxApi.expire_signed_port_preview_url"
455
+ end
456
+ # verify the required parameter 'token' is set
457
+ if @api_client.config.client_side_validation && token.nil?
458
+ fail ArgumentError, "Missing the required parameter 'token' when calling SandboxApi.expire_signed_port_preview_url"
459
+ end
460
+ # resource path
461
+ local_var_path = '/sandbox/{sandboxIdOrName}/ports/{port}/signed-preview-url/{token}/expire'.sub('{' + 'sandboxIdOrName' + '}', CGI.escape(sandbox_id_or_name.to_s)).sub('{' + 'port' + '}', CGI.escape(port.to_s)).sub('{' + 'token' + '}', CGI.escape(token.to_s))
462
+
463
+ # query parameters
464
+ query_params = opts[:query_params] || {}
465
+
466
+ # header parameters
467
+ header_params = opts[:header_params] || {}
468
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
469
+
470
+ # form parameters
471
+ form_params = opts[:form_params] || {}
472
+
473
+ # http body (model)
474
+ post_body = opts[:debug_body]
475
+
476
+ # return_type
477
+ return_type = opts[:debug_return_type]
478
+
479
+ # auth_names
480
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
481
+
482
+ new_options = opts.merge(
483
+ :operation => :"SandboxApi.expire_signed_port_preview_url",
484
+ :header_params => header_params,
485
+ :query_params => query_params,
486
+ :form_params => form_params,
487
+ :body => post_body,
488
+ :auth_names => auth_names,
489
+ :return_type => return_type
490
+ )
491
+
492
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
493
+ if @api_client.config.debugging
494
+ @api_client.config.logger.debug "API called: SandboxApi#expire_signed_port_preview_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
495
+ end
496
+ return data, status_code, headers
497
+ end
498
+
499
+ # Fork a sandbox
500
+ # @param sandbox_id_or_name [String]
501
+ # @param fork_sandbox [ForkSandbox]
502
+ # @param [Hash] opts the optional parameters
503
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
504
+ # @return [Sandbox]
505
+ def fork_sandbox(sandbox_id_or_name, fork_sandbox, opts = {})
506
+ data, _status_code, _headers = fork_sandbox_with_http_info(sandbox_id_or_name, fork_sandbox, opts)
507
+ data
508
+ end
509
+
510
+ # Fork a sandbox
511
+ # @param sandbox_id_or_name [String]
512
+ # @param fork_sandbox [ForkSandbox]
513
+ # @param [Hash] opts the optional parameters
514
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
515
+ # @return [Array<(Sandbox, Integer, Hash)>] Sandbox data, response status code and response headers
516
+ def fork_sandbox_with_http_info(sandbox_id_or_name, fork_sandbox, opts = {})
517
+ if @api_client.config.debugging
518
+ @api_client.config.logger.debug 'Calling API: SandboxApi.fork_sandbox ...'
519
+ end
520
+ # verify the required parameter 'sandbox_id_or_name' is set
521
+ if @api_client.config.client_side_validation && sandbox_id_or_name.nil?
522
+ fail ArgumentError, "Missing the required parameter 'sandbox_id_or_name' when calling SandboxApi.fork_sandbox"
523
+ end
524
+ # verify the required parameter 'fork_sandbox' is set
525
+ if @api_client.config.client_side_validation && fork_sandbox.nil?
526
+ fail ArgumentError, "Missing the required parameter 'fork_sandbox' when calling SandboxApi.fork_sandbox"
527
+ end
528
+ # resource path
529
+ local_var_path = '/sandbox/{sandboxIdOrName}/fork'.sub('{' + 'sandboxIdOrName' + '}', CGI.escape(sandbox_id_or_name.to_s))
530
+
531
+ # query parameters
532
+ query_params = opts[:query_params] || {}
533
+
534
+ # header parameters
535
+ header_params = opts[:header_params] || {}
536
+ # HTTP header 'Accept' (if needed)
537
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
538
+ # HTTP header 'Content-Type'
539
+ content_type = @api_client.select_header_content_type(['application/json'])
540
+ if !content_type.nil?
541
+ header_params['Content-Type'] = content_type
542
+ end
543
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
544
+
545
+ # form parameters
546
+ form_params = opts[:form_params] || {}
547
+
548
+ # http body (model)
549
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(fork_sandbox)
550
+
551
+ # return_type
552
+ return_type = opts[:debug_return_type] || 'Sandbox'
553
+
554
+ # auth_names
555
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
556
+
557
+ new_options = opts.merge(
558
+ :operation => :"SandboxApi.fork_sandbox",
559
+ :header_params => header_params,
560
+ :query_params => query_params,
561
+ :form_params => form_params,
562
+ :body => post_body,
563
+ :auth_names => auth_names,
564
+ :return_type => return_type
565
+ )
566
+
567
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
568
+ if @api_client.config.debugging
569
+ @api_client.config.logger.debug "API called: SandboxApi#fork_sandbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
570
+ end
571
+ return data, status_code, headers
572
+ end
573
+
574
+ # Get build logs
575
+ # This endpoint is deprecated. Use `getBuildLogsUrl` instead.
576
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
577
+ # @param [Hash] opts the optional parameters
578
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
579
+ # @option opts [Boolean] :follow Whether to follow the logs stream
580
+ # @return [nil]
581
+ def get_build_logs(sandbox_id_or_name, opts = {})
582
+ get_build_logs_with_http_info(sandbox_id_or_name, opts)
583
+ nil
584
+ end
585
+
586
+ # Get build logs
587
+ # This endpoint is deprecated. Use &#x60;getBuildLogsUrl&#x60; instead.
588
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
589
+ # @param [Hash] opts the optional parameters
590
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
591
+ # @option opts [Boolean] :follow Whether to follow the logs stream
592
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
593
+ def get_build_logs_with_http_info(sandbox_id_or_name, opts = {})
594
+ if @api_client.config.debugging
595
+ @api_client.config.logger.debug 'Calling API: SandboxApi.get_build_logs ...'
596
+ end
597
+ # verify the required parameter 'sandbox_id_or_name' is set
598
+ if @api_client.config.client_side_validation && sandbox_id_or_name.nil?
599
+ fail ArgumentError, "Missing the required parameter 'sandbox_id_or_name' when calling SandboxApi.get_build_logs"
600
+ end
601
+ # resource path
602
+ local_var_path = '/sandbox/{sandboxIdOrName}/build-logs'.sub('{' + 'sandboxIdOrName' + '}', CGI.escape(sandbox_id_or_name.to_s))
603
+
604
+ # query parameters
605
+ query_params = opts[:query_params] || {}
606
+ query_params[:'follow'] = opts[:'follow'] if !opts[:'follow'].nil?
607
+
608
+ # header parameters
609
+ header_params = opts[:header_params] || {}
610
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
611
+
612
+ # form parameters
613
+ form_params = opts[:form_params] || {}
614
+
615
+ # http body (model)
616
+ post_body = opts[:debug_body]
617
+
618
+ # return_type
619
+ return_type = opts[:debug_return_type]
620
+
621
+ # auth_names
622
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
623
+
624
+ new_options = opts.merge(
625
+ :operation => :"SandboxApi.get_build_logs",
626
+ :header_params => header_params,
627
+ :query_params => query_params,
628
+ :form_params => form_params,
629
+ :body => post_body,
630
+ :auth_names => auth_names,
631
+ :return_type => return_type
632
+ )
633
+
634
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
635
+ if @api_client.config.debugging
636
+ @api_client.config.logger.debug "API called: SandboxApi#get_build_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
637
+ end
638
+ return data, status_code, headers
639
+ end
640
+
641
+ # Get build logs URL
642
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
643
+ # @param [Hash] opts the optional parameters
644
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
645
+ # @return [Url]
646
+ def get_build_logs_url(sandbox_id_or_name, opts = {})
647
+ data, _status_code, _headers = get_build_logs_url_with_http_info(sandbox_id_or_name, opts)
648
+ data
649
+ end
650
+
651
+ # Get build logs URL
652
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
653
+ # @param [Hash] opts the optional parameters
654
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
655
+ # @return [Array<(Url, Integer, Hash)>] Url data, response status code and response headers
656
+ def get_build_logs_url_with_http_info(sandbox_id_or_name, opts = {})
657
+ if @api_client.config.debugging
658
+ @api_client.config.logger.debug 'Calling API: SandboxApi.get_build_logs_url ...'
659
+ end
660
+ # verify the required parameter 'sandbox_id_or_name' is set
661
+ if @api_client.config.client_side_validation && sandbox_id_or_name.nil?
662
+ fail ArgumentError, "Missing the required parameter 'sandbox_id_or_name' when calling SandboxApi.get_build_logs_url"
663
+ end
664
+ # resource path
665
+ local_var_path = '/sandbox/{sandboxIdOrName}/build-logs-url'.sub('{' + 'sandboxIdOrName' + '}', CGI.escape(sandbox_id_or_name.to_s))
666
+
667
+ # query parameters
668
+ query_params = opts[:query_params] || {}
669
+
670
+ # header parameters
671
+ header_params = opts[:header_params] || {}
672
+ # HTTP header 'Accept' (if needed)
673
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
674
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
675
+
676
+ # form parameters
677
+ form_params = opts[:form_params] || {}
678
+
679
+ # http body (model)
680
+ post_body = opts[:debug_body]
681
+
682
+ # return_type
683
+ return_type = opts[:debug_return_type] || 'Url'
684
+
685
+ # auth_names
686
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
687
+
688
+ new_options = opts.merge(
689
+ :operation => :"SandboxApi.get_build_logs_url",
690
+ :header_params => header_params,
691
+ :query_params => query_params,
692
+ :form_params => form_params,
693
+ :body => post_body,
694
+ :auth_names => auth_names,
695
+ :return_type => return_type
696
+ )
697
+
698
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
699
+ if @api_client.config.debugging
700
+ @api_client.config.logger.debug "API called: SandboxApi#get_build_logs_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
701
+ end
702
+ return data, status_code, headers
703
+ end
704
+
705
+ # Get organization by sandbox ID
706
+ # @param sandbox_id [String] ID of the sandbox
707
+ # @param [Hash] opts the optional parameters
708
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
709
+ # @return [Organization]
710
+ def get_organization_by_sandbox_id(sandbox_id, opts = {})
711
+ data, _status_code, _headers = get_organization_by_sandbox_id_with_http_info(sandbox_id, opts)
712
+ data
713
+ end
714
+
715
+ # Get organization by sandbox ID
716
+ # @param sandbox_id [String] ID of the sandbox
717
+ # @param [Hash] opts the optional parameters
718
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
719
+ # @return [Array<(Organization, Integer, Hash)>] Organization data, response status code and response headers
720
+ def get_organization_by_sandbox_id_with_http_info(sandbox_id, opts = {})
721
+ if @api_client.config.debugging
722
+ @api_client.config.logger.debug 'Calling API: SandboxApi.get_organization_by_sandbox_id ...'
723
+ end
724
+ # verify the required parameter 'sandbox_id' is set
725
+ if @api_client.config.client_side_validation && sandbox_id.nil?
726
+ fail ArgumentError, "Missing the required parameter 'sandbox_id' when calling SandboxApi.get_organization_by_sandbox_id"
727
+ end
728
+ # resource path
729
+ local_var_path = '/sandbox/{sandboxId}/organization'.sub('{' + 'sandboxId' + '}', CGI.escape(sandbox_id.to_s))
730
+
731
+ # query parameters
732
+ query_params = opts[:query_params] || {}
733
+
734
+ # header parameters
735
+ header_params = opts[:header_params] || {}
736
+ # HTTP header 'Accept' (if needed)
737
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
738
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
739
+
740
+ # form parameters
741
+ form_params = opts[:form_params] || {}
742
+
743
+ # http body (model)
744
+ post_body = opts[:debug_body]
745
+
746
+ # return_type
747
+ return_type = opts[:debug_return_type] || 'Organization'
748
+
749
+ # auth_names
750
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
751
+
752
+ new_options = opts.merge(
753
+ :operation => :"SandboxApi.get_organization_by_sandbox_id",
754
+ :header_params => header_params,
755
+ :query_params => query_params,
756
+ :form_params => form_params,
757
+ :body => post_body,
758
+ :auth_names => auth_names,
759
+ :return_type => return_type
760
+ )
761
+
762
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
763
+ if @api_client.config.debugging
764
+ @api_client.config.logger.debug "API called: SandboxApi#get_organization_by_sandbox_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
765
+ end
766
+ return data, status_code, headers
767
+ end
768
+
769
+ # Get preview URL for a sandbox port
770
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
771
+ # @param port [Float] Port number to get preview URL for
772
+ # @param [Hash] opts the optional parameters
773
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
774
+ # @return [PortPreviewUrl]
775
+ def get_port_preview_url(sandbox_id_or_name, port, opts = {})
776
+ data, _status_code, _headers = get_port_preview_url_with_http_info(sandbox_id_or_name, port, opts)
777
+ data
778
+ end
779
+
780
+ # Get preview URL for a sandbox port
781
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
782
+ # @param port [Float] Port number to get preview URL for
783
+ # @param [Hash] opts the optional parameters
784
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
785
+ # @return [Array<(PortPreviewUrl, Integer, Hash)>] PortPreviewUrl data, response status code and response headers
786
+ def get_port_preview_url_with_http_info(sandbox_id_or_name, port, opts = {})
787
+ if @api_client.config.debugging
788
+ @api_client.config.logger.debug 'Calling API: SandboxApi.get_port_preview_url ...'
789
+ end
790
+ # verify the required parameter 'sandbox_id_or_name' is set
791
+ if @api_client.config.client_side_validation && sandbox_id_or_name.nil?
792
+ fail ArgumentError, "Missing the required parameter 'sandbox_id_or_name' when calling SandboxApi.get_port_preview_url"
793
+ end
794
+ # verify the required parameter 'port' is set
795
+ if @api_client.config.client_side_validation && port.nil?
796
+ fail ArgumentError, "Missing the required parameter 'port' when calling SandboxApi.get_port_preview_url"
797
+ end
798
+ # resource path
799
+ local_var_path = '/sandbox/{sandboxIdOrName}/ports/{port}/preview-url'.sub('{' + 'sandboxIdOrName' + '}', CGI.escape(sandbox_id_or_name.to_s)).sub('{' + 'port' + '}', CGI.escape(port.to_s))
800
+
801
+ # query parameters
802
+ query_params = opts[:query_params] || {}
803
+
804
+ # header parameters
805
+ header_params = opts[:header_params] || {}
806
+ # HTTP header 'Accept' (if needed)
807
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
808
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
809
+
810
+ # form parameters
811
+ form_params = opts[:form_params] || {}
812
+
813
+ # http body (model)
814
+ post_body = opts[:debug_body]
815
+
816
+ # return_type
817
+ return_type = opts[:debug_return_type] || 'PortPreviewUrl'
818
+
819
+ # auth_names
820
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
821
+
822
+ new_options = opts.merge(
823
+ :operation => :"SandboxApi.get_port_preview_url",
824
+ :header_params => header_params,
825
+ :query_params => query_params,
826
+ :form_params => form_params,
827
+ :body => post_body,
828
+ :auth_names => auth_names,
829
+ :return_type => return_type
830
+ )
831
+
832
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
833
+ if @api_client.config.debugging
834
+ @api_client.config.logger.debug "API called: SandboxApi#get_port_preview_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
835
+ end
836
+ return data, status_code, headers
837
+ end
838
+
839
+ # Get region quota by sandbox ID
840
+ # @param sandbox_id [String] ID of the sandbox
841
+ # @param [Hash] opts the optional parameters
842
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
843
+ # @return [RegionQuota]
844
+ def get_region_quota_by_sandbox_id(sandbox_id, opts = {})
845
+ data, _status_code, _headers = get_region_quota_by_sandbox_id_with_http_info(sandbox_id, opts)
846
+ data
847
+ end
848
+
849
+ # Get region quota by sandbox ID
850
+ # @param sandbox_id [String] ID of the sandbox
851
+ # @param [Hash] opts the optional parameters
852
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
853
+ # @return [Array<(RegionQuota, Integer, Hash)>] RegionQuota data, response status code and response headers
854
+ def get_region_quota_by_sandbox_id_with_http_info(sandbox_id, opts = {})
855
+ if @api_client.config.debugging
856
+ @api_client.config.logger.debug 'Calling API: SandboxApi.get_region_quota_by_sandbox_id ...'
857
+ end
858
+ # verify the required parameter 'sandbox_id' is set
859
+ if @api_client.config.client_side_validation && sandbox_id.nil?
860
+ fail ArgumentError, "Missing the required parameter 'sandbox_id' when calling SandboxApi.get_region_quota_by_sandbox_id"
861
+ end
862
+ # resource path
863
+ local_var_path = '/sandbox/{sandboxId}/region-quota'.sub('{' + 'sandboxId' + '}', CGI.escape(sandbox_id.to_s))
864
+
865
+ # query parameters
866
+ query_params = opts[:query_params] || {}
867
+
868
+ # header parameters
869
+ header_params = opts[:header_params] || {}
870
+ # HTTP header 'Accept' (if needed)
871
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
872
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
873
+
874
+ # form parameters
875
+ form_params = opts[:form_params] || {}
876
+
877
+ # http body (model)
878
+ post_body = opts[:debug_body]
879
+
880
+ # return_type
881
+ return_type = opts[:debug_return_type] || 'RegionQuota'
882
+
883
+ # auth_names
884
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
885
+
886
+ new_options = opts.merge(
887
+ :operation => :"SandboxApi.get_region_quota_by_sandbox_id",
888
+ :header_params => header_params,
889
+ :query_params => query_params,
890
+ :form_params => form_params,
891
+ :body => post_body,
892
+ :auth_names => auth_names,
893
+ :return_type => return_type
894
+ )
895
+
896
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
897
+ if @api_client.config.debugging
898
+ @api_client.config.logger.debug "API called: SandboxApi#get_region_quota_by_sandbox_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
899
+ end
900
+ return data, status_code, headers
901
+ end
902
+
903
+ # Get sandbox details
904
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
905
+ # @param [Hash] opts the optional parameters
906
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
907
+ # @option opts [Boolean] :verbose Include verbose output
908
+ # @return [Sandbox]
909
+ def get_sandbox(sandbox_id_or_name, opts = {})
910
+ data, _status_code, _headers = get_sandbox_with_http_info(sandbox_id_or_name, opts)
911
+ data
912
+ end
913
+
914
+ # Get sandbox details
915
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
916
+ # @param [Hash] opts the optional parameters
917
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
918
+ # @option opts [Boolean] :verbose Include verbose output
919
+ # @return [Array<(Sandbox, Integer, Hash)>] Sandbox data, response status code and response headers
920
+ def get_sandbox_with_http_info(sandbox_id_or_name, opts = {})
921
+ if @api_client.config.debugging
922
+ @api_client.config.logger.debug 'Calling API: SandboxApi.get_sandbox ...'
923
+ end
924
+ # verify the required parameter 'sandbox_id_or_name' is set
925
+ if @api_client.config.client_side_validation && sandbox_id_or_name.nil?
926
+ fail ArgumentError, "Missing the required parameter 'sandbox_id_or_name' when calling SandboxApi.get_sandbox"
927
+ end
928
+ # resource path
929
+ local_var_path = '/sandbox/{sandboxIdOrName}'.sub('{' + 'sandboxIdOrName' + '}', CGI.escape(sandbox_id_or_name.to_s))
930
+
931
+ # query parameters
932
+ query_params = opts[:query_params] || {}
933
+ query_params[:'verbose'] = opts[:'verbose'] if !opts[:'verbose'].nil?
934
+
935
+ # header parameters
936
+ header_params = opts[:header_params] || {}
937
+ # HTTP header 'Accept' (if needed)
938
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
939
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
940
+
941
+ # form parameters
942
+ form_params = opts[:form_params] || {}
943
+
944
+ # http body (model)
945
+ post_body = opts[:debug_body]
946
+
947
+ # return_type
948
+ return_type = opts[:debug_return_type] || 'Sandbox'
949
+
950
+ # auth_names
951
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
952
+
953
+ new_options = opts.merge(
954
+ :operation => :"SandboxApi.get_sandbox",
955
+ :header_params => header_params,
956
+ :query_params => query_params,
957
+ :form_params => form_params,
958
+ :body => post_body,
959
+ :auth_names => auth_names,
960
+ :return_type => return_type
961
+ )
962
+
963
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
964
+ if @api_client.config.debugging
965
+ @api_client.config.logger.debug "API called: SandboxApi#get_sandbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
966
+ end
967
+ return data, status_code, headers
968
+ end
969
+
970
+ # Get sandbox fork ancestor chain
971
+ # @param sandbox_id_or_name [String]
972
+ # @param [Hash] opts the optional parameters
973
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
974
+ # @return [Array<Sandbox>]
975
+ def get_sandbox_ancestors(sandbox_id_or_name, opts = {})
976
+ data, _status_code, _headers = get_sandbox_ancestors_with_http_info(sandbox_id_or_name, opts)
977
+ data
978
+ end
979
+
980
+ # Get sandbox fork ancestor chain
981
+ # @param sandbox_id_or_name [String]
982
+ # @param [Hash] opts the optional parameters
983
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
984
+ # @return [Array<(Array<Sandbox>, Integer, Hash)>] Array<Sandbox> data, response status code and response headers
985
+ def get_sandbox_ancestors_with_http_info(sandbox_id_or_name, opts = {})
986
+ if @api_client.config.debugging
987
+ @api_client.config.logger.debug 'Calling API: SandboxApi.get_sandbox_ancestors ...'
988
+ end
989
+ # verify the required parameter 'sandbox_id_or_name' is set
990
+ if @api_client.config.client_side_validation && sandbox_id_or_name.nil?
991
+ fail ArgumentError, "Missing the required parameter 'sandbox_id_or_name' when calling SandboxApi.get_sandbox_ancestors"
992
+ end
993
+ # resource path
994
+ local_var_path = '/sandbox/{sandboxIdOrName}/ancestors'.sub('{' + 'sandboxIdOrName' + '}', CGI.escape(sandbox_id_or_name.to_s))
995
+
996
+ # query parameters
997
+ query_params = opts[:query_params] || {}
998
+
999
+ # header parameters
1000
+ header_params = opts[:header_params] || {}
1001
+ # HTTP header 'Accept' (if needed)
1002
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1003
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
1004
+
1005
+ # form parameters
1006
+ form_params = opts[:form_params] || {}
1007
+
1008
+ # http body (model)
1009
+ post_body = opts[:debug_body]
1010
+
1011
+ # return_type
1012
+ return_type = opts[:debug_return_type] || 'Array<Sandbox>'
1013
+
1014
+ # auth_names
1015
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
1016
+
1017
+ new_options = opts.merge(
1018
+ :operation => :"SandboxApi.get_sandbox_ancestors",
1019
+ :header_params => header_params,
1020
+ :query_params => query_params,
1021
+ :form_params => form_params,
1022
+ :body => post_body,
1023
+ :auth_names => auth_names,
1024
+ :return_type => return_type
1025
+ )
1026
+
1027
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1028
+ if @api_client.config.debugging
1029
+ @api_client.config.logger.debug "API called: SandboxApi#get_sandbox_ancestors\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1030
+ end
1031
+ return data, status_code, headers
1032
+ end
1033
+
1034
+ # Get sandbox fork children
1035
+ # @param sandbox_id_or_name [String]
1036
+ # @param [Hash] opts the optional parameters
1037
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
1038
+ # @option opts [Boolean] :include_destroyed
1039
+ # @return [Array<Sandbox>]
1040
+ def get_sandbox_forks(sandbox_id_or_name, opts = {})
1041
+ data, _status_code, _headers = get_sandbox_forks_with_http_info(sandbox_id_or_name, opts)
1042
+ data
1043
+ end
1044
+
1045
+ # Get sandbox fork children
1046
+ # @param sandbox_id_or_name [String]
1047
+ # @param [Hash] opts the optional parameters
1048
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
1049
+ # @option opts [Boolean] :include_destroyed
1050
+ # @return [Array<(Array<Sandbox>, Integer, Hash)>] Array<Sandbox> data, response status code and response headers
1051
+ def get_sandbox_forks_with_http_info(sandbox_id_or_name, opts = {})
1052
+ if @api_client.config.debugging
1053
+ @api_client.config.logger.debug 'Calling API: SandboxApi.get_sandbox_forks ...'
1054
+ end
1055
+ # verify the required parameter 'sandbox_id_or_name' is set
1056
+ if @api_client.config.client_side_validation && sandbox_id_or_name.nil?
1057
+ fail ArgumentError, "Missing the required parameter 'sandbox_id_or_name' when calling SandboxApi.get_sandbox_forks"
1058
+ end
1059
+ # resource path
1060
+ local_var_path = '/sandbox/{sandboxIdOrName}/forks'.sub('{' + 'sandboxIdOrName' + '}', CGI.escape(sandbox_id_or_name.to_s))
1061
+
1062
+ # query parameters
1063
+ query_params = opts[:query_params] || {}
1064
+ query_params[:'includeDestroyed'] = opts[:'include_destroyed'] if !opts[:'include_destroyed'].nil?
1065
+
1066
+ # header parameters
1067
+ header_params = opts[:header_params] || {}
1068
+ # HTTP header 'Accept' (if needed)
1069
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1070
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
1071
+
1072
+ # form parameters
1073
+ form_params = opts[:form_params] || {}
1074
+
1075
+ # http body (model)
1076
+ post_body = opts[:debug_body]
1077
+
1078
+ # return_type
1079
+ return_type = opts[:debug_return_type] || 'Array<Sandbox>'
1080
+
1081
+ # auth_names
1082
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
1083
+
1084
+ new_options = opts.merge(
1085
+ :operation => :"SandboxApi.get_sandbox_forks",
1086
+ :header_params => header_params,
1087
+ :query_params => query_params,
1088
+ :form_params => form_params,
1089
+ :body => post_body,
1090
+ :auth_names => auth_names,
1091
+ :return_type => return_type
1092
+ )
1093
+
1094
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1095
+ if @api_client.config.debugging
1096
+ @api_client.config.logger.debug "API called: SandboxApi#get_sandbox_forks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1097
+ end
1098
+ return data, status_code, headers
1099
+ end
1100
+
1101
+ # Get sandbox logs
1102
+ # Retrieve OTEL logs for a sandbox within a time range
1103
+ # @param sandbox_id [String] ID of the sandbox
1104
+ # @param from [Time] Start of time range (ISO 8601)
1105
+ # @param to [Time] End of time range (ISO 8601)
1106
+ # @param [Hash] opts the optional parameters
1107
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
1108
+ # @option opts [Float] :page Page number (1-indexed) (default to 1)
1109
+ # @option opts [Float] :limit Number of items per page (default to 100)
1110
+ # @option opts [Array<String>] :severities Filter by severity levels (DEBUG, INFO, WARN, ERROR)
1111
+ # @option opts [String] :search Search in log body
1112
+ # @return [PaginatedLogs]
1113
+ def get_sandbox_logs(sandbox_id, from, to, opts = {})
1114
+ data, _status_code, _headers = get_sandbox_logs_with_http_info(sandbox_id, from, to, opts)
1115
+ data
1116
+ end
1117
+
1118
+ # Get sandbox logs
1119
+ # Retrieve OTEL logs for a sandbox within a time range
1120
+ # @param sandbox_id [String] ID of the sandbox
1121
+ # @param from [Time] Start of time range (ISO 8601)
1122
+ # @param to [Time] End of time range (ISO 8601)
1123
+ # @param [Hash] opts the optional parameters
1124
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
1125
+ # @option opts [Float] :page Page number (1-indexed) (default to 1)
1126
+ # @option opts [Float] :limit Number of items per page (default to 100)
1127
+ # @option opts [Array<String>] :severities Filter by severity levels (DEBUG, INFO, WARN, ERROR)
1128
+ # @option opts [String] :search Search in log body
1129
+ # @return [Array<(PaginatedLogs, Integer, Hash)>] PaginatedLogs data, response status code and response headers
1130
+ def get_sandbox_logs_with_http_info(sandbox_id, from, to, opts = {})
1131
+ if @api_client.config.debugging
1132
+ @api_client.config.logger.debug 'Calling API: SandboxApi.get_sandbox_logs ...'
1133
+ end
1134
+ # verify the required parameter 'sandbox_id' is set
1135
+ if @api_client.config.client_side_validation && sandbox_id.nil?
1136
+ fail ArgumentError, "Missing the required parameter 'sandbox_id' when calling SandboxApi.get_sandbox_logs"
1137
+ end
1138
+ # verify the required parameter 'from' is set
1139
+ if @api_client.config.client_side_validation && from.nil?
1140
+ fail ArgumentError, "Missing the required parameter 'from' when calling SandboxApi.get_sandbox_logs"
1141
+ end
1142
+ # verify the required parameter 'to' is set
1143
+ if @api_client.config.client_side_validation && to.nil?
1144
+ fail ArgumentError, "Missing the required parameter 'to' when calling SandboxApi.get_sandbox_logs"
1145
+ end
1146
+ # resource path
1147
+ local_var_path = '/sandbox/{sandboxId}/telemetry/logs'.sub('{' + 'sandboxId' + '}', CGI.escape(sandbox_id.to_s))
1148
+
1149
+ # query parameters
1150
+ query_params = opts[:query_params] || {}
1151
+ query_params[:'from'] = from
1152
+ query_params[:'to'] = to
1153
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
1154
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1155
+ query_params[:'severities'] = @api_client.build_collection_param(opts[:'severities'], :multi) if !opts[:'severities'].nil?
1156
+ query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
1157
+
1158
+ # header parameters
1159
+ header_params = opts[:header_params] || {}
1160
+ # HTTP header 'Accept' (if needed)
1161
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1162
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
1163
+
1164
+ # form parameters
1165
+ form_params = opts[:form_params] || {}
1166
+
1167
+ # http body (model)
1168
+ post_body = opts[:debug_body]
1169
+
1170
+ # return_type
1171
+ return_type = opts[:debug_return_type] || 'PaginatedLogs'
1172
+
1173
+ # auth_names
1174
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
1175
+
1176
+ new_options = opts.merge(
1177
+ :operation => :"SandboxApi.get_sandbox_logs",
1178
+ :header_params => header_params,
1179
+ :query_params => query_params,
1180
+ :form_params => form_params,
1181
+ :body => post_body,
1182
+ :auth_names => auth_names,
1183
+ :return_type => return_type
1184
+ )
1185
+
1186
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1187
+ if @api_client.config.debugging
1188
+ @api_client.config.logger.debug "API called: SandboxApi#get_sandbox_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1189
+ end
1190
+ return data, status_code, headers
1191
+ end
1192
+
1193
+ # Get sandbox metrics
1194
+ # Retrieve OTEL metrics for a sandbox within a time range
1195
+ # @param sandbox_id [String] ID of the sandbox
1196
+ # @param from [Time] Start of time range (ISO 8601)
1197
+ # @param to [Time] End of time range (ISO 8601)
1198
+ # @param [Hash] opts the optional parameters
1199
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
1200
+ # @option opts [Array<String>] :metric_names Filter by metric names
1201
+ # @return [MetricsResponse]
1202
+ def get_sandbox_metrics(sandbox_id, from, to, opts = {})
1203
+ data, _status_code, _headers = get_sandbox_metrics_with_http_info(sandbox_id, from, to, opts)
1204
+ data
1205
+ end
1206
+
1207
+ # Get sandbox metrics
1208
+ # Retrieve OTEL metrics for a sandbox within a time range
1209
+ # @param sandbox_id [String] ID of the sandbox
1210
+ # @param from [Time] Start of time range (ISO 8601)
1211
+ # @param to [Time] End of time range (ISO 8601)
1212
+ # @param [Hash] opts the optional parameters
1213
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
1214
+ # @option opts [Array<String>] :metric_names Filter by metric names
1215
+ # @return [Array<(MetricsResponse, Integer, Hash)>] MetricsResponse data, response status code and response headers
1216
+ def get_sandbox_metrics_with_http_info(sandbox_id, from, to, opts = {})
1217
+ if @api_client.config.debugging
1218
+ @api_client.config.logger.debug 'Calling API: SandboxApi.get_sandbox_metrics ...'
1219
+ end
1220
+ # verify the required parameter 'sandbox_id' is set
1221
+ if @api_client.config.client_side_validation && sandbox_id.nil?
1222
+ fail ArgumentError, "Missing the required parameter 'sandbox_id' when calling SandboxApi.get_sandbox_metrics"
1223
+ end
1224
+ # verify the required parameter 'from' is set
1225
+ if @api_client.config.client_side_validation && from.nil?
1226
+ fail ArgumentError, "Missing the required parameter 'from' when calling SandboxApi.get_sandbox_metrics"
1227
+ end
1228
+ # verify the required parameter 'to' is set
1229
+ if @api_client.config.client_side_validation && to.nil?
1230
+ fail ArgumentError, "Missing the required parameter 'to' when calling SandboxApi.get_sandbox_metrics"
1231
+ end
1232
+ # resource path
1233
+ local_var_path = '/sandbox/{sandboxId}/telemetry/metrics'.sub('{' + 'sandboxId' + '}', CGI.escape(sandbox_id.to_s))
1234
+
1235
+ # query parameters
1236
+ query_params = opts[:query_params] || {}
1237
+ query_params[:'from'] = from
1238
+ query_params[:'to'] = to
1239
+ query_params[:'metricNames'] = @api_client.build_collection_param(opts[:'metric_names'], :multi) if !opts[:'metric_names'].nil?
1240
+
1241
+ # header parameters
1242
+ header_params = opts[:header_params] || {}
1243
+ # HTTP header 'Accept' (if needed)
1244
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1245
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
1246
+
1247
+ # form parameters
1248
+ form_params = opts[:form_params] || {}
1249
+
1250
+ # http body (model)
1251
+ post_body = opts[:debug_body]
1252
+
1253
+ # return_type
1254
+ return_type = opts[:debug_return_type] || 'MetricsResponse'
1255
+
1256
+ # auth_names
1257
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
1258
+
1259
+ new_options = opts.merge(
1260
+ :operation => :"SandboxApi.get_sandbox_metrics",
1261
+ :header_params => header_params,
1262
+ :query_params => query_params,
1263
+ :form_params => form_params,
1264
+ :body => post_body,
1265
+ :auth_names => auth_names,
1266
+ :return_type => return_type
1267
+ )
1268
+
1269
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1270
+ if @api_client.config.debugging
1271
+ @api_client.config.logger.debug "API called: SandboxApi#get_sandbox_metrics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1272
+ end
1273
+ return data, status_code, headers
1274
+ end
1275
+
1276
+ # Get sandbox fork parent
1277
+ # @param sandbox_id_or_name [String]
1278
+ # @param [Hash] opts the optional parameters
1279
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
1280
+ # @return [Sandbox]
1281
+ def get_sandbox_parent(sandbox_id_or_name, opts = {})
1282
+ data, _status_code, _headers = get_sandbox_parent_with_http_info(sandbox_id_or_name, opts)
1283
+ data
1284
+ end
1285
+
1286
+ # Get sandbox fork parent
1287
+ # @param sandbox_id_or_name [String]
1288
+ # @param [Hash] opts the optional parameters
1289
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
1290
+ # @return [Array<(Sandbox, Integer, Hash)>] Sandbox data, response status code and response headers
1291
+ def get_sandbox_parent_with_http_info(sandbox_id_or_name, opts = {})
1292
+ if @api_client.config.debugging
1293
+ @api_client.config.logger.debug 'Calling API: SandboxApi.get_sandbox_parent ...'
1294
+ end
1295
+ # verify the required parameter 'sandbox_id_or_name' is set
1296
+ if @api_client.config.client_side_validation && sandbox_id_or_name.nil?
1297
+ fail ArgumentError, "Missing the required parameter 'sandbox_id_or_name' when calling SandboxApi.get_sandbox_parent"
1298
+ end
1299
+ # resource path
1300
+ local_var_path = '/sandbox/{sandboxIdOrName}/parent'.sub('{' + 'sandboxIdOrName' + '}', CGI.escape(sandbox_id_or_name.to_s))
1301
+
1302
+ # query parameters
1303
+ query_params = opts[:query_params] || {}
1304
+
1305
+ # header parameters
1306
+ header_params = opts[:header_params] || {}
1307
+ # HTTP header 'Accept' (if needed)
1308
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1309
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
1310
+
1311
+ # form parameters
1312
+ form_params = opts[:form_params] || {}
1313
+
1314
+ # http body (model)
1315
+ post_body = opts[:debug_body]
1316
+
1317
+ # return_type
1318
+ return_type = opts[:debug_return_type] || 'Sandbox'
1319
+
1320
+ # auth_names
1321
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
1322
+
1323
+ new_options = opts.merge(
1324
+ :operation => :"SandboxApi.get_sandbox_parent",
1325
+ :header_params => header_params,
1326
+ :query_params => query_params,
1327
+ :form_params => form_params,
1328
+ :body => post_body,
1329
+ :auth_names => auth_names,
1330
+ :return_type => return_type
1331
+ )
1332
+
1333
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1334
+ if @api_client.config.debugging
1335
+ @api_client.config.logger.debug "API called: SandboxApi#get_sandbox_parent\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1336
+ end
1337
+ return data, status_code, headers
1338
+ end
1339
+
1340
+ # Get trace spans
1341
+ # Retrieve all spans for a specific trace
1342
+ # @param sandbox_id [String] ID of the sandbox
1343
+ # @param trace_id [String] ID of the trace
1344
+ # @param [Hash] opts the optional parameters
1345
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
1346
+ # @return [Array<TraceSpan>]
1347
+ def get_sandbox_trace_spans(sandbox_id, trace_id, opts = {})
1348
+ data, _status_code, _headers = get_sandbox_trace_spans_with_http_info(sandbox_id, trace_id, opts)
1349
+ data
1350
+ end
1351
+
1352
+ # Get trace spans
1353
+ # Retrieve all spans for a specific trace
1354
+ # @param sandbox_id [String] ID of the sandbox
1355
+ # @param trace_id [String] ID of the trace
1356
+ # @param [Hash] opts the optional parameters
1357
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
1358
+ # @return [Array<(Array<TraceSpan>, Integer, Hash)>] Array<TraceSpan> data, response status code and response headers
1359
+ def get_sandbox_trace_spans_with_http_info(sandbox_id, trace_id, opts = {})
1360
+ if @api_client.config.debugging
1361
+ @api_client.config.logger.debug 'Calling API: SandboxApi.get_sandbox_trace_spans ...'
1362
+ end
1363
+ # verify the required parameter 'sandbox_id' is set
1364
+ if @api_client.config.client_side_validation && sandbox_id.nil?
1365
+ fail ArgumentError, "Missing the required parameter 'sandbox_id' when calling SandboxApi.get_sandbox_trace_spans"
1366
+ end
1367
+ # verify the required parameter 'trace_id' is set
1368
+ if @api_client.config.client_side_validation && trace_id.nil?
1369
+ fail ArgumentError, "Missing the required parameter 'trace_id' when calling SandboxApi.get_sandbox_trace_spans"
1370
+ end
1371
+ # resource path
1372
+ local_var_path = '/sandbox/{sandboxId}/telemetry/traces/{traceId}'.sub('{' + 'sandboxId' + '}', CGI.escape(sandbox_id.to_s)).sub('{' + 'traceId' + '}', CGI.escape(trace_id.to_s))
1373
+
1374
+ # query parameters
1375
+ query_params = opts[:query_params] || {}
1376
+
1377
+ # header parameters
1378
+ header_params = opts[:header_params] || {}
1379
+ # HTTP header 'Accept' (if needed)
1380
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1381
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
1382
+
1383
+ # form parameters
1384
+ form_params = opts[:form_params] || {}
1385
+
1386
+ # http body (model)
1387
+ post_body = opts[:debug_body]
1388
+
1389
+ # return_type
1390
+ return_type = opts[:debug_return_type] || 'Array<TraceSpan>'
1391
+
1392
+ # auth_names
1393
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
1394
+
1395
+ new_options = opts.merge(
1396
+ :operation => :"SandboxApi.get_sandbox_trace_spans",
1397
+ :header_params => header_params,
1398
+ :query_params => query_params,
1399
+ :form_params => form_params,
1400
+ :body => post_body,
1401
+ :auth_names => auth_names,
1402
+ :return_type => return_type
1403
+ )
1404
+
1405
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1406
+ if @api_client.config.debugging
1407
+ @api_client.config.logger.debug "API called: SandboxApi#get_sandbox_trace_spans\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1408
+ end
1409
+ return data, status_code, headers
1410
+ end
1411
+
1412
+ # Get sandbox traces
1413
+ # Retrieve OTEL traces for a sandbox within a time range
1414
+ # @param sandbox_id [String] ID of the sandbox
1415
+ # @param from [Time] Start of time range (ISO 8601)
1416
+ # @param to [Time] End of time range (ISO 8601)
1417
+ # @param [Hash] opts the optional parameters
1418
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
1419
+ # @option opts [Float] :page Page number (1-indexed) (default to 1)
1420
+ # @option opts [Float] :limit Number of items per page (default to 100)
1421
+ # @return [PaginatedTraces]
1422
+ def get_sandbox_traces(sandbox_id, from, to, opts = {})
1423
+ data, _status_code, _headers = get_sandbox_traces_with_http_info(sandbox_id, from, to, opts)
1424
+ data
1425
+ end
1426
+
1427
+ # Get sandbox traces
1428
+ # Retrieve OTEL traces for a sandbox within a time range
1429
+ # @param sandbox_id [String] ID of the sandbox
1430
+ # @param from [Time] Start of time range (ISO 8601)
1431
+ # @param to [Time] End of time range (ISO 8601)
1432
+ # @param [Hash] opts the optional parameters
1433
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
1434
+ # @option opts [Float] :page Page number (1-indexed) (default to 1)
1435
+ # @option opts [Float] :limit Number of items per page (default to 100)
1436
+ # @return [Array<(PaginatedTraces, Integer, Hash)>] PaginatedTraces data, response status code and response headers
1437
+ def get_sandbox_traces_with_http_info(sandbox_id, from, to, opts = {})
1438
+ if @api_client.config.debugging
1439
+ @api_client.config.logger.debug 'Calling API: SandboxApi.get_sandbox_traces ...'
1440
+ end
1441
+ # verify the required parameter 'sandbox_id' is set
1442
+ if @api_client.config.client_side_validation && sandbox_id.nil?
1443
+ fail ArgumentError, "Missing the required parameter 'sandbox_id' when calling SandboxApi.get_sandbox_traces"
1444
+ end
1445
+ # verify the required parameter 'from' is set
1446
+ if @api_client.config.client_side_validation && from.nil?
1447
+ fail ArgumentError, "Missing the required parameter 'from' when calling SandboxApi.get_sandbox_traces"
1448
+ end
1449
+ # verify the required parameter 'to' is set
1450
+ if @api_client.config.client_side_validation && to.nil?
1451
+ fail ArgumentError, "Missing the required parameter 'to' when calling SandboxApi.get_sandbox_traces"
1452
+ end
1453
+ # resource path
1454
+ local_var_path = '/sandbox/{sandboxId}/telemetry/traces'.sub('{' + 'sandboxId' + '}', CGI.escape(sandbox_id.to_s))
1455
+
1456
+ # query parameters
1457
+ query_params = opts[:query_params] || {}
1458
+ query_params[:'from'] = from
1459
+ query_params[:'to'] = to
1460
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
1461
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1462
+
1463
+ # header parameters
1464
+ header_params = opts[:header_params] || {}
1465
+ # HTTP header 'Accept' (if needed)
1466
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1467
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
1468
+
1469
+ # form parameters
1470
+ form_params = opts[:form_params] || {}
1471
+
1472
+ # http body (model)
1473
+ post_body = opts[:debug_body]
1474
+
1475
+ # return_type
1476
+ return_type = opts[:debug_return_type] || 'PaginatedTraces'
1477
+
1478
+ # auth_names
1479
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
1480
+
1481
+ new_options = opts.merge(
1482
+ :operation => :"SandboxApi.get_sandbox_traces",
1483
+ :header_params => header_params,
1484
+ :query_params => query_params,
1485
+ :form_params => form_params,
1486
+ :body => post_body,
1487
+ :auth_names => auth_names,
1488
+ :return_type => return_type
1489
+ )
1490
+
1491
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1492
+ if @api_client.config.debugging
1493
+ @api_client.config.logger.debug "API called: SandboxApi#get_sandbox_traces\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1494
+ end
1495
+ return data, status_code, headers
1496
+ end
1497
+
1498
+ # Get sandboxes for the authenticated runner
1499
+ # @param [Hash] opts the optional parameters
1500
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
1501
+ # @option opts [String] :states Comma-separated list of sandbox states to filter by
1502
+ # @option opts [Boolean] :skip_reconciling_sandboxes Skip sandboxes where state differs from desired state
1503
+ # @return [Array<Sandbox>]
1504
+ def get_sandboxes_for_runner(opts = {})
1505
+ data, _status_code, _headers = get_sandboxes_for_runner_with_http_info(opts)
1506
+ data
1507
+ end
1508
+
1509
+ # Get sandboxes for the authenticated runner
1510
+ # @param [Hash] opts the optional parameters
1511
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
1512
+ # @option opts [String] :states Comma-separated list of sandbox states to filter by
1513
+ # @option opts [Boolean] :skip_reconciling_sandboxes Skip sandboxes where state differs from desired state
1514
+ # @return [Array<(Array<Sandbox>, Integer, Hash)>] Array<Sandbox> data, response status code and response headers
1515
+ def get_sandboxes_for_runner_with_http_info(opts = {})
1516
+ if @api_client.config.debugging
1517
+ @api_client.config.logger.debug 'Calling API: SandboxApi.get_sandboxes_for_runner ...'
1518
+ end
1519
+ # resource path
1520
+ local_var_path = '/sandbox/for-runner'
1521
+
1522
+ # query parameters
1523
+ query_params = opts[:query_params] || {}
1524
+ query_params[:'states'] = opts[:'states'] if !opts[:'states'].nil?
1525
+ query_params[:'skipReconcilingSandboxes'] = opts[:'skip_reconciling_sandboxes'] if !opts[:'skip_reconciling_sandboxes'].nil?
1526
+
1527
+ # header parameters
1528
+ header_params = opts[:header_params] || {}
1529
+ # HTTP header 'Accept' (if needed)
1530
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1531
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
1532
+
1533
+ # form parameters
1534
+ form_params = opts[:form_params] || {}
1535
+
1536
+ # http body (model)
1537
+ post_body = opts[:debug_body]
1538
+
1539
+ # return_type
1540
+ return_type = opts[:debug_return_type] || 'Array<Sandbox>'
1541
+
1542
+ # auth_names
1543
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
1544
+
1545
+ new_options = opts.merge(
1546
+ :operation => :"SandboxApi.get_sandboxes_for_runner",
1547
+ :header_params => header_params,
1548
+ :query_params => query_params,
1549
+ :form_params => form_params,
1550
+ :body => post_body,
1551
+ :auth_names => auth_names,
1552
+ :return_type => return_type
1553
+ )
1554
+
1555
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1556
+ if @api_client.config.debugging
1557
+ @api_client.config.logger.debug "API called: SandboxApi#get_sandboxes_for_runner\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1558
+ end
1559
+ return data, status_code, headers
1560
+ end
1561
+
1562
+ # Get signed preview URL for a sandbox port
1563
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
1564
+ # @param port [Integer] Port number to get signed preview URL for
1565
+ # @param [Hash] opts the optional parameters
1566
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
1567
+ # @option opts [Integer] :expires_in_seconds Expiration time in seconds (default: 60 seconds)
1568
+ # @return [SignedPortPreviewUrl]
1569
+ def get_signed_port_preview_url(sandbox_id_or_name, port, opts = {})
1570
+ data, _status_code, _headers = get_signed_port_preview_url_with_http_info(sandbox_id_or_name, port, opts)
1571
+ data
1572
+ end
1573
+
1574
+ # Get signed preview URL for a sandbox port
1575
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
1576
+ # @param port [Integer] Port number to get signed preview URL for
1577
+ # @param [Hash] opts the optional parameters
1578
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
1579
+ # @option opts [Integer] :expires_in_seconds Expiration time in seconds (default: 60 seconds)
1580
+ # @return [Array<(SignedPortPreviewUrl, Integer, Hash)>] SignedPortPreviewUrl data, response status code and response headers
1581
+ def get_signed_port_preview_url_with_http_info(sandbox_id_or_name, port, opts = {})
1582
+ if @api_client.config.debugging
1583
+ @api_client.config.logger.debug 'Calling API: SandboxApi.get_signed_port_preview_url ...'
1584
+ end
1585
+ # verify the required parameter 'sandbox_id_or_name' is set
1586
+ if @api_client.config.client_side_validation && sandbox_id_or_name.nil?
1587
+ fail ArgumentError, "Missing the required parameter 'sandbox_id_or_name' when calling SandboxApi.get_signed_port_preview_url"
1588
+ end
1589
+ # verify the required parameter 'port' is set
1590
+ if @api_client.config.client_side_validation && port.nil?
1591
+ fail ArgumentError, "Missing the required parameter 'port' when calling SandboxApi.get_signed_port_preview_url"
1592
+ end
1593
+ # resource path
1594
+ local_var_path = '/sandbox/{sandboxIdOrName}/ports/{port}/signed-preview-url'.sub('{' + 'sandboxIdOrName' + '}', CGI.escape(sandbox_id_or_name.to_s)).sub('{' + 'port' + '}', CGI.escape(port.to_s))
1595
+
1596
+ # query parameters
1597
+ query_params = opts[:query_params] || {}
1598
+ query_params[:'expiresInSeconds'] = opts[:'expires_in_seconds'] if !opts[:'expires_in_seconds'].nil?
1599
+
1600
+ # header parameters
1601
+ header_params = opts[:header_params] || {}
1602
+ # HTTP header 'Accept' (if needed)
1603
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1604
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
1605
+
1606
+ # form parameters
1607
+ form_params = opts[:form_params] || {}
1608
+
1609
+ # http body (model)
1610
+ post_body = opts[:debug_body]
1611
+
1612
+ # return_type
1613
+ return_type = opts[:debug_return_type] || 'SignedPortPreviewUrl'
1614
+
1615
+ # auth_names
1616
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
1617
+
1618
+ new_options = opts.merge(
1619
+ :operation => :"SandboxApi.get_signed_port_preview_url",
1620
+ :header_params => header_params,
1621
+ :query_params => query_params,
1622
+ :form_params => form_params,
1623
+ :body => post_body,
1624
+ :auth_names => auth_names,
1625
+ :return_type => return_type
1626
+ )
1627
+
1628
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1629
+ if @api_client.config.debugging
1630
+ @api_client.config.logger.debug "API called: SandboxApi#get_signed_port_preview_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1631
+ end
1632
+ return data, status_code, headers
1633
+ end
1634
+
1635
+ # Get toolbox proxy URL for a sandbox
1636
+ # @param sandbox_id [String] ID of the sandbox
1637
+ # @param [Hash] opts the optional parameters
1638
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
1639
+ # @return [ToolboxProxyUrl]
1640
+ def get_toolbox_proxy_url(sandbox_id, opts = {})
1641
+ data, _status_code, _headers = get_toolbox_proxy_url_with_http_info(sandbox_id, opts)
1642
+ data
1643
+ end
1644
+
1645
+ # Get toolbox proxy URL for a sandbox
1646
+ # @param sandbox_id [String] ID of the sandbox
1647
+ # @param [Hash] opts the optional parameters
1648
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
1649
+ # @return [Array<(ToolboxProxyUrl, Integer, Hash)>] ToolboxProxyUrl data, response status code and response headers
1650
+ def get_toolbox_proxy_url_with_http_info(sandbox_id, opts = {})
1651
+ if @api_client.config.debugging
1652
+ @api_client.config.logger.debug 'Calling API: SandboxApi.get_toolbox_proxy_url ...'
1653
+ end
1654
+ # verify the required parameter 'sandbox_id' is set
1655
+ if @api_client.config.client_side_validation && sandbox_id.nil?
1656
+ fail ArgumentError, "Missing the required parameter 'sandbox_id' when calling SandboxApi.get_toolbox_proxy_url"
1657
+ end
1658
+ # resource path
1659
+ local_var_path = '/sandbox/{sandboxId}/toolbox-proxy-url'.sub('{' + 'sandboxId' + '}', CGI.escape(sandbox_id.to_s))
1660
+
1661
+ # query parameters
1662
+ query_params = opts[:query_params] || {}
1663
+
1664
+ # header parameters
1665
+ header_params = opts[:header_params] || {}
1666
+ # HTTP header 'Accept' (if needed)
1667
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1668
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
1669
+
1670
+ # form parameters
1671
+ form_params = opts[:form_params] || {}
1672
+
1673
+ # http body (model)
1674
+ post_body = opts[:debug_body]
1675
+
1676
+ # return_type
1677
+ return_type = opts[:debug_return_type] || 'ToolboxProxyUrl'
1678
+
1679
+ # auth_names
1680
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
1681
+
1682
+ new_options = opts.merge(
1683
+ :operation => :"SandboxApi.get_toolbox_proxy_url",
1684
+ :header_params => header_params,
1685
+ :query_params => query_params,
1686
+ :form_params => form_params,
1687
+ :body => post_body,
1688
+ :auth_names => auth_names,
1689
+ :return_type => return_type
1690
+ )
1691
+
1692
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1693
+ if @api_client.config.debugging
1694
+ @api_client.config.logger.debug "API called: SandboxApi#get_toolbox_proxy_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1695
+ end
1696
+ return data, status_code, headers
1697
+ end
1698
+
1699
+ # List sandboxes
1700
+ # Advanced filtering and ordering. Eventually consistent.
1701
+ # @param [Hash] opts the optional parameters
1702
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
1703
+ # @option opts [String] :cursor Pagination cursor from a previous response
1704
+ # @option opts [Float] :limit Number of results per page (default to 100)
1705
+ # @option opts [String] :id Filter by ID prefix (case-insensitive)
1706
+ # @option opts [String] :name Filter by name prefix (case-insensitive)
1707
+ # @option opts [String] :labels JSON encoded labels to filter by
1708
+ # @option opts [Boolean] :include_errored_deleted Include results with errored state and deleted desired state (default to false)
1709
+ # @option opts [Array<SandboxState>] :states List of states to filter by.
1710
+ # @option opts [Array<String>] :snapshots List of snapshot names to filter by
1711
+ # @option opts [Array<String>] :region_ids List of regions IDs to filter by
1712
+ # @option opts [Array<SandboxClass>] :sandbox_classes List of sandbox classes to filter by
1713
+ # @option opts [Float] :min_cpu Minimum CPU
1714
+ # @option opts [Float] :max_cpu Maximum CPU
1715
+ # @option opts [Float] :min_memory_gi_b Minimum memory in GiB
1716
+ # @option opts [Float] :max_memory_gi_b Maximum memory in GiB
1717
+ # @option opts [Float] :min_disk_gi_b Minimum disk space in GiB
1718
+ # @option opts [Float] :max_disk_gi_b Maximum disk space in GiB
1719
+ # @option opts [Boolean] :is_public Filter by public status
1720
+ # @option opts [Boolean] :is_recoverable Filter by recoverable status
1721
+ # @option opts [Time] :created_at_after Include items created after this timestamp
1722
+ # @option opts [Time] :created_at_before Include items created before this timestamp
1723
+ # @option opts [Time] :last_event_after Include items with last event after this timestamp
1724
+ # @option opts [Time] :last_event_before Include items with last event before this timestamp
1725
+ # @option opts [SandboxListSortField] :sort Field to sort by
1726
+ # @option opts [SandboxListSortDirection] :order Direction to sort by
1727
+ # @return [ListSandboxesResponse]
1728
+ def list_sandboxes(opts = {})
1729
+ data, _status_code, _headers = list_sandboxes_with_http_info(opts)
1730
+ data
1731
+ end
1732
+
1733
+ # List sandboxes
1734
+ # Advanced filtering and ordering. Eventually consistent.
1735
+ # @param [Hash] opts the optional parameters
1736
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
1737
+ # @option opts [String] :cursor Pagination cursor from a previous response
1738
+ # @option opts [Float] :limit Number of results per page (default to 100)
1739
+ # @option opts [String] :id Filter by ID prefix (case-insensitive)
1740
+ # @option opts [String] :name Filter by name prefix (case-insensitive)
1741
+ # @option opts [String] :labels JSON encoded labels to filter by
1742
+ # @option opts [Boolean] :include_errored_deleted Include results with errored state and deleted desired state (default to false)
1743
+ # @option opts [Array<SandboxState>] :states List of states to filter by.
1744
+ # @option opts [Array<String>] :snapshots List of snapshot names to filter by
1745
+ # @option opts [Array<String>] :region_ids List of regions IDs to filter by
1746
+ # @option opts [Array<SandboxClass>] :sandbox_classes List of sandbox classes to filter by
1747
+ # @option opts [Float] :min_cpu Minimum CPU
1748
+ # @option opts [Float] :max_cpu Maximum CPU
1749
+ # @option opts [Float] :min_memory_gi_b Minimum memory in GiB
1750
+ # @option opts [Float] :max_memory_gi_b Maximum memory in GiB
1751
+ # @option opts [Float] :min_disk_gi_b Minimum disk space in GiB
1752
+ # @option opts [Float] :max_disk_gi_b Maximum disk space in GiB
1753
+ # @option opts [Boolean] :is_public Filter by public status
1754
+ # @option opts [Boolean] :is_recoverable Filter by recoverable status
1755
+ # @option opts [Time] :created_at_after Include items created after this timestamp
1756
+ # @option opts [Time] :created_at_before Include items created before this timestamp
1757
+ # @option opts [Time] :last_event_after Include items with last event after this timestamp
1758
+ # @option opts [Time] :last_event_before Include items with last event before this timestamp
1759
+ # @option opts [SandboxListSortField] :sort Field to sort by
1760
+ # @option opts [SandboxListSortDirection] :order Direction to sort by
1761
+ # @return [Array<(ListSandboxesResponse, Integer, Hash)>] ListSandboxesResponse data, response status code and response headers
1762
+ def list_sandboxes_with_http_info(opts = {})
1763
+ if @api_client.config.debugging
1764
+ @api_client.config.logger.debug 'Calling API: SandboxApi.list_sandboxes ...'
1765
+ end
1766
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 200
1767
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SandboxApi.list_sandboxes, must be smaller than or equal to 200.'
1768
+ end
1769
+
1770
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
1771
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SandboxApi.list_sandboxes, must be greater than or equal to 1.'
1772
+ end
1773
+
1774
+ if @api_client.config.client_side_validation && !opts[:'min_cpu'].nil? && opts[:'min_cpu'] < 1
1775
+ fail ArgumentError, 'invalid value for "opts[:"min_cpu"]" when calling SandboxApi.list_sandboxes, must be greater than or equal to 1.'
1776
+ end
1777
+
1778
+ if @api_client.config.client_side_validation && !opts[:'max_cpu'].nil? && opts[:'max_cpu'] < 1
1779
+ fail ArgumentError, 'invalid value for "opts[:"max_cpu"]" when calling SandboxApi.list_sandboxes, must be greater than or equal to 1.'
1780
+ end
1781
+
1782
+ if @api_client.config.client_side_validation && !opts[:'min_memory_gi_b'].nil? && opts[:'min_memory_gi_b'] < 1
1783
+ fail ArgumentError, 'invalid value for "opts[:"min_memory_gi_b"]" when calling SandboxApi.list_sandboxes, must be greater than or equal to 1.'
1784
+ end
1785
+
1786
+ if @api_client.config.client_side_validation && !opts[:'max_memory_gi_b'].nil? && opts[:'max_memory_gi_b'] < 1
1787
+ fail ArgumentError, 'invalid value for "opts[:"max_memory_gi_b"]" when calling SandboxApi.list_sandboxes, must be greater than or equal to 1.'
1788
+ end
1789
+
1790
+ if @api_client.config.client_side_validation && !opts[:'min_disk_gi_b'].nil? && opts[:'min_disk_gi_b'] < 1
1791
+ fail ArgumentError, 'invalid value for "opts[:"min_disk_gi_b"]" when calling SandboxApi.list_sandboxes, must be greater than or equal to 1.'
1792
+ end
1793
+
1794
+ if @api_client.config.client_side_validation && !opts[:'max_disk_gi_b'].nil? && opts[:'max_disk_gi_b'] < 1
1795
+ fail ArgumentError, 'invalid value for "opts[:"max_disk_gi_b"]" when calling SandboxApi.list_sandboxes, must be greater than or equal to 1.'
1796
+ end
1797
+
1798
+ # resource path
1799
+ local_var_path = '/sandbox'
1800
+
1801
+ # query parameters
1802
+ query_params = opts[:query_params] || {}
1803
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
1804
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1805
+ query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?
1806
+ query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
1807
+ query_params[:'labels'] = opts[:'labels'] if !opts[:'labels'].nil?
1808
+ query_params[:'includeErroredDeleted'] = opts[:'include_errored_deleted'] if !opts[:'include_errored_deleted'].nil?
1809
+ query_params[:'states'] = @api_client.build_collection_param(opts[:'states'], :multi) if !opts[:'states'].nil?
1810
+ query_params[:'snapshots'] = @api_client.build_collection_param(opts[:'snapshots'], :multi) if !opts[:'snapshots'].nil?
1811
+ query_params[:'regionIds'] = @api_client.build_collection_param(opts[:'region_ids'], :multi) if !opts[:'region_ids'].nil?
1812
+ query_params[:'sandboxClasses'] = @api_client.build_collection_param(opts[:'sandbox_classes'], :multi) if !opts[:'sandbox_classes'].nil?
1813
+ query_params[:'minCpu'] = opts[:'min_cpu'] if !opts[:'min_cpu'].nil?
1814
+ query_params[:'maxCpu'] = opts[:'max_cpu'] if !opts[:'max_cpu'].nil?
1815
+ query_params[:'minMemoryGiB'] = opts[:'min_memory_gi_b'] if !opts[:'min_memory_gi_b'].nil?
1816
+ query_params[:'maxMemoryGiB'] = opts[:'max_memory_gi_b'] if !opts[:'max_memory_gi_b'].nil?
1817
+ query_params[:'minDiskGiB'] = opts[:'min_disk_gi_b'] if !opts[:'min_disk_gi_b'].nil?
1818
+ query_params[:'maxDiskGiB'] = opts[:'max_disk_gi_b'] if !opts[:'max_disk_gi_b'].nil?
1819
+ query_params[:'isPublic'] = opts[:'is_public'] if !opts[:'is_public'].nil?
1820
+ query_params[:'isRecoverable'] = opts[:'is_recoverable'] if !opts[:'is_recoverable'].nil?
1821
+ query_params[:'createdAtAfter'] = opts[:'created_at_after'] if !opts[:'created_at_after'].nil?
1822
+ query_params[:'createdAtBefore'] = opts[:'created_at_before'] if !opts[:'created_at_before'].nil?
1823
+ query_params[:'lastEventAfter'] = opts[:'last_event_after'] if !opts[:'last_event_after'].nil?
1824
+ query_params[:'lastEventBefore'] = opts[:'last_event_before'] if !opts[:'last_event_before'].nil?
1825
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
1826
+ query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
1827
+
1828
+ # header parameters
1829
+ header_params = opts[:header_params] || {}
1830
+ # HTTP header 'Accept' (if needed)
1831
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1832
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
1833
+
1834
+ # form parameters
1835
+ form_params = opts[:form_params] || {}
1836
+
1837
+ # http body (model)
1838
+ post_body = opts[:debug_body]
1839
+
1840
+ # return_type
1841
+ return_type = opts[:debug_return_type] || 'ListSandboxesResponse'
1842
+
1843
+ # auth_names
1844
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
1845
+
1846
+ new_options = opts.merge(
1847
+ :operation => :"SandboxApi.list_sandboxes",
1848
+ :header_params => header_params,
1849
+ :query_params => query_params,
1850
+ :form_params => form_params,
1851
+ :body => post_body,
1852
+ :auth_names => auth_names,
1853
+ :return_type => return_type
1854
+ )
1855
+
1856
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1857
+ if @api_client.config.debugging
1858
+ @api_client.config.logger.debug "API called: SandboxApi#list_sandboxes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1859
+ end
1860
+ return data, status_code, headers
1861
+ end
1862
+
1863
+ # [DEPRECATED] List all sandboxes paginated
1864
+ # @param [Hash] opts the optional parameters
1865
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
1866
+ # @option opts [Float] :page Page number of the results (default to 1)
1867
+ # @option opts [Float] :limit Number of results per page (default to 100)
1868
+ # @option opts [String] :id Filter by partial ID match
1869
+ # @option opts [String] :name Filter by partial name match
1870
+ # @option opts [String] :labels JSON encoded labels to filter by
1871
+ # @option opts [Boolean] :include_errored_deleted Include results with errored state and deleted desired state (default to false)
1872
+ # @option opts [Array<String>] :states List of states to filter by
1873
+ # @option opts [Array<String>] :snapshots List of snapshot names to filter by
1874
+ # @option opts [Array<String>] :regions List of regions to filter by
1875
+ # @option opts [Float] :min_cpu Minimum CPU
1876
+ # @option opts [Float] :max_cpu Maximum CPU
1877
+ # @option opts [Float] :min_memory_gi_b Minimum memory in GiB
1878
+ # @option opts [Float] :max_memory_gi_b Maximum memory in GiB
1879
+ # @option opts [Float] :min_disk_gi_b Minimum disk space in GiB
1880
+ # @option opts [Float] :max_disk_gi_b Maximum disk space in GiB
1881
+ # @option opts [Time] :last_event_after Include items with last event after this timestamp
1882
+ # @option opts [Time] :last_event_before Include items with last event before this timestamp
1883
+ # @option opts [String] :sort Field to sort by (default to 'createdAt')
1884
+ # @option opts [String] :order Direction to sort by (default to 'desc')
1885
+ # @return [PaginatedSandboxesDeprecated]
1886
+ def list_sandboxes_paginated_deprecated(opts = {})
1887
+ data, _status_code, _headers = list_sandboxes_paginated_deprecated_with_http_info(opts)
1888
+ data
1889
+ end
1890
+
1891
+ # [DEPRECATED] List all sandboxes paginated
1892
+ # @param [Hash] opts the optional parameters
1893
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
1894
+ # @option opts [Float] :page Page number of the results (default to 1)
1895
+ # @option opts [Float] :limit Number of results per page (default to 100)
1896
+ # @option opts [String] :id Filter by partial ID match
1897
+ # @option opts [String] :name Filter by partial name match
1898
+ # @option opts [String] :labels JSON encoded labels to filter by
1899
+ # @option opts [Boolean] :include_errored_deleted Include results with errored state and deleted desired state (default to false)
1900
+ # @option opts [Array<String>] :states List of states to filter by
1901
+ # @option opts [Array<String>] :snapshots List of snapshot names to filter by
1902
+ # @option opts [Array<String>] :regions List of regions to filter by
1903
+ # @option opts [Float] :min_cpu Minimum CPU
1904
+ # @option opts [Float] :max_cpu Maximum CPU
1905
+ # @option opts [Float] :min_memory_gi_b Minimum memory in GiB
1906
+ # @option opts [Float] :max_memory_gi_b Maximum memory in GiB
1907
+ # @option opts [Float] :min_disk_gi_b Minimum disk space in GiB
1908
+ # @option opts [Float] :max_disk_gi_b Maximum disk space in GiB
1909
+ # @option opts [Time] :last_event_after Include items with last event after this timestamp
1910
+ # @option opts [Time] :last_event_before Include items with last event before this timestamp
1911
+ # @option opts [String] :sort Field to sort by (default to 'createdAt')
1912
+ # @option opts [String] :order Direction to sort by (default to 'desc')
1913
+ # @return [Array<(PaginatedSandboxesDeprecated, Integer, Hash)>] PaginatedSandboxesDeprecated data, response status code and response headers
1914
+ def list_sandboxes_paginated_deprecated_with_http_info(opts = {})
1915
+ if @api_client.config.debugging
1916
+ @api_client.config.logger.debug 'Calling API: SandboxApi.list_sandboxes_paginated_deprecated ...'
1917
+ end
1918
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
1919
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling SandboxApi.list_sandboxes_paginated_deprecated, must be greater than or equal to 1.'
1920
+ end
1921
+
1922
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 200
1923
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SandboxApi.list_sandboxes_paginated_deprecated, must be smaller than or equal to 200.'
1924
+ end
1925
+
1926
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
1927
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SandboxApi.list_sandboxes_paginated_deprecated, must be greater than or equal to 1.'
1928
+ end
1929
+
1930
+ allowable_values = ["creating", "restoring", "destroying", "started", "stopped", "starting", "stopping", "error", "build_failed", "pending_build", "building_snapshot", "unknown", "pulling_snapshot", "archived", "archiving", "resizing", "snapshotting", "forking", "pausing", "paused", "resuming", "unknown_default_open_api"]
1931
+ if @api_client.config.client_side_validation && opts[:'states'] && !opts[:'states'].all? { |item| allowable_values.include?(item) }
1932
+ fail ArgumentError, "invalid value for \"states\", must include one of #{allowable_values}"
1933
+ end
1934
+ if @api_client.config.client_side_validation && !opts[:'min_cpu'].nil? && opts[:'min_cpu'] < 1
1935
+ fail ArgumentError, 'invalid value for "opts[:"min_cpu"]" when calling SandboxApi.list_sandboxes_paginated_deprecated, must be greater than or equal to 1.'
1936
+ end
1937
+
1938
+ if @api_client.config.client_side_validation && !opts[:'max_cpu'].nil? && opts[:'max_cpu'] < 1
1939
+ fail ArgumentError, 'invalid value for "opts[:"max_cpu"]" when calling SandboxApi.list_sandboxes_paginated_deprecated, must be greater than or equal to 1.'
1940
+ end
1941
+
1942
+ if @api_client.config.client_side_validation && !opts[:'min_memory_gi_b'].nil? && opts[:'min_memory_gi_b'] < 1
1943
+ fail ArgumentError, 'invalid value for "opts[:"min_memory_gi_b"]" when calling SandboxApi.list_sandboxes_paginated_deprecated, must be greater than or equal to 1.'
1944
+ end
1945
+
1946
+ if @api_client.config.client_side_validation && !opts[:'max_memory_gi_b'].nil? && opts[:'max_memory_gi_b'] < 1
1947
+ fail ArgumentError, 'invalid value for "opts[:"max_memory_gi_b"]" when calling SandboxApi.list_sandboxes_paginated_deprecated, must be greater than or equal to 1.'
1948
+ end
1949
+
1950
+ if @api_client.config.client_side_validation && !opts[:'min_disk_gi_b'].nil? && opts[:'min_disk_gi_b'] < 1
1951
+ fail ArgumentError, 'invalid value for "opts[:"min_disk_gi_b"]" when calling SandboxApi.list_sandboxes_paginated_deprecated, must be greater than or equal to 1.'
1952
+ end
1953
+
1954
+ if @api_client.config.client_side_validation && !opts[:'max_disk_gi_b'].nil? && opts[:'max_disk_gi_b'] < 1
1955
+ fail ArgumentError, 'invalid value for "opts[:"max_disk_gi_b"]" when calling SandboxApi.list_sandboxes_paginated_deprecated, must be greater than or equal to 1.'
1956
+ end
1957
+
1958
+ allowable_values = ["id", "name", "state", "snapshot", "region", "updatedAt", "createdAt", "lastActivityAt", "unknown_default_open_api"]
1959
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
1960
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
1961
+ end
1962
+ allowable_values = ["asc", "desc", "unknown_default_open_api"]
1963
+ if @api_client.config.client_side_validation && opts[:'order'] && !allowable_values.include?(opts[:'order'])
1964
+ fail ArgumentError, "invalid value for \"order\", must be one of #{allowable_values}"
1965
+ end
1966
+ # resource path
1967
+ local_var_path = '/sandbox/paginated'
1968
+
1969
+ # query parameters
1970
+ query_params = opts[:query_params] || {}
1971
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
1972
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1973
+ query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?
1974
+ query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
1975
+ query_params[:'labels'] = opts[:'labels'] if !opts[:'labels'].nil?
1976
+ query_params[:'includeErroredDeleted'] = opts[:'include_errored_deleted'] if !opts[:'include_errored_deleted'].nil?
1977
+ query_params[:'states'] = @api_client.build_collection_param(opts[:'states'], :multi) if !opts[:'states'].nil?
1978
+ query_params[:'snapshots'] = @api_client.build_collection_param(opts[:'snapshots'], :multi) if !opts[:'snapshots'].nil?
1979
+ query_params[:'regions'] = @api_client.build_collection_param(opts[:'regions'], :multi) if !opts[:'regions'].nil?
1980
+ query_params[:'minCpu'] = opts[:'min_cpu'] if !opts[:'min_cpu'].nil?
1981
+ query_params[:'maxCpu'] = opts[:'max_cpu'] if !opts[:'max_cpu'].nil?
1982
+ query_params[:'minMemoryGiB'] = opts[:'min_memory_gi_b'] if !opts[:'min_memory_gi_b'].nil?
1983
+ query_params[:'maxMemoryGiB'] = opts[:'max_memory_gi_b'] if !opts[:'max_memory_gi_b'].nil?
1984
+ query_params[:'minDiskGiB'] = opts[:'min_disk_gi_b'] if !opts[:'min_disk_gi_b'].nil?
1985
+ query_params[:'maxDiskGiB'] = opts[:'max_disk_gi_b'] if !opts[:'max_disk_gi_b'].nil?
1986
+ query_params[:'lastEventAfter'] = opts[:'last_event_after'] if !opts[:'last_event_after'].nil?
1987
+ query_params[:'lastEventBefore'] = opts[:'last_event_before'] if !opts[:'last_event_before'].nil?
1988
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
1989
+ query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
1990
+
1991
+ # header parameters
1992
+ header_params = opts[:header_params] || {}
1993
+ # HTTP header 'Accept' (if needed)
1994
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1995
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
1996
+
1997
+ # form parameters
1998
+ form_params = opts[:form_params] || {}
1999
+
2000
+ # http body (model)
2001
+ post_body = opts[:debug_body]
2002
+
2003
+ # return_type
2004
+ return_type = opts[:debug_return_type] || 'PaginatedSandboxesDeprecated'
2005
+
2006
+ # auth_names
2007
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
2008
+
2009
+ new_options = opts.merge(
2010
+ :operation => :"SandboxApi.list_sandboxes_paginated_deprecated",
2011
+ :header_params => header_params,
2012
+ :query_params => query_params,
2013
+ :form_params => form_params,
2014
+ :body => post_body,
2015
+ :auth_names => auth_names,
2016
+ :return_type => return_type
2017
+ )
2018
+
2019
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2020
+ if @api_client.config.debugging
2021
+ @api_client.config.logger.debug "API called: SandboxApi#list_sandboxes_paginated_deprecated\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2022
+ end
2023
+ return data, status_code, headers
2024
+ end
2025
+
2026
+ # Pause sandbox
2027
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
2028
+ # @param [Hash] opts the optional parameters
2029
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
2030
+ # @return [Sandbox]
2031
+ def pause_sandbox(sandbox_id_or_name, opts = {})
2032
+ data, _status_code, _headers = pause_sandbox_with_http_info(sandbox_id_or_name, opts)
2033
+ data
2034
+ end
2035
+
2036
+ # Pause sandbox
2037
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
2038
+ # @param [Hash] opts the optional parameters
2039
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
2040
+ # @return [Array<(Sandbox, Integer, Hash)>] Sandbox data, response status code and response headers
2041
+ def pause_sandbox_with_http_info(sandbox_id_or_name, opts = {})
2042
+ if @api_client.config.debugging
2043
+ @api_client.config.logger.debug 'Calling API: SandboxApi.pause_sandbox ...'
2044
+ end
2045
+ # verify the required parameter 'sandbox_id_or_name' is set
2046
+ if @api_client.config.client_side_validation && sandbox_id_or_name.nil?
2047
+ fail ArgumentError, "Missing the required parameter 'sandbox_id_or_name' when calling SandboxApi.pause_sandbox"
2048
+ end
2049
+ # resource path
2050
+ local_var_path = '/sandbox/{sandboxIdOrName}/pause'.sub('{' + 'sandboxIdOrName' + '}', CGI.escape(sandbox_id_or_name.to_s))
2051
+
2052
+ # query parameters
2053
+ query_params = opts[:query_params] || {}
2054
+
2055
+ # header parameters
2056
+ header_params = opts[:header_params] || {}
2057
+ # HTTP header 'Accept' (if needed)
2058
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2059
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
2060
+
2061
+ # form parameters
2062
+ form_params = opts[:form_params] || {}
2063
+
2064
+ # http body (model)
2065
+ post_body = opts[:debug_body]
2066
+
2067
+ # return_type
2068
+ return_type = opts[:debug_return_type] || 'Sandbox'
2069
+
2070
+ # auth_names
2071
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
2072
+
2073
+ new_options = opts.merge(
2074
+ :operation => :"SandboxApi.pause_sandbox",
2075
+ :header_params => header_params,
2076
+ :query_params => query_params,
2077
+ :form_params => form_params,
2078
+ :body => post_body,
2079
+ :auth_names => auth_names,
2080
+ :return_type => return_type
2081
+ )
2082
+
2083
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
2084
+ if @api_client.config.debugging
2085
+ @api_client.config.logger.debug "API called: SandboxApi#pause_sandbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2086
+ end
2087
+ return data, status_code, headers
2088
+ end
2089
+
2090
+ # Recover sandbox from error state
2091
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
2092
+ # @param [Hash] opts the optional parameters
2093
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
2094
+ # @option opts [Boolean] :skip_start If true, the sandbox is left in STOPPED after recovery instead of being started.
2095
+ # @return [Sandbox]
2096
+ def recover_sandbox(sandbox_id_or_name, opts = {})
2097
+ data, _status_code, _headers = recover_sandbox_with_http_info(sandbox_id_or_name, opts)
2098
+ data
2099
+ end
2100
+
2101
+ # Recover sandbox from error state
2102
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
2103
+ # @param [Hash] opts the optional parameters
2104
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
2105
+ # @option opts [Boolean] :skip_start If true, the sandbox is left in STOPPED after recovery instead of being started.
2106
+ # @return [Array<(Sandbox, Integer, Hash)>] Sandbox data, response status code and response headers
2107
+ def recover_sandbox_with_http_info(sandbox_id_or_name, opts = {})
2108
+ if @api_client.config.debugging
2109
+ @api_client.config.logger.debug 'Calling API: SandboxApi.recover_sandbox ...'
2110
+ end
2111
+ # verify the required parameter 'sandbox_id_or_name' is set
2112
+ if @api_client.config.client_side_validation && sandbox_id_or_name.nil?
2113
+ fail ArgumentError, "Missing the required parameter 'sandbox_id_or_name' when calling SandboxApi.recover_sandbox"
2114
+ end
2115
+ # resource path
2116
+ local_var_path = '/sandbox/{sandboxIdOrName}/recover'.sub('{' + 'sandboxIdOrName' + '}', CGI.escape(sandbox_id_or_name.to_s))
2117
+
2118
+ # query parameters
2119
+ query_params = opts[:query_params] || {}
2120
+ query_params[:'skipStart'] = opts[:'skip_start'] if !opts[:'skip_start'].nil?
2121
+
2122
+ # header parameters
2123
+ header_params = opts[:header_params] || {}
2124
+ # HTTP header 'Accept' (if needed)
2125
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2126
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
2127
+
2128
+ # form parameters
2129
+ form_params = opts[:form_params] || {}
2130
+
2131
+ # http body (model)
2132
+ post_body = opts[:debug_body]
2133
+
2134
+ # return_type
2135
+ return_type = opts[:debug_return_type] || 'Sandbox'
2136
+
2137
+ # auth_names
2138
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
2139
+
2140
+ new_options = opts.merge(
2141
+ :operation => :"SandboxApi.recover_sandbox",
2142
+ :header_params => header_params,
2143
+ :query_params => query_params,
2144
+ :form_params => form_params,
2145
+ :body => post_body,
2146
+ :auth_names => auth_names,
2147
+ :return_type => return_type
2148
+ )
2149
+
2150
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
2151
+ if @api_client.config.debugging
2152
+ @api_client.config.logger.debug "API called: SandboxApi#recover_sandbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2153
+ end
2154
+ return data, status_code, headers
2155
+ end
2156
+
2157
+ # Replace sandbox labels
2158
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
2159
+ # @param sandbox_labels [SandboxLabels]
2160
+ # @param [Hash] opts the optional parameters
2161
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
2162
+ # @return [SandboxLabels]
2163
+ def replace_labels(sandbox_id_or_name, sandbox_labels, opts = {})
2164
+ data, _status_code, _headers = replace_labels_with_http_info(sandbox_id_or_name, sandbox_labels, opts)
2165
+ data
2166
+ end
2167
+
2168
+ # Replace sandbox labels
2169
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
2170
+ # @param sandbox_labels [SandboxLabels]
2171
+ # @param [Hash] opts the optional parameters
2172
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
2173
+ # @return [Array<(SandboxLabels, Integer, Hash)>] SandboxLabels data, response status code and response headers
2174
+ def replace_labels_with_http_info(sandbox_id_or_name, sandbox_labels, opts = {})
2175
+ if @api_client.config.debugging
2176
+ @api_client.config.logger.debug 'Calling API: SandboxApi.replace_labels ...'
2177
+ end
2178
+ # verify the required parameter 'sandbox_id_or_name' is set
2179
+ if @api_client.config.client_side_validation && sandbox_id_or_name.nil?
2180
+ fail ArgumentError, "Missing the required parameter 'sandbox_id_or_name' when calling SandboxApi.replace_labels"
2181
+ end
2182
+ # verify the required parameter 'sandbox_labels' is set
2183
+ if @api_client.config.client_side_validation && sandbox_labels.nil?
2184
+ fail ArgumentError, "Missing the required parameter 'sandbox_labels' when calling SandboxApi.replace_labels"
2185
+ end
2186
+ # resource path
2187
+ local_var_path = '/sandbox/{sandboxIdOrName}/labels'.sub('{' + 'sandboxIdOrName' + '}', CGI.escape(sandbox_id_or_name.to_s))
2188
+
2189
+ # query parameters
2190
+ query_params = opts[:query_params] || {}
2191
+
2192
+ # header parameters
2193
+ header_params = opts[:header_params] || {}
2194
+ # HTTP header 'Accept' (if needed)
2195
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2196
+ # HTTP header 'Content-Type'
2197
+ content_type = @api_client.select_header_content_type(['application/json'])
2198
+ if !content_type.nil?
2199
+ header_params['Content-Type'] = content_type
2200
+ end
2201
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
2202
+
2203
+ # form parameters
2204
+ form_params = opts[:form_params] || {}
2205
+
2206
+ # http body (model)
2207
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(sandbox_labels)
2208
+
2209
+ # return_type
2210
+ return_type = opts[:debug_return_type] || 'SandboxLabels'
2211
+
2212
+ # auth_names
2213
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
2214
+
2215
+ new_options = opts.merge(
2216
+ :operation => :"SandboxApi.replace_labels",
2217
+ :header_params => header_params,
2218
+ :query_params => query_params,
2219
+ :form_params => form_params,
2220
+ :body => post_body,
2221
+ :auth_names => auth_names,
2222
+ :return_type => return_type
2223
+ )
2224
+
2225
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
2226
+ if @api_client.config.debugging
2227
+ @api_client.config.logger.debug "API called: SandboxApi#replace_labels\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2228
+ end
2229
+ return data, status_code, headers
2230
+ end
2231
+
2232
+ # Resize sandbox resources
2233
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
2234
+ # @param resize_sandbox [ResizeSandbox]
2235
+ # @param [Hash] opts the optional parameters
2236
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
2237
+ # @return [Sandbox]
2238
+ def resize_sandbox(sandbox_id_or_name, resize_sandbox, opts = {})
2239
+ data, _status_code, _headers = resize_sandbox_with_http_info(sandbox_id_or_name, resize_sandbox, opts)
2240
+ data
2241
+ end
2242
+
2243
+ # Resize sandbox resources
2244
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
2245
+ # @param resize_sandbox [ResizeSandbox]
2246
+ # @param [Hash] opts the optional parameters
2247
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
2248
+ # @return [Array<(Sandbox, Integer, Hash)>] Sandbox data, response status code and response headers
2249
+ def resize_sandbox_with_http_info(sandbox_id_or_name, resize_sandbox, opts = {})
2250
+ if @api_client.config.debugging
2251
+ @api_client.config.logger.debug 'Calling API: SandboxApi.resize_sandbox ...'
2252
+ end
2253
+ # verify the required parameter 'sandbox_id_or_name' is set
2254
+ if @api_client.config.client_side_validation && sandbox_id_or_name.nil?
2255
+ fail ArgumentError, "Missing the required parameter 'sandbox_id_or_name' when calling SandboxApi.resize_sandbox"
2256
+ end
2257
+ # verify the required parameter 'resize_sandbox' is set
2258
+ if @api_client.config.client_side_validation && resize_sandbox.nil?
2259
+ fail ArgumentError, "Missing the required parameter 'resize_sandbox' when calling SandboxApi.resize_sandbox"
2260
+ end
2261
+ # resource path
2262
+ local_var_path = '/sandbox/{sandboxIdOrName}/resize'.sub('{' + 'sandboxIdOrName' + '}', CGI.escape(sandbox_id_or_name.to_s))
2263
+
2264
+ # query parameters
2265
+ query_params = opts[:query_params] || {}
2266
+
2267
+ # header parameters
2268
+ header_params = opts[:header_params] || {}
2269
+ # HTTP header 'Accept' (if needed)
2270
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2271
+ # HTTP header 'Content-Type'
2272
+ content_type = @api_client.select_header_content_type(['application/json'])
2273
+ if !content_type.nil?
2274
+ header_params['Content-Type'] = content_type
2275
+ end
2276
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
2277
+
2278
+ # form parameters
2279
+ form_params = opts[:form_params] || {}
2280
+
2281
+ # http body (model)
2282
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(resize_sandbox)
2283
+
2284
+ # return_type
2285
+ return_type = opts[:debug_return_type] || 'Sandbox'
2286
+
2287
+ # auth_names
2288
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
2289
+
2290
+ new_options = opts.merge(
2291
+ :operation => :"SandboxApi.resize_sandbox",
2292
+ :header_params => header_params,
2293
+ :query_params => query_params,
2294
+ :form_params => form_params,
2295
+ :body => post_body,
2296
+ :auth_names => auth_names,
2297
+ :return_type => return_type
2298
+ )
2299
+
2300
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
2301
+ if @api_client.config.debugging
2302
+ @api_client.config.logger.debug "API called: SandboxApi#resize_sandbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2303
+ end
2304
+ return data, status_code, headers
2305
+ end
2306
+
2307
+ # Revoke SSH access for sandbox
2308
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
2309
+ # @param [Hash] opts the optional parameters
2310
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
2311
+ # @option opts [String] :token SSH access token to revoke. If not provided, all SSH access for the sandbox will be revoked.
2312
+ # @return [Sandbox]
2313
+ def revoke_ssh_access(sandbox_id_or_name, opts = {})
2314
+ data, _status_code, _headers = revoke_ssh_access_with_http_info(sandbox_id_or_name, opts)
2315
+ data
2316
+ end
2317
+
2318
+ # Revoke SSH access for sandbox
2319
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
2320
+ # @param [Hash] opts the optional parameters
2321
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
2322
+ # @option opts [String] :token SSH access token to revoke. If not provided, all SSH access for the sandbox will be revoked.
2323
+ # @return [Array<(Sandbox, Integer, Hash)>] Sandbox data, response status code and response headers
2324
+ def revoke_ssh_access_with_http_info(sandbox_id_or_name, opts = {})
2325
+ if @api_client.config.debugging
2326
+ @api_client.config.logger.debug 'Calling API: SandboxApi.revoke_ssh_access ...'
2327
+ end
2328
+ # verify the required parameter 'sandbox_id_or_name' is set
2329
+ if @api_client.config.client_side_validation && sandbox_id_or_name.nil?
2330
+ fail ArgumentError, "Missing the required parameter 'sandbox_id_or_name' when calling SandboxApi.revoke_ssh_access"
2331
+ end
2332
+ # resource path
2333
+ local_var_path = '/sandbox/{sandboxIdOrName}/ssh-access'.sub('{' + 'sandboxIdOrName' + '}', CGI.escape(sandbox_id_or_name.to_s))
2334
+
2335
+ # query parameters
2336
+ query_params = opts[:query_params] || {}
2337
+ query_params[:'token'] = opts[:'token'] if !opts[:'token'].nil?
2338
+
2339
+ # header parameters
2340
+ header_params = opts[:header_params] || {}
2341
+ # HTTP header 'Accept' (if needed)
2342
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2343
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
2344
+
2345
+ # form parameters
2346
+ form_params = opts[:form_params] || {}
2347
+
2348
+ # http body (model)
2349
+ post_body = opts[:debug_body]
2350
+
2351
+ # return_type
2352
+ return_type = opts[:debug_return_type] || 'Sandbox'
2353
+
2354
+ # auth_names
2355
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
2356
+
2357
+ new_options = opts.merge(
2358
+ :operation => :"SandboxApi.revoke_ssh_access",
2359
+ :header_params => header_params,
2360
+ :query_params => query_params,
2361
+ :form_params => form_params,
2362
+ :body => post_body,
2363
+ :auth_names => auth_names,
2364
+ :return_type => return_type
2365
+ )
2366
+
2367
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
2368
+ if @api_client.config.debugging
2369
+ @api_client.config.logger.debug "API called: SandboxApi#revoke_ssh_access\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2370
+ end
2371
+ return data, status_code, headers
2372
+ end
2373
+
2374
+ # Set sandbox auto-archive interval
2375
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
2376
+ # @param interval [Float] Auto-archive interval in minutes (0 means the maximum interval will be used)
2377
+ # @param [Hash] opts the optional parameters
2378
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
2379
+ # @return [Sandbox]
2380
+ def set_auto_archive_interval(sandbox_id_or_name, interval, opts = {})
2381
+ data, _status_code, _headers = set_auto_archive_interval_with_http_info(sandbox_id_or_name, interval, opts)
2382
+ data
2383
+ end
2384
+
2385
+ # Set sandbox auto-archive interval
2386
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
2387
+ # @param interval [Float] Auto-archive interval in minutes (0 means the maximum interval will be used)
2388
+ # @param [Hash] opts the optional parameters
2389
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
2390
+ # @return [Array<(Sandbox, Integer, Hash)>] Sandbox data, response status code and response headers
2391
+ def set_auto_archive_interval_with_http_info(sandbox_id_or_name, interval, opts = {})
2392
+ if @api_client.config.debugging
2393
+ @api_client.config.logger.debug 'Calling API: SandboxApi.set_auto_archive_interval ...'
2394
+ end
2395
+ # verify the required parameter 'sandbox_id_or_name' is set
2396
+ if @api_client.config.client_side_validation && sandbox_id_or_name.nil?
2397
+ fail ArgumentError, "Missing the required parameter 'sandbox_id_or_name' when calling SandboxApi.set_auto_archive_interval"
2398
+ end
2399
+ # verify the required parameter 'interval' is set
2400
+ if @api_client.config.client_side_validation && interval.nil?
2401
+ fail ArgumentError, "Missing the required parameter 'interval' when calling SandboxApi.set_auto_archive_interval"
2402
+ end
2403
+ # resource path
2404
+ local_var_path = '/sandbox/{sandboxIdOrName}/autoarchive/{interval}'.sub('{' + 'sandboxIdOrName' + '}', CGI.escape(sandbox_id_or_name.to_s)).sub('{' + 'interval' + '}', CGI.escape(interval.to_s))
2405
+
2406
+ # query parameters
2407
+ query_params = opts[:query_params] || {}
2408
+
2409
+ # header parameters
2410
+ header_params = opts[:header_params] || {}
2411
+ # HTTP header 'Accept' (if needed)
2412
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2413
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
2414
+
2415
+ # form parameters
2416
+ form_params = opts[:form_params] || {}
2417
+
2418
+ # http body (model)
2419
+ post_body = opts[:debug_body]
2420
+
2421
+ # return_type
2422
+ return_type = opts[:debug_return_type] || 'Sandbox'
2423
+
2424
+ # auth_names
2425
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
2426
+
2427
+ new_options = opts.merge(
2428
+ :operation => :"SandboxApi.set_auto_archive_interval",
2429
+ :header_params => header_params,
2430
+ :query_params => query_params,
2431
+ :form_params => form_params,
2432
+ :body => post_body,
2433
+ :auth_names => auth_names,
2434
+ :return_type => return_type
2435
+ )
2436
+
2437
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
2438
+ if @api_client.config.debugging
2439
+ @api_client.config.logger.debug "API called: SandboxApi#set_auto_archive_interval\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2440
+ end
2441
+ return data, status_code, headers
2442
+ end
2443
+
2444
+ # Set sandbox auto-delete interval
2445
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
2446
+ # @param interval [Float] Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)
2447
+ # @param [Hash] opts the optional parameters
2448
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
2449
+ # @return [Sandbox]
2450
+ def set_auto_delete_interval(sandbox_id_or_name, interval, opts = {})
2451
+ data, _status_code, _headers = set_auto_delete_interval_with_http_info(sandbox_id_or_name, interval, opts)
2452
+ data
2453
+ end
2454
+
2455
+ # Set sandbox auto-delete interval
2456
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
2457
+ # @param interval [Float] Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)
2458
+ # @param [Hash] opts the optional parameters
2459
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
2460
+ # @return [Array<(Sandbox, Integer, Hash)>] Sandbox data, response status code and response headers
2461
+ def set_auto_delete_interval_with_http_info(sandbox_id_or_name, interval, opts = {})
2462
+ if @api_client.config.debugging
2463
+ @api_client.config.logger.debug 'Calling API: SandboxApi.set_auto_delete_interval ...'
2464
+ end
2465
+ # verify the required parameter 'sandbox_id_or_name' is set
2466
+ if @api_client.config.client_side_validation && sandbox_id_or_name.nil?
2467
+ fail ArgumentError, "Missing the required parameter 'sandbox_id_or_name' when calling SandboxApi.set_auto_delete_interval"
2468
+ end
2469
+ # verify the required parameter 'interval' is set
2470
+ if @api_client.config.client_side_validation && interval.nil?
2471
+ fail ArgumentError, "Missing the required parameter 'interval' when calling SandboxApi.set_auto_delete_interval"
2472
+ end
2473
+ # resource path
2474
+ local_var_path = '/sandbox/{sandboxIdOrName}/autodelete/{interval}'.sub('{' + 'sandboxIdOrName' + '}', CGI.escape(sandbox_id_or_name.to_s)).sub('{' + 'interval' + '}', CGI.escape(interval.to_s))
2475
+
2476
+ # query parameters
2477
+ query_params = opts[:query_params] || {}
2478
+
2479
+ # header parameters
2480
+ header_params = opts[:header_params] || {}
2481
+ # HTTP header 'Accept' (if needed)
2482
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2483
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
2484
+
2485
+ # form parameters
2486
+ form_params = opts[:form_params] || {}
2487
+
2488
+ # http body (model)
2489
+ post_body = opts[:debug_body]
2490
+
2491
+ # return_type
2492
+ return_type = opts[:debug_return_type] || 'Sandbox'
2493
+
2494
+ # auth_names
2495
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
2496
+
2497
+ new_options = opts.merge(
2498
+ :operation => :"SandboxApi.set_auto_delete_interval",
2499
+ :header_params => header_params,
2500
+ :query_params => query_params,
2501
+ :form_params => form_params,
2502
+ :body => post_body,
2503
+ :auth_names => auth_names,
2504
+ :return_type => return_type
2505
+ )
2506
+
2507
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
2508
+ if @api_client.config.debugging
2509
+ @api_client.config.logger.debug "API called: SandboxApi#set_auto_delete_interval\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2510
+ end
2511
+ return data, status_code, headers
2512
+ end
2513
+
2514
+ # Set sandbox auto-stop interval
2515
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
2516
+ # @param interval [Float] Auto-stop interval in minutes (0 to disable)
2517
+ # @param [Hash] opts the optional parameters
2518
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
2519
+ # @return [Sandbox]
2520
+ def set_autostop_interval(sandbox_id_or_name, interval, opts = {})
2521
+ data, _status_code, _headers = set_autostop_interval_with_http_info(sandbox_id_or_name, interval, opts)
2522
+ data
2523
+ end
2524
+
2525
+ # Set sandbox auto-stop interval
2526
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
2527
+ # @param interval [Float] Auto-stop interval in minutes (0 to disable)
2528
+ # @param [Hash] opts the optional parameters
2529
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
2530
+ # @return [Array<(Sandbox, Integer, Hash)>] Sandbox data, response status code and response headers
2531
+ def set_autostop_interval_with_http_info(sandbox_id_or_name, interval, opts = {})
2532
+ if @api_client.config.debugging
2533
+ @api_client.config.logger.debug 'Calling API: SandboxApi.set_autostop_interval ...'
2534
+ end
2535
+ # verify the required parameter 'sandbox_id_or_name' is set
2536
+ if @api_client.config.client_side_validation && sandbox_id_or_name.nil?
2537
+ fail ArgumentError, "Missing the required parameter 'sandbox_id_or_name' when calling SandboxApi.set_autostop_interval"
2538
+ end
2539
+ # verify the required parameter 'interval' is set
2540
+ if @api_client.config.client_side_validation && interval.nil?
2541
+ fail ArgumentError, "Missing the required parameter 'interval' when calling SandboxApi.set_autostop_interval"
2542
+ end
2543
+ # resource path
2544
+ local_var_path = '/sandbox/{sandboxIdOrName}/autostop/{interval}'.sub('{' + 'sandboxIdOrName' + '}', CGI.escape(sandbox_id_or_name.to_s)).sub('{' + 'interval' + '}', CGI.escape(interval.to_s))
2545
+
2546
+ # query parameters
2547
+ query_params = opts[:query_params] || {}
2548
+
2549
+ # header parameters
2550
+ header_params = opts[:header_params] || {}
2551
+ # HTTP header 'Accept' (if needed)
2552
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2553
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
2554
+
2555
+ # form parameters
2556
+ form_params = opts[:form_params] || {}
2557
+
2558
+ # http body (model)
2559
+ post_body = opts[:debug_body]
2560
+
2561
+ # return_type
2562
+ return_type = opts[:debug_return_type] || 'Sandbox'
2563
+
2564
+ # auth_names
2565
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
2566
+
2567
+ new_options = opts.merge(
2568
+ :operation => :"SandboxApi.set_autostop_interval",
2569
+ :header_params => header_params,
2570
+ :query_params => query_params,
2571
+ :form_params => form_params,
2572
+ :body => post_body,
2573
+ :auth_names => auth_names,
2574
+ :return_type => return_type
2575
+ )
2576
+
2577
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
2578
+ if @api_client.config.debugging
2579
+ @api_client.config.logger.debug "API called: SandboxApi#set_autostop_interval\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2580
+ end
2581
+ return data, status_code, headers
2582
+ end
2583
+
2584
+ # Start or resume sandbox
2585
+ # Starts a stopped or archived sandbox, or resumes a paused sandbox. The transition taken depends on the current sandbox state.
2586
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
2587
+ # @param [Hash] opts the optional parameters
2588
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
2589
+ # @return [Sandbox]
2590
+ def start_sandbox(sandbox_id_or_name, opts = {})
2591
+ data, _status_code, _headers = start_sandbox_with_http_info(sandbox_id_or_name, opts)
2592
+ data
2593
+ end
2594
+
2595
+ # Start or resume sandbox
2596
+ # Starts a stopped or archived sandbox, or resumes a paused sandbox. The transition taken depends on the current sandbox state.
2597
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
2598
+ # @param [Hash] opts the optional parameters
2599
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
2600
+ # @return [Array<(Sandbox, Integer, Hash)>] Sandbox data, response status code and response headers
2601
+ def start_sandbox_with_http_info(sandbox_id_or_name, opts = {})
2602
+ if @api_client.config.debugging
2603
+ @api_client.config.logger.debug 'Calling API: SandboxApi.start_sandbox ...'
2604
+ end
2605
+ # verify the required parameter 'sandbox_id_or_name' is set
2606
+ if @api_client.config.client_side_validation && sandbox_id_or_name.nil?
2607
+ fail ArgumentError, "Missing the required parameter 'sandbox_id_or_name' when calling SandboxApi.start_sandbox"
2608
+ end
2609
+ # resource path
2610
+ local_var_path = '/sandbox/{sandboxIdOrName}/start'.sub('{' + 'sandboxIdOrName' + '}', CGI.escape(sandbox_id_or_name.to_s))
2611
+
2612
+ # query parameters
2613
+ query_params = opts[:query_params] || {}
2614
+
2615
+ # header parameters
2616
+ header_params = opts[:header_params] || {}
2617
+ # HTTP header 'Accept' (if needed)
2618
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2619
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
2620
+
2621
+ # form parameters
2622
+ form_params = opts[:form_params] || {}
2623
+
2624
+ # http body (model)
2625
+ post_body = opts[:debug_body]
2626
+
2627
+ # return_type
2628
+ return_type = opts[:debug_return_type] || 'Sandbox'
2629
+
2630
+ # auth_names
2631
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
2632
+
2633
+ new_options = opts.merge(
2634
+ :operation => :"SandboxApi.start_sandbox",
2635
+ :header_params => header_params,
2636
+ :query_params => query_params,
2637
+ :form_params => form_params,
2638
+ :body => post_body,
2639
+ :auth_names => auth_names,
2640
+ :return_type => return_type
2641
+ )
2642
+
2643
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
2644
+ if @api_client.config.debugging
2645
+ @api_client.config.logger.debug "API called: SandboxApi#start_sandbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2646
+ end
2647
+ return data, status_code, headers
2648
+ end
2649
+
2650
+ # Stop sandbox
2651
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
2652
+ # @param [Hash] opts the optional parameters
2653
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
2654
+ # @option opts [Boolean] :force Force stop the sandbox using SIGKILL instead of SIGTERM
2655
+ # @return [Sandbox]
2656
+ def stop_sandbox(sandbox_id_or_name, opts = {})
2657
+ data, _status_code, _headers = stop_sandbox_with_http_info(sandbox_id_or_name, opts)
2658
+ data
2659
+ end
2660
+
2661
+ # Stop sandbox
2662
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
2663
+ # @param [Hash] opts the optional parameters
2664
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
2665
+ # @option opts [Boolean] :force Force stop the sandbox using SIGKILL instead of SIGTERM
2666
+ # @return [Array<(Sandbox, Integer, Hash)>] Sandbox data, response status code and response headers
2667
+ def stop_sandbox_with_http_info(sandbox_id_or_name, opts = {})
2668
+ if @api_client.config.debugging
2669
+ @api_client.config.logger.debug 'Calling API: SandboxApi.stop_sandbox ...'
2670
+ end
2671
+ # verify the required parameter 'sandbox_id_or_name' is set
2672
+ if @api_client.config.client_side_validation && sandbox_id_or_name.nil?
2673
+ fail ArgumentError, "Missing the required parameter 'sandbox_id_or_name' when calling SandboxApi.stop_sandbox"
2674
+ end
2675
+ # resource path
2676
+ local_var_path = '/sandbox/{sandboxIdOrName}/stop'.sub('{' + 'sandboxIdOrName' + '}', CGI.escape(sandbox_id_or_name.to_s))
2677
+
2678
+ # query parameters
2679
+ query_params = opts[:query_params] || {}
2680
+ query_params[:'force'] = opts[:'force'] if !opts[:'force'].nil?
2681
+
2682
+ # header parameters
2683
+ header_params = opts[:header_params] || {}
2684
+ # HTTP header 'Accept' (if needed)
2685
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2686
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
2687
+
2688
+ # form parameters
2689
+ form_params = opts[:form_params] || {}
2690
+
2691
+ # http body (model)
2692
+ post_body = opts[:debug_body]
2693
+
2694
+ # return_type
2695
+ return_type = opts[:debug_return_type] || 'Sandbox'
2696
+
2697
+ # auth_names
2698
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
2699
+
2700
+ new_options = opts.merge(
2701
+ :operation => :"SandboxApi.stop_sandbox",
2702
+ :header_params => header_params,
2703
+ :query_params => query_params,
2704
+ :form_params => form_params,
2705
+ :body => post_body,
2706
+ :auth_names => auth_names,
2707
+ :return_type => return_type
2708
+ )
2709
+
2710
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
2711
+ if @api_client.config.debugging
2712
+ @api_client.config.logger.debug "API called: SandboxApi#stop_sandbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2713
+ end
2714
+ return data, status_code, headers
2715
+ end
2716
+
2717
+ # Update sandbox last activity
2718
+ # @param sandbox_id [String] ID of the sandbox
2719
+ # @param [Hash] opts the optional parameters
2720
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
2721
+ # @return [nil]
2722
+ def update_last_activity(sandbox_id, opts = {})
2723
+ update_last_activity_with_http_info(sandbox_id, opts)
2724
+ nil
2725
+ end
2726
+
2727
+ # Update sandbox last activity
2728
+ # @param sandbox_id [String] ID of the sandbox
2729
+ # @param [Hash] opts the optional parameters
2730
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
2731
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
2732
+ def update_last_activity_with_http_info(sandbox_id, opts = {})
2733
+ if @api_client.config.debugging
2734
+ @api_client.config.logger.debug 'Calling API: SandboxApi.update_last_activity ...'
2735
+ end
2736
+ # verify the required parameter 'sandbox_id' is set
2737
+ if @api_client.config.client_side_validation && sandbox_id.nil?
2738
+ fail ArgumentError, "Missing the required parameter 'sandbox_id' when calling SandboxApi.update_last_activity"
2739
+ end
2740
+ # resource path
2741
+ local_var_path = '/sandbox/{sandboxId}/last-activity'.sub('{' + 'sandboxId' + '}', CGI.escape(sandbox_id.to_s))
2742
+
2743
+ # query parameters
2744
+ query_params = opts[:query_params] || {}
2745
+
2746
+ # header parameters
2747
+ header_params = opts[:header_params] || {}
2748
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
2749
+
2750
+ # form parameters
2751
+ form_params = opts[:form_params] || {}
2752
+
2753
+ # http body (model)
2754
+ post_body = opts[:debug_body]
2755
+
2756
+ # return_type
2757
+ return_type = opts[:debug_return_type]
2758
+
2759
+ # auth_names
2760
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
2761
+
2762
+ new_options = opts.merge(
2763
+ :operation => :"SandboxApi.update_last_activity",
2764
+ :header_params => header_params,
2765
+ :query_params => query_params,
2766
+ :form_params => form_params,
2767
+ :body => post_body,
2768
+ :auth_names => auth_names,
2769
+ :return_type => return_type
2770
+ )
2771
+
2772
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
2773
+ if @api_client.config.debugging
2774
+ @api_client.config.logger.debug "API called: SandboxApi#update_last_activity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2775
+ end
2776
+ return data, status_code, headers
2777
+ end
2778
+
2779
+ # Update sandbox network settings
2780
+ # Changes outbound network policy on the runner for a running sandbox (for example block all traffic, restore access, or set a CIDR allow list).
2781
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
2782
+ # @param update_sandbox_network_settings [UpdateSandboxNetworkSettings]
2783
+ # @param [Hash] opts the optional parameters
2784
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
2785
+ # @return [Sandbox]
2786
+ def update_network_settings(sandbox_id_or_name, update_sandbox_network_settings, opts = {})
2787
+ data, _status_code, _headers = update_network_settings_with_http_info(sandbox_id_or_name, update_sandbox_network_settings, opts)
2788
+ data
2789
+ end
2790
+
2791
+ # Update sandbox network settings
2792
+ # Changes outbound network policy on the runner for a running sandbox (for example block all traffic, restore access, or set a CIDR allow list).
2793
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
2794
+ # @param update_sandbox_network_settings [UpdateSandboxNetworkSettings]
2795
+ # @param [Hash] opts the optional parameters
2796
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
2797
+ # @return [Array<(Sandbox, Integer, Hash)>] Sandbox data, response status code and response headers
2798
+ def update_network_settings_with_http_info(sandbox_id_or_name, update_sandbox_network_settings, opts = {})
2799
+ if @api_client.config.debugging
2800
+ @api_client.config.logger.debug 'Calling API: SandboxApi.update_network_settings ...'
2801
+ end
2802
+ # verify the required parameter 'sandbox_id_or_name' is set
2803
+ if @api_client.config.client_side_validation && sandbox_id_or_name.nil?
2804
+ fail ArgumentError, "Missing the required parameter 'sandbox_id_or_name' when calling SandboxApi.update_network_settings"
2805
+ end
2806
+ # verify the required parameter 'update_sandbox_network_settings' is set
2807
+ if @api_client.config.client_side_validation && update_sandbox_network_settings.nil?
2808
+ fail ArgumentError, "Missing the required parameter 'update_sandbox_network_settings' when calling SandboxApi.update_network_settings"
2809
+ end
2810
+ # resource path
2811
+ local_var_path = '/sandbox/{sandboxIdOrName}/network-settings'.sub('{' + 'sandboxIdOrName' + '}', CGI.escape(sandbox_id_or_name.to_s))
2812
+
2813
+ # query parameters
2814
+ query_params = opts[:query_params] || {}
2815
+
2816
+ # header parameters
2817
+ header_params = opts[:header_params] || {}
2818
+ # HTTP header 'Accept' (if needed)
2819
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2820
+ # HTTP header 'Content-Type'
2821
+ content_type = @api_client.select_header_content_type(['application/json'])
2822
+ if !content_type.nil?
2823
+ header_params['Content-Type'] = content_type
2824
+ end
2825
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
2826
+
2827
+ # form parameters
2828
+ form_params = opts[:form_params] || {}
2829
+
2830
+ # http body (model)
2831
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_sandbox_network_settings)
2832
+
2833
+ # return_type
2834
+ return_type = opts[:debug_return_type] || 'Sandbox'
2835
+
2836
+ # auth_names
2837
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
2838
+
2839
+ new_options = opts.merge(
2840
+ :operation => :"SandboxApi.update_network_settings",
2841
+ :header_params => header_params,
2842
+ :query_params => query_params,
2843
+ :form_params => form_params,
2844
+ :body => post_body,
2845
+ :auth_names => auth_names,
2846
+ :return_type => return_type
2847
+ )
2848
+
2849
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
2850
+ if @api_client.config.debugging
2851
+ @api_client.config.logger.debug "API called: SandboxApi#update_network_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2852
+ end
2853
+ return data, status_code, headers
2854
+ end
2855
+
2856
+ # Update public status
2857
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
2858
+ # @param is_public [Boolean] Public status to set
2859
+ # @param [Hash] opts the optional parameters
2860
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
2861
+ # @return [Sandbox]
2862
+ def update_public_status(sandbox_id_or_name, is_public, opts = {})
2863
+ data, _status_code, _headers = update_public_status_with_http_info(sandbox_id_or_name, is_public, opts)
2864
+ data
2865
+ end
2866
+
2867
+ # Update public status
2868
+ # @param sandbox_id_or_name [String] ID or name of the sandbox
2869
+ # @param is_public [Boolean] Public status to set
2870
+ # @param [Hash] opts the optional parameters
2871
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
2872
+ # @return [Array<(Sandbox, Integer, Hash)>] Sandbox data, response status code and response headers
2873
+ def update_public_status_with_http_info(sandbox_id_or_name, is_public, opts = {})
2874
+ if @api_client.config.debugging
2875
+ @api_client.config.logger.debug 'Calling API: SandboxApi.update_public_status ...'
2876
+ end
2877
+ # verify the required parameter 'sandbox_id_or_name' is set
2878
+ if @api_client.config.client_side_validation && sandbox_id_or_name.nil?
2879
+ fail ArgumentError, "Missing the required parameter 'sandbox_id_or_name' when calling SandboxApi.update_public_status"
2880
+ end
2881
+ # verify the required parameter 'is_public' is set
2882
+ if @api_client.config.client_side_validation && is_public.nil?
2883
+ fail ArgumentError, "Missing the required parameter 'is_public' when calling SandboxApi.update_public_status"
2884
+ end
2885
+ # resource path
2886
+ local_var_path = '/sandbox/{sandboxIdOrName}/public/{isPublic}'.sub('{' + 'sandboxIdOrName' + '}', CGI.escape(sandbox_id_or_name.to_s)).sub('{' + 'isPublic' + '}', CGI.escape(is_public.to_s))
2887
+
2888
+ # query parameters
2889
+ query_params = opts[:query_params] || {}
2890
+
2891
+ # header parameters
2892
+ header_params = opts[:header_params] || {}
2893
+ # HTTP header 'Accept' (if needed)
2894
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2895
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
2896
+
2897
+ # form parameters
2898
+ form_params = opts[:form_params] || {}
2899
+
2900
+ # http body (model)
2901
+ post_body = opts[:debug_body]
2902
+
2903
+ # return_type
2904
+ return_type = opts[:debug_return_type] || 'Sandbox'
2905
+
2906
+ # auth_names
2907
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
2908
+
2909
+ new_options = opts.merge(
2910
+ :operation => :"SandboxApi.update_public_status",
2911
+ :header_params => header_params,
2912
+ :query_params => query_params,
2913
+ :form_params => form_params,
2914
+ :body => post_body,
2915
+ :auth_names => auth_names,
2916
+ :return_type => return_type
2917
+ )
2918
+
2919
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
2920
+ if @api_client.config.debugging
2921
+ @api_client.config.logger.debug "API called: SandboxApi#update_public_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2922
+ end
2923
+ return data, status_code, headers
2924
+ end
2925
+
2926
+ # Update sandbox state
2927
+ # @param sandbox_id [String] ID of the sandbox
2928
+ # @param update_sandbox_state_dto [UpdateSandboxStateDto]
2929
+ # @param [Hash] opts the optional parameters
2930
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
2931
+ # @return [nil]
2932
+ def update_sandbox_state(sandbox_id, update_sandbox_state_dto, opts = {})
2933
+ update_sandbox_state_with_http_info(sandbox_id, update_sandbox_state_dto, opts)
2934
+ nil
2935
+ end
2936
+
2937
+ # Update sandbox state
2938
+ # @param sandbox_id [String] ID of the sandbox
2939
+ # @param update_sandbox_state_dto [UpdateSandboxStateDto]
2940
+ # @param [Hash] opts the optional parameters
2941
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
2942
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
2943
+ def update_sandbox_state_with_http_info(sandbox_id, update_sandbox_state_dto, opts = {})
2944
+ if @api_client.config.debugging
2945
+ @api_client.config.logger.debug 'Calling API: SandboxApi.update_sandbox_state ...'
2946
+ end
2947
+ # verify the required parameter 'sandbox_id' is set
2948
+ if @api_client.config.client_side_validation && sandbox_id.nil?
2949
+ fail ArgumentError, "Missing the required parameter 'sandbox_id' when calling SandboxApi.update_sandbox_state"
2950
+ end
2951
+ # verify the required parameter 'update_sandbox_state_dto' is set
2952
+ if @api_client.config.client_side_validation && update_sandbox_state_dto.nil?
2953
+ fail ArgumentError, "Missing the required parameter 'update_sandbox_state_dto' when calling SandboxApi.update_sandbox_state"
2954
+ end
2955
+ # resource path
2956
+ local_var_path = '/sandbox/{sandboxId}/state'.sub('{' + 'sandboxId' + '}', CGI.escape(sandbox_id.to_s))
2957
+
2958
+ # query parameters
2959
+ query_params = opts[:query_params] || {}
2960
+
2961
+ # header parameters
2962
+ header_params = opts[:header_params] || {}
2963
+ # HTTP header 'Content-Type'
2964
+ content_type = @api_client.select_header_content_type(['application/json'])
2965
+ if !content_type.nil?
2966
+ header_params['Content-Type'] = content_type
2967
+ end
2968
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
2969
+
2970
+ # form parameters
2971
+ form_params = opts[:form_params] || {}
2972
+
2973
+ # http body (model)
2974
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_sandbox_state_dto)
2975
+
2976
+ # return_type
2977
+ return_type = opts[:debug_return_type]
2978
+
2979
+ # auth_names
2980
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
2981
+
2982
+ new_options = opts.merge(
2983
+ :operation => :"SandboxApi.update_sandbox_state",
2984
+ :header_params => header_params,
2985
+ :query_params => query_params,
2986
+ :form_params => form_params,
2987
+ :body => post_body,
2988
+ :auth_names => auth_names,
2989
+ :return_type => return_type
2990
+ )
2991
+
2992
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
2993
+ if @api_client.config.debugging
2994
+ @api_client.config.logger.debug "API called: SandboxApi#update_sandbox_state\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2995
+ end
2996
+ return data, status_code, headers
2997
+ end
2998
+
2999
+ # Validate SSH access for sandbox
3000
+ # @param token [String] SSH access token to validate
3001
+ # @param [Hash] opts the optional parameters
3002
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
3003
+ # @return [SshAccessValidationDto]
3004
+ def validate_ssh_access(token, opts = {})
3005
+ data, _status_code, _headers = validate_ssh_access_with_http_info(token, opts)
3006
+ data
3007
+ end
3008
+
3009
+ # Validate SSH access for sandbox
3010
+ # @param token [String] SSH access token to validate
3011
+ # @param [Hash] opts the optional parameters
3012
+ # @option opts [String] :x_nightona_organization_id Use with JWT to specify the organization ID
3013
+ # @return [Array<(SshAccessValidationDto, Integer, Hash)>] SshAccessValidationDto data, response status code and response headers
3014
+ def validate_ssh_access_with_http_info(token, opts = {})
3015
+ if @api_client.config.debugging
3016
+ @api_client.config.logger.debug 'Calling API: SandboxApi.validate_ssh_access ...'
3017
+ end
3018
+ # verify the required parameter 'token' is set
3019
+ if @api_client.config.client_side_validation && token.nil?
3020
+ fail ArgumentError, "Missing the required parameter 'token' when calling SandboxApi.validate_ssh_access"
3021
+ end
3022
+ # resource path
3023
+ local_var_path = '/sandbox/ssh-access/validate'
3024
+
3025
+ # query parameters
3026
+ query_params = opts[:query_params] || {}
3027
+ query_params[:'token'] = token
3028
+
3029
+ # header parameters
3030
+ header_params = opts[:header_params] || {}
3031
+ # HTTP header 'Accept' (if needed)
3032
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
3033
+ header_params[:'X-Nightona-Organization-ID'] = opts[:'x_nightona_organization_id'] if !opts[:'x_nightona_organization_id'].nil?
3034
+
3035
+ # form parameters
3036
+ form_params = opts[:form_params] || {}
3037
+
3038
+ # http body (model)
3039
+ post_body = opts[:debug_body]
3040
+
3041
+ # return_type
3042
+ return_type = opts[:debug_return_type] || 'SshAccessValidationDto'
3043
+
3044
+ # auth_names
3045
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
3046
+
3047
+ new_options = opts.merge(
3048
+ :operation => :"SandboxApi.validate_ssh_access",
3049
+ :header_params => header_params,
3050
+ :query_params => query_params,
3051
+ :form_params => form_params,
3052
+ :body => post_body,
3053
+ :auth_names => auth_names,
3054
+ :return_type => return_type
3055
+ )
3056
+
3057
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
3058
+ if @api_client.config.debugging
3059
+ @api_client.config.logger.debug "API called: SandboxApi#validate_ssh_access\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3060
+ end
3061
+ return data, status_code, headers
3062
+ end
3063
+ end
3064
+ end