Class: DaytonaApiClient::SnapshotsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/daytona_api_client/api/snapshots_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ SnapshotsApi

Returns a new instance of SnapshotsApi.



19
20
21
# File 'lib/daytona_api_client/api/snapshots_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/daytona_api_client/api/snapshots_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#activate_snapshot(id, opts = {}) ⇒ SnapshotDto

Activate a snapshot

Parameters:

  • id (String)

    Snapshot ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_daytona_organization_id (String)

    Use with JWT to specify the organization ID

Returns:



27
28
29
30
# File 'lib/daytona_api_client/api/snapshots_api.rb', line 27

def activate_snapshot(id, opts = {})
  data, _status_code, _headers = activate_snapshot_with_http_info(id, opts)
  data
end

#activate_snapshot_with_http_info(id, opts = {}) ⇒ Array<(SnapshotDto, Integer, Hash)>

Activate a snapshot

Parameters:

  • id (String)

    Snapshot ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_daytona_organization_id (String)

    Use with JWT to specify the organization ID

Returns:

  • (Array<(SnapshotDto, Integer, Hash)>)

    SnapshotDto data, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/daytona_api_client/api/snapshots_api.rb', line 37

def activate_snapshot_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SnapshotsApi.activate_snapshot ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling SnapshotsApi.activate_snapshot"
  end
  # resource path
  local_var_path = '/snapshots/{id}/activate'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SnapshotDto'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']

  new_options = opts.merge(
    :operation => :"SnapshotsApi.activate_snapshot",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SnapshotsApi#activate_snapshot\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#can_cleanup_image(image_name, opts = {}) ⇒ Boolean

Check if an image can be cleaned up

Parameters:

  • image_name (String)

    Image name with tag to check

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_daytona_organization_id (String)

    Use with JWT to specify the organization ID

Returns:

  • (Boolean)


91
92
93
94
# File 'lib/daytona_api_client/api/snapshots_api.rb', line 91

def can_cleanup_image(image_name, opts = {})
  data, _status_code, _headers = can_cleanup_image_with_http_info(image_name, opts)
  data
end

#can_cleanup_image_with_http_info(image_name, opts = {}) ⇒ Array<(Boolean, Integer, Hash)>

Check if an image can be cleaned up

Parameters:

  • image_name (String)

    Image name with tag to check

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_daytona_organization_id (String)

    Use with JWT to specify the organization ID

Returns:

  • (Array<(Boolean, Integer, Hash)>)

    Boolean data, response status code and response headers



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/daytona_api_client/api/snapshots_api.rb', line 101

def can_cleanup_image_with_http_info(image_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SnapshotsApi.can_cleanup_image ...'
  end
  # verify the required parameter 'image_name' is set
  if @api_client.config.client_side_validation && image_name.nil?
    fail ArgumentError, "Missing the required parameter 'image_name' when calling SnapshotsApi.can_cleanup_image"
  end
  # resource path
  local_var_path = '/snapshots/can-cleanup-image'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'imageName'] = image_name

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Boolean'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']

  new_options = opts.merge(
    :operation => :"SnapshotsApi.can_cleanup_image",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SnapshotsApi#can_cleanup_image\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_snapshot(create_snapshot, opts = {}) ⇒ SnapshotDto

Create a new snapshot

Parameters:

  • create_snapshot (CreateSnapshot)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_daytona_organization_id (String)

    Use with JWT to specify the organization ID

Returns:



156
157
158
159
# File 'lib/daytona_api_client/api/snapshots_api.rb', line 156

def create_snapshot(create_snapshot, opts = {})
  data, _status_code, _headers = create_snapshot_with_http_info(create_snapshot, opts)
  data
end

#create_snapshot_with_http_info(create_snapshot, opts = {}) ⇒ Array<(SnapshotDto, Integer, Hash)>

Create a new snapshot

Parameters:

  • create_snapshot (CreateSnapshot)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_daytona_organization_id (String)

    Use with JWT to specify the organization ID

Returns:

  • (Array<(SnapshotDto, Integer, Hash)>)

    SnapshotDto data, response status code and response headers



166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# File 'lib/daytona_api_client/api/snapshots_api.rb', line 166

def create_snapshot_with_http_info(create_snapshot, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SnapshotsApi.create_snapshot ...'
  end
  # verify the required parameter 'create_snapshot' is set
  if @api_client.config.client_side_validation && create_snapshot.nil?
    fail ArgumentError, "Missing the required parameter 'create_snapshot' when calling SnapshotsApi.create_snapshot"
  end
  # resource path
  local_var_path = '/snapshots'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end
  header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_snapshot)

  # return_type
  return_type = opts[:debug_return_type] || 'SnapshotDto'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']

  new_options = opts.merge(
    :operation => :"SnapshotsApi.create_snapshot",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SnapshotsApi#create_snapshot\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#deactivate_snapshot(id, opts = {}) ⇒ nil

Deactivate a snapshot

Parameters:

  • id (String)

    Snapshot ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_daytona_organization_id (String)

    Use with JWT to specify the organization ID

Returns:

  • (nil)


225
226
227
228
# File 'lib/daytona_api_client/api/snapshots_api.rb', line 225

def deactivate_snapshot(id, opts = {})
  deactivate_snapshot_with_http_info(id, opts)
  nil
end

#deactivate_snapshot_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Deactivate a snapshot

Parameters:

  • id (String)

    Snapshot ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_daytona_organization_id (String)

    Use with JWT to specify the organization ID

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
# File 'lib/daytona_api_client/api/snapshots_api.rb', line 235

def deactivate_snapshot_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SnapshotsApi.deactivate_snapshot ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling SnapshotsApi.deactivate_snapshot"
  end
  # resource path
  local_var_path = '/snapshots/{id}/deactivate'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']

  new_options = opts.merge(
    :operation => :"SnapshotsApi.deactivate_snapshot",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SnapshotsApi#deactivate_snapshot\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_all_snapshots(opts = {}) ⇒ PaginatedSnapshots

List all snapshots

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_daytona_organization_id (String)

    Use with JWT to specify the organization ID

  • :page (Float)

    Page number of the results (default to 1)

  • :limit (Float)

    Number of results per page (default to 100)

  • :name (String)

    Filter by partial name match

  • :sort (String)

    Field to sort by (default to ‘lastUsedAt’)

  • :order (String)

    Direction to sort by (default to ‘desc’)

Returns:



291
292
293
294
# File 'lib/daytona_api_client/api/snapshots_api.rb', line 291

def get_all_snapshots(opts = {})
  data, _status_code, _headers = get_all_snapshots_with_http_info(opts)
  data
end

#get_all_snapshots_with_http_info(opts = {}) ⇒ Array<(PaginatedSnapshots, Integer, Hash)>

List all snapshots

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_daytona_organization_id (String)

    Use with JWT to specify the organization ID

  • :page (Float)

    Page number of the results (default to 1)

  • :limit (Float)

    Number of results per page (default to 100)

  • :name (String)

    Filter by partial name match

  • :sort (String)

    Field to sort by (default to ‘lastUsedAt’)

  • :order (String)

    Direction to sort by (default to ‘desc’)

Returns:

  • (Array<(PaginatedSnapshots, Integer, Hash)>)

    PaginatedSnapshots data, response status code and response headers



305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
# File 'lib/daytona_api_client/api/snapshots_api.rb', line 305

def get_all_snapshots_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SnapshotsApi.get_all_snapshots ...'
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling SnapshotsApi.get_all_snapshots, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 200
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SnapshotsApi.get_all_snapshots, must be smaller than or equal to 200.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SnapshotsApi.get_all_snapshots, must be greater than or equal to 1.'
  end

  allowable_values = ["name", "state", "lastUsedAt", "createdAt"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  allowable_values = ["asc", "desc"]
  if @api_client.config.client_side_validation && opts[:'order'] && !allowable_values.include?(opts[:'order'])
    fail ArgumentError, "invalid value for \"order\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/snapshots'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'PaginatedSnapshots'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']

  new_options = opts.merge(
    :operation => :"SnapshotsApi.get_all_snapshots",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SnapshotsApi#get_all_snapshots\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_snapshot(id, opts = {}) ⇒ SnapshotDto

Get snapshot by ID or name

Parameters:

  • id (String)

    Snapshot ID or name

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_daytona_organization_id (String)

    Use with JWT to specify the organization ID

Returns:



380
381
382
383
# File 'lib/daytona_api_client/api/snapshots_api.rb', line 380

def get_snapshot(id, opts = {})
  data, _status_code, _headers = get_snapshot_with_http_info(id, opts)
  data
end

#get_snapshot_build_logs(id, opts = {}) ⇒ nil

Get snapshot build logs

Parameters:

  • id (String)

    Snapshot ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_daytona_organization_id (String)

    Use with JWT to specify the organization ID

  • :follow (Boolean)

    Whether to follow the logs stream

Returns:

  • (nil)


445
446
447
448
# File 'lib/daytona_api_client/api/snapshots_api.rb', line 445

def get_snapshot_build_logs(id, opts = {})
  get_snapshot_build_logs_with_http_info(id, opts)
  nil
end

#get_snapshot_build_logs_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Get snapshot build logs

Parameters:

  • id (String)

    Snapshot ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_daytona_organization_id (String)

    Use with JWT to specify the organization ID

  • :follow (Boolean)

    Whether to follow the logs stream

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
# File 'lib/daytona_api_client/api/snapshots_api.rb', line 456

def get_snapshot_build_logs_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SnapshotsApi.get_snapshot_build_logs ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling SnapshotsApi.get_snapshot_build_logs"
  end
  # resource path
  local_var_path = '/snapshots/{id}/build-logs'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'follow'] = opts[:'follow'] if !opts[:'follow'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']

  new_options = opts.merge(
    :operation => :"SnapshotsApi.get_snapshot_build_logs",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SnapshotsApi#get_snapshot_build_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_snapshot_with_http_info(id, opts = {}) ⇒ Array<(SnapshotDto, Integer, Hash)>

Get snapshot by ID or name

Parameters:

  • id (String)

    Snapshot ID or name

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_daytona_organization_id (String)

    Use with JWT to specify the organization ID

Returns:

  • (Array<(SnapshotDto, Integer, Hash)>)

    SnapshotDto data, response status code and response headers



390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
# File 'lib/daytona_api_client/api/snapshots_api.rb', line 390

def get_snapshot_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SnapshotsApi.get_snapshot ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling SnapshotsApi.get_snapshot"
  end
  # resource path
  local_var_path = '/snapshots/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SnapshotDto'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']

  new_options = opts.merge(
    :operation => :"SnapshotsApi.get_snapshot",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SnapshotsApi#get_snapshot\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#remove_snapshot(id, opts = {}) ⇒ nil

Delete snapshot

Parameters:

  • id (String)

    Snapshot ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_daytona_organization_id (String)

    Use with JWT to specify the organization ID

Returns:

  • (nil)


509
510
511
512
# File 'lib/daytona_api_client/api/snapshots_api.rb', line 509

def remove_snapshot(id, opts = {})
  remove_snapshot_with_http_info(id, opts)
  nil
end

#remove_snapshot_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete snapshot

Parameters:

  • id (String)

    Snapshot ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_daytona_organization_id (String)

    Use with JWT to specify the organization ID

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
# File 'lib/daytona_api_client/api/snapshots_api.rb', line 519

def remove_snapshot_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SnapshotsApi.remove_snapshot ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling SnapshotsApi.remove_snapshot"
  end
  # resource path
  local_var_path = '/snapshots/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']

  new_options = opts.merge(
    :operation => :"SnapshotsApi.remove_snapshot",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SnapshotsApi#remove_snapshot\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#set_snapshot_general_status(id, set_snapshot_general_status_dto, opts = {}) ⇒ SnapshotDto

Set snapshot general status

Parameters:

  • id (String)

    Snapshot ID

  • set_snapshot_general_status_dto (SetSnapshotGeneralStatusDto)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_daytona_organization_id (String)

    Use with JWT to specify the organization ID

Returns:



572
573
574
575
# File 'lib/daytona_api_client/api/snapshots_api.rb', line 572

def set_snapshot_general_status(id, set_snapshot_general_status_dto, opts = {})
  data, _status_code, _headers = set_snapshot_general_status_with_http_info(id, set_snapshot_general_status_dto, opts)
  data
end

#set_snapshot_general_status_with_http_info(id, set_snapshot_general_status_dto, opts = {}) ⇒ Array<(SnapshotDto, Integer, Hash)>

Set snapshot general status

Parameters:

  • id (String)

    Snapshot ID

  • set_snapshot_general_status_dto (SetSnapshotGeneralStatusDto)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_daytona_organization_id (String)

    Use with JWT to specify the organization ID

Returns:

  • (Array<(SnapshotDto, Integer, Hash)>)

    SnapshotDto data, response status code and response headers



583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
# File 'lib/daytona_api_client/api/snapshots_api.rb', line 583

def set_snapshot_general_status_with_http_info(id, set_snapshot_general_status_dto, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SnapshotsApi.set_snapshot_general_status ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling SnapshotsApi.set_snapshot_general_status"
  end
  # verify the required parameter 'set_snapshot_general_status_dto' is set
  if @api_client.config.client_side_validation && set_snapshot_general_status_dto.nil?
    fail ArgumentError, "Missing the required parameter 'set_snapshot_general_status_dto' when calling SnapshotsApi.set_snapshot_general_status"
  end
  # resource path
  local_var_path = '/snapshots/{id}/general'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end
  header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(set_snapshot_general_status_dto)

  # return_type
  return_type = opts[:debug_return_type] || 'SnapshotDto'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']

  new_options = opts.merge(
    :operation => :"SnapshotsApi.set_snapshot_general_status",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SnapshotsApi#set_snapshot_general_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end