unikraft-cloud 0.1.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 (50) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.md +28 -0
  3. data/README.md +587 -0
  4. data/lib/unikraft/cloud/api/controlplane/auth.gen.rb +83 -0
  5. data/lib/unikraft/cloud/api/controlplane/images.gen.rb +51 -0
  6. data/lib/unikraft/cloud/api/controlplane/metros.gen.rb +45 -0
  7. data/lib/unikraft/cloud/api/controlplane/models.gen.rb +865 -0
  8. data/lib/unikraft/cloud/api/controlplane/node_activation_service.gen.rb +79 -0
  9. data/lib/unikraft/cloud/api/controlplane/node_service.gen.rb +276 -0
  10. data/lib/unikraft/cloud/api/controlplane/resources.gen.rb +12 -0
  11. data/lib/unikraft/cloud/api/controlplane.rb +49 -0
  12. data/lib/unikraft/cloud/api/platform/audit.gen.rb +55 -0
  13. data/lib/unikraft/cloud/api/platform/autoscale.gen.rb +231 -0
  14. data/lib/unikraft/cloud/api/platform/certificates.gen.rb +168 -0
  15. data/lib/unikraft/cloud/api/platform/images.gen.rb +109 -0
  16. data/lib/unikraft/cloud/api/platform/instances.gen.rb +873 -0
  17. data/lib/unikraft/cloud/api/platform/models.gen.rb +6456 -0
  18. data/lib/unikraft/cloud/api/platform/node.gen.rb +45 -0
  19. data/lib/unikraft/cloud/api/platform/resources.gen.rb +16 -0
  20. data/lib/unikraft/cloud/api/platform/services.gen.rb +172 -0
  21. data/lib/unikraft/cloud/api/platform/users.gen.rb +134 -0
  22. data/lib/unikraft/cloud/api/platform/volumes.gen.rb +430 -0
  23. data/lib/unikraft/cloud/api/platform.rb +64 -0
  24. data/lib/unikraft/cloud/api.rb +45 -0
  25. data/lib/unikraft/cloud/client.rb +186 -0
  26. data/lib/unikraft/cloud/core/base64.rb +36 -0
  27. data/lib/unikraft/cloud/core/errors.rb +96 -0
  28. data/lib/unikraft/cloud/core/fanout.rb +150 -0
  29. data/lib/unikraft/cloud/core/handle.rb +214 -0
  30. data/lib/unikraft/cloud/core/handle_set.rb +105 -0
  31. data/lib/unikraft/cloud/core/http.rb +361 -0
  32. data/lib/unikraft/cloud/core/metro.rb +75 -0
  33. data/lib/unikraft/cloud/core/pagination.rb +43 -0
  34. data/lib/unikraft/cloud/core/patch.rb +113 -0
  35. data/lib/unikraft/cloud/core/pool.rb +97 -0
  36. data/lib/unikraft/cloud/core/ready.rb +145 -0
  37. data/lib/unikraft/cloud/core/ref.rb +95 -0
  38. data/lib/unikraft/cloud/core/resource.rb +399 -0
  39. data/lib/unikraft/cloud/core/response.rb +96 -0
  40. data/lib/unikraft/cloud/core/session.rb +182 -0
  41. data/lib/unikraft/cloud/core/url.rb +34 -0
  42. data/lib/unikraft/cloud/model.rb +194 -0
  43. data/lib/unikraft/cloud/resources/certificates.rb +57 -0
  44. data/lib/unikraft/cloud/resources/instances.rb +172 -0
  45. data/lib/unikraft/cloud/resources/service_groups.rb +36 -0
  46. data/lib/unikraft/cloud/resources/users.rb +39 -0
  47. data/lib/unikraft/cloud/resources/volumes.rb +93 -0
  48. data/lib/unikraft/cloud/version.rb +11 -0
  49. data/lib/unikraft/cloud.rb +29 -0
  50. metadata +89 -0
@@ -0,0 +1,873 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Code generated by openapi-gen; DO NOT EDIT.
4
+
5
+ require_relative "../../core/url"
6
+ require_relative "models.gen"
7
+
8
+ module Unikraft
9
+ module Cloud
10
+ class API
11
+ class Platform
12
+ # Low-level "plumbing" client for the `instances` resource of the
13
+ # Platform API. Methods mirror the OpenAPI specification: they are
14
+ # named after the operationId and return the response envelope
15
+ # untouched.
16
+ class InstancesApi
17
+ # @return [#request, #bytes, #stream] the transport, usually a
18
+ # {Unikraft::Cloud::Core::ApiClient}
19
+ attr_reader :client
20
+
21
+ # @param client [#request, #bytes, #stream] the transport
22
+ def initialize(client)
23
+ @client = client
24
+ end
25
+
26
+ # Abort Instance Migration by UUID
27
+ #
28
+ # `PUT /v1/instances/{uuid}/migrate/abort`
29
+ #
30
+ # @param uuid [String]
31
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
32
+ # @return [Models::AbortInstanceMigrationsResponse, nil] the response envelope
33
+ # @raise [Unikraft::Cloud::Error]
34
+ def abort_instance_migration_by_uuid(uuid:, **options)
35
+ res = @client.request(
36
+ method: "PUT",
37
+ path: "/v1/instances/#{Core::URL.escape_segment(uuid)}/migrate/abort",
38
+ **options
39
+ )
40
+ Models::AbortInstanceMigrationsResponse.from(res)
41
+ end
42
+
43
+ # Abort Instance Migrations
44
+ #
45
+ # `PUT /v1/instances/migrate/abort`
46
+ #
47
+ # @param body [Hash, Array] the request body
48
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
49
+ # @return [Models::AbortInstanceMigrationsResponse, nil] the response envelope
50
+ # @raise [Unikraft::Cloud::Error]
51
+ def abort_instance_migrations(body:, **options)
52
+ res = @client.request(
53
+ method: "PUT",
54
+ path: "/v1/instances/migrate/abort",
55
+ body:,
56
+ **options
57
+ )
58
+ Models::AbortInstanceMigrationsResponse.from(res)
59
+ end
60
+
61
+ # Accept Instance Migrations
62
+ #
63
+ # `PUT /v1/instances/migrate/accept`
64
+ #
65
+ # @param body [Hash, Array, nil] the request body
66
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
67
+ # @return [Models::AcceptInstanceMigrationsResponse, nil] the response envelope
68
+ # @raise [Unikraft::Cloud::Error]
69
+ def accept_instance_migrations(body: nil, **options)
70
+ res = @client.request(
71
+ method: "PUT",
72
+ path: "/v1/instances/migrate/accept",
73
+ body:,
74
+ **options
75
+ )
76
+ Models::AcceptInstanceMigrationsResponse.from(res)
77
+ end
78
+
79
+ # Create Checkpoint Instances
80
+ #
81
+ # `POST /v1/instances/checkpoints`
82
+ #
83
+ # @param body [Hash, Array] the request body
84
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
85
+ # @return [Models::CreateCheckpointInstancesResponse, nil] the response envelope
86
+ # @raise [Unikraft::Cloud::Error]
87
+ def create_checkpoint_instances(body:, **options)
88
+ res = @client.request(
89
+ method: "POST",
90
+ path: "/v1/instances/checkpoints",
91
+ body:,
92
+ **options
93
+ )
94
+ Models::CreateCheckpointInstancesResponse.from(res)
95
+ end
96
+
97
+ # Create Instance
98
+ #
99
+ # `POST /v1/instances`
100
+ #
101
+ # @param body [Models::CreateInstanceRequest, Hash, Array] the request body
102
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
103
+ # @return [Models::CreateInstanceResponse, nil] the response envelope
104
+ # @raise [Unikraft::Cloud::Error]
105
+ def create_instance(body:, **options)
106
+ res = @client.request(
107
+ method: "POST",
108
+ path: "/v1/instances",
109
+ body:,
110
+ **options
111
+ )
112
+ Models::CreateInstanceResponse.from(res)
113
+ end
114
+
115
+ # Create template instances from Instances
116
+ #
117
+ # `POST /v1/instances/templates`
118
+ #
119
+ # @param body [Hash, Array] the request body
120
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
121
+ # @return [Models::CreateTemplateInstancesResponse, nil] the response envelope
122
+ # @raise [Unikraft::Cloud::Error]
123
+ def create_template_instances(body:, **options)
124
+ res = @client.request(
125
+ method: "POST",
126
+ path: "/v1/instances/templates",
127
+ body:,
128
+ **options
129
+ )
130
+ Models::CreateTemplateInstancesResponse.from(res)
131
+ end
132
+
133
+ # Delete Checkpoint Instance by UUID
134
+ #
135
+ # `DELETE /v1/instances/checkpoints/{uuid}`
136
+ #
137
+ # @param uuid [String]
138
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
139
+ # @return [Models::DeleteCheckpointInstancesResponse, nil] the response envelope
140
+ # @raise [Unikraft::Cloud::Error]
141
+ def delete_checkpoint_instance_by_uuid(uuid:, **options)
142
+ res = @client.request(
143
+ method: "DELETE",
144
+ path: "/v1/instances/checkpoints/#{Core::URL.escape_segment(uuid)}",
145
+ **options
146
+ )
147
+ Models::DeleteCheckpointInstancesResponse.from(res)
148
+ end
149
+
150
+ # Delete Checkpoint Instances
151
+ #
152
+ # `DELETE /v1/instances/checkpoints`
153
+ #
154
+ # @param body [Hash, Array] the request body
155
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
156
+ # @return [Models::DeleteCheckpointInstancesResponse, nil] the response envelope
157
+ # @raise [Unikraft::Cloud::Error]
158
+ def delete_checkpoint_instances(body:, **options)
159
+ res = @client.request(
160
+ method: "DELETE",
161
+ path: "/v1/instances/checkpoints",
162
+ body:,
163
+ **options
164
+ )
165
+ Models::DeleteCheckpointInstancesResponse.from(res)
166
+ end
167
+
168
+ # Delete Instance by UUID
169
+ #
170
+ # `DELETE /v1/instances/{uuid}`
171
+ #
172
+ # @param uuid [String]
173
+ # @param body [Models::DeleteInstanceByUUIDRequestBody, Hash, Array, nil] the request body
174
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
175
+ # @return [Models::DeleteInstancesResponse, nil] the response envelope
176
+ # @raise [Unikraft::Cloud::Error]
177
+ def delete_instance_by_uuid(uuid:, body: nil, **options)
178
+ res = @client.request(
179
+ method: "DELETE",
180
+ path: "/v1/instances/#{Core::URL.escape_segment(uuid)}",
181
+ body:,
182
+ **options
183
+ )
184
+ Models::DeleteInstancesResponse.from(res)
185
+ end
186
+
187
+ # Delete Instances
188
+ #
189
+ # `DELETE /v1/instances`
190
+ #
191
+ # @param body [Hash, Array] the request body
192
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
193
+ # @return [Models::DeleteInstancesResponse, nil] the response envelope
194
+ # @raise [Unikraft::Cloud::Error]
195
+ def delete_instances(body:, **options)
196
+ res = @client.request(
197
+ method: "DELETE",
198
+ path: "/v1/instances",
199
+ body:,
200
+ **options
201
+ )
202
+ Models::DeleteInstancesResponse.from(res)
203
+ end
204
+
205
+ # Delete template instance by UUID
206
+ #
207
+ # `DELETE /v1/instances/templates/{uuid}`
208
+ #
209
+ # @param uuid [String]
210
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
211
+ # @return [Models::DeleteTemplateInstancesResponse, nil] the response envelope
212
+ # @raise [Unikraft::Cloud::Error]
213
+ def delete_template_instance_by_uuid(uuid:, **options)
214
+ res = @client.request(
215
+ method: "DELETE",
216
+ path: "/v1/instances/templates/#{Core::URL.escape_segment(uuid)}",
217
+ **options
218
+ )
219
+ Models::DeleteTemplateInstancesResponse.from(res)
220
+ end
221
+
222
+ # Delete template instances
223
+ #
224
+ # `DELETE /v1/instances/templates`
225
+ #
226
+ # @param body [Hash, Array] the request body
227
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
228
+ # @return [Models::DeleteTemplateInstancesResponse, nil] the response envelope
229
+ # @raise [Unikraft::Cloud::Error]
230
+ def delete_template_instances(body:, **options)
231
+ res = @client.request(
232
+ method: "DELETE",
233
+ path: "/v1/instances/templates",
234
+ body:,
235
+ **options
236
+ )
237
+ Models::DeleteTemplateInstancesResponse.from(res)
238
+ end
239
+
240
+ # Get Checkpoint History
241
+ #
242
+ # `GET /v1/instances/checkpoints/history`
243
+ #
244
+ # @param uuid [Array<String>, nil] The UUID of the resource.
245
+ # @param name [Array<String>, nil] The name of the resource.
246
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
247
+ # @return [Models::GetCheckpointHistoryResponse, nil] the response envelope
248
+ # @raise [Unikraft::Cloud::Error]
249
+ def get_checkpoint_history(uuid: nil, name: nil, **options)
250
+ res = @client.request(
251
+ method: "GET",
252
+ path: "/v1/instances/checkpoints/history",
253
+ query: {
254
+ uuid:,
255
+ name:
256
+ },
257
+ **options
258
+ )
259
+ Models::GetCheckpointHistoryResponse.from(res)
260
+ end
261
+
262
+ # Get Checkpoint History by UUID
263
+ #
264
+ # `GET /v1/instances/checkpoints/{uuid}/history`
265
+ #
266
+ # @param uuid [String]
267
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
268
+ # @return [Models::GetCheckpointHistoryResponse, nil] the response envelope
269
+ # @raise [Unikraft::Cloud::Error]
270
+ def get_checkpoint_history_by_uuid(uuid:, **options)
271
+ res = @client.request(
272
+ method: "GET",
273
+ path: "/v1/instances/checkpoints/#{Core::URL.escape_segment(uuid)}/history",
274
+ **options
275
+ )
276
+ Models::GetCheckpointHistoryResponse.from(res)
277
+ end
278
+
279
+ # Get Checkpoint Instance by UUID
280
+ #
281
+ # `GET /v1/instances/checkpoints/{uuid}`
282
+ #
283
+ # @param uuid [String]
284
+ # @param details [Boolean, nil]
285
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
286
+ # @return [Models::GetCheckpointInstancesResponse, nil] the response envelope
287
+ # @raise [Unikraft::Cloud::Error]
288
+ def get_checkpoint_instance_by_uuid(uuid:, details: nil, **options)
289
+ res = @client.request(
290
+ method: "GET",
291
+ path: "/v1/instances/checkpoints/#{Core::URL.escape_segment(uuid)}",
292
+ query: {
293
+ details:
294
+ },
295
+ **options
296
+ )
297
+ Models::GetCheckpointInstancesResponse.from(res)
298
+ end
299
+
300
+ # List Checkpoint Instances
301
+ #
302
+ # `GET /v1/instances/checkpoints`
303
+ #
304
+ # @param uuid [Array<String>, nil] The UUID of the resource.
305
+ # @param name [Array<String>, nil] The name of the resource.
306
+ # @param details [Boolean, nil]
307
+ # @param count [Integer, nil]
308
+ # @param from [String, nil]
309
+ # @param order [String, nil]
310
+ # @param sortby [String, nil]
311
+ # @param tags [Array<String>, nil]
312
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
313
+ # @return [Models::GetCheckpointInstancesResponse, nil] the response envelope
314
+ # @raise [Unikraft::Cloud::Error]
315
+ def get_checkpoint_instances(uuid: nil, name: nil, details: nil, count: nil, from: nil, order: nil, sortby: nil, tags: nil, **options)
316
+ res = @client.request(
317
+ method: "GET",
318
+ path: "/v1/instances/checkpoints",
319
+ query: {
320
+ uuid:,
321
+ name:,
322
+ details:,
323
+ count:,
324
+ from:,
325
+ order:,
326
+ sortby:,
327
+ tags: tags&.join(",")
328
+ },
329
+ **options
330
+ )
331
+ Models::GetCheckpointInstancesResponse.from(res)
332
+ end
333
+
334
+ # Get Instance by UUID
335
+ #
336
+ # `GET /v1/instances/{uuid}`
337
+ #
338
+ # @param uuid [String]
339
+ # @param details [Boolean, nil]
340
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
341
+ # @return [Models::GetInstancesResponse, nil] the response envelope
342
+ # @raise [Unikraft::Cloud::Error]
343
+ def get_instance_by_uuid(uuid:, details: nil, **options)
344
+ res = @client.request(
345
+ method: "GET",
346
+ path: "/v1/instances/#{Core::URL.escape_segment(uuid)}",
347
+ query: {
348
+ details:
349
+ },
350
+ **options
351
+ )
352
+ Models::GetInstancesResponse.from(res)
353
+ end
354
+
355
+ # Get Instances Checkpoint History
356
+ #
357
+ # `GET /v1/instances/history`
358
+ #
359
+ # @param uuid [Array<String>, nil] The UUID of the resource.
360
+ # @param name [Array<String>, nil] The name of the resource.
361
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
362
+ # @return [Models::GetCheckpointHistoryResponse, nil] the response envelope
363
+ # @raise [Unikraft::Cloud::Error]
364
+ def get_instance_history(uuid: nil, name: nil, **options)
365
+ res = @client.request(
366
+ method: "GET",
367
+ path: "/v1/instances/history",
368
+ query: {
369
+ uuid:,
370
+ name:
371
+ },
372
+ **options
373
+ )
374
+ Models::GetCheckpointHistoryResponse.from(res)
375
+ end
376
+
377
+ # Get Instance Checkpoint History by UUID
378
+ #
379
+ # `GET /v1/instances/{uuid}/history`
380
+ #
381
+ # @param uuid [String]
382
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
383
+ # @return [Models::GetCheckpointHistoryResponse, nil] the response envelope
384
+ # @raise [Unikraft::Cloud::Error]
385
+ def get_instance_history_by_uuid(uuid:, **options)
386
+ res = @client.request(
387
+ method: "GET",
388
+ path: "/v1/instances/#{Core::URL.escape_segment(uuid)}/history",
389
+ **options
390
+ )
391
+ Models::GetCheckpointHistoryResponse.from(res)
392
+ end
393
+
394
+ # Get Instances Logs
395
+ #
396
+ # `GET /v1/instances/log`
397
+ #
398
+ # @param uuid [Array<String>, nil] The UUID of the resource.
399
+ # @param name [Array<String>, nil] The name of the resource.
400
+ # @param offset [Array<String>, nil] The byte offset of the log output to receive. A negative sign makes the
401
+ # offset relative to the end of the log.
402
+ # @param limit [Array<String>, nil] The amount of bytes to return at most.
403
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
404
+ # @return [Models::GetInstancesLogsResponse, nil] the response envelope
405
+ # @raise [Unikraft::Cloud::Error]
406
+ def get_instance_logs(uuid: nil, name: nil, offset: nil, limit: nil, **options)
407
+ res = @client.request(
408
+ method: "GET",
409
+ path: "/v1/instances/log",
410
+ query: {
411
+ uuid:,
412
+ name:,
413
+ offset:,
414
+ limit:
415
+ },
416
+ **options
417
+ )
418
+ Models::GetInstancesLogsResponse.from(res)
419
+ end
420
+
421
+ # Get Instance Logs by UUID
422
+ #
423
+ # `GET /v1/instances/{uuid}/log`
424
+ #
425
+ # @param uuid [String]
426
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
427
+ # @return [Models::GetInstancesLogsResponse, nil] the response envelope
428
+ # @raise [Unikraft::Cloud::Error]
429
+ def get_instance_logs_by_uuid(uuid:, **options)
430
+ res = @client.request(
431
+ method: "GET",
432
+ path: "/v1/instances/#{Core::URL.escape_segment(uuid)}/log",
433
+ **options
434
+ )
435
+ Models::GetInstancesLogsResponse.from(res)
436
+ end
437
+
438
+ # Get Instances Metrics
439
+ #
440
+ # `GET /v1/instances/metrics`
441
+ #
442
+ # @param uuid [Array<String>, nil] The UUID of the resource.
443
+ # @param name [Array<String>, nil] The name of the resource.
444
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
445
+ # @return [Models::GetInstancesMetricsResponse, nil] the response envelope
446
+ # @raise [Unikraft::Cloud::Error]
447
+ def get_instance_metrics(uuid: nil, name: nil, **options)
448
+ res = @client.request(
449
+ method: "GET",
450
+ path: "/v1/instances/metrics",
451
+ query: {
452
+ uuid:,
453
+ name:
454
+ },
455
+ **options
456
+ )
457
+ Models::GetInstancesMetricsResponse.from(res)
458
+ end
459
+
460
+ # Get Instance Metrics by UUID
461
+ #
462
+ # `GET /v1/instances/{uuid}/metrics`
463
+ #
464
+ # @param uuid [String]
465
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
466
+ # @return [Models::GetInstancesMetricsResponse, nil] the response envelope
467
+ # @raise [Unikraft::Cloud::Error]
468
+ def get_instance_metrics_by_uuid(uuid:, **options)
469
+ res = @client.request(
470
+ method: "GET",
471
+ path: "/v1/instances/#{Core::URL.escape_segment(uuid)}/metrics",
472
+ **options
473
+ )
474
+ Models::GetInstancesMetricsResponse.from(res)
475
+ end
476
+
477
+ # List Instances
478
+ #
479
+ # `GET /v1/instances`
480
+ #
481
+ # @param uuid [Array<String>, nil] The UUID of the resource.
482
+ # @param name [Array<String>, nil] The name of the resource.
483
+ # @param details [Boolean, nil]
484
+ # @param count [Integer, nil]
485
+ # @param from [String, nil]
486
+ # @param order [String, nil]
487
+ # @param sortby [String, nil]
488
+ # @param tags [Array<String>, nil]
489
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
490
+ # @return [Models::GetInstancesResponse, nil] the response envelope
491
+ # @raise [Unikraft::Cloud::Error]
492
+ def get_instances(uuid: nil, name: nil, details: nil, count: nil, from: nil, order: nil, sortby: nil, tags: nil, **options)
493
+ res = @client.request(
494
+ method: "GET",
495
+ path: "/v1/instances",
496
+ query: {
497
+ uuid:,
498
+ name:,
499
+ details:,
500
+ count:,
501
+ from:,
502
+ order:,
503
+ sortby:,
504
+ tags: tags&.join(",")
505
+ },
506
+ **options
507
+ )
508
+ Models::GetInstancesResponse.from(res)
509
+ end
510
+
511
+ # Get template instance by UUID
512
+ #
513
+ # `GET /v1/instances/templates/{uuid}`
514
+ #
515
+ # @param uuid [String]
516
+ # @param details [Boolean, nil]
517
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
518
+ # @return [Models::GetTemplateInstancesResponse, nil] the response envelope
519
+ # @raise [Unikraft::Cloud::Error]
520
+ def get_template_instance_by_uuid(uuid:, details: nil, **options)
521
+ res = @client.request(
522
+ method: "GET",
523
+ path: "/v1/instances/templates/#{Core::URL.escape_segment(uuid)}",
524
+ query: {
525
+ details:
526
+ },
527
+ **options
528
+ )
529
+ Models::GetTemplateInstancesResponse.from(res)
530
+ end
531
+
532
+ # List template instances
533
+ #
534
+ # `GET /v1/instances/templates`
535
+ #
536
+ # @param uuid [Array<String>, nil] The UUID of the resource.
537
+ # @param name [Array<String>, nil] The name of the resource.
538
+ # @param details [Boolean, nil]
539
+ # @param count [Integer, nil]
540
+ # @param from [String, nil]
541
+ # @param order [String, nil]
542
+ # @param sortby [String, nil]
543
+ # @param tags [Array<String>, nil]
544
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
545
+ # @return [Models::GetTemplateInstancesResponse, nil] the response envelope
546
+ # @raise [Unikraft::Cloud::Error]
547
+ def get_template_instances(uuid: nil, name: nil, details: nil, count: nil, from: nil, order: nil, sortby: nil, tags: nil, **options)
548
+ res = @client.request(
549
+ method: "GET",
550
+ path: "/v1/instances/templates",
551
+ query: {
552
+ uuid:,
553
+ name:,
554
+ details:,
555
+ count:,
556
+ from:,
557
+ order:,
558
+ sortby:,
559
+ tags: tags&.join(",")
560
+ },
561
+ **options
562
+ )
563
+ Models::GetTemplateInstancesResponse.from(res)
564
+ end
565
+
566
+ # Migrate Instance by UUID
567
+ #
568
+ # `PUT /v1/instances/{uuid}/migrate`
569
+ #
570
+ # @param uuid [String]
571
+ # @param body [Models::MigrateInstanceByUUIDRequestBody, Hash, Array] the request body
572
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
573
+ # @return [Models::MigrateInstancesResponse, nil] the response envelope
574
+ # @raise [Unikraft::Cloud::Error]
575
+ def migrate_instance_by_uuid(uuid:, body:, **options)
576
+ res = @client.request(
577
+ method: "PUT",
578
+ path: "/v1/instances/#{Core::URL.escape_segment(uuid)}/migrate",
579
+ body:,
580
+ **options
581
+ )
582
+ Models::MigrateInstancesResponse.from(res)
583
+ end
584
+
585
+ # Migrate Instances
586
+ #
587
+ # `PUT /v1/instances/migrate`
588
+ #
589
+ # @param body [Hash, Array] the request body
590
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
591
+ # @return [Models::MigrateInstancesResponse, nil] the response envelope
592
+ # @raise [Unikraft::Cloud::Error]
593
+ def migrate_instances(body:, **options)
594
+ res = @client.request(
595
+ method: "PUT",
596
+ path: "/v1/instances/migrate",
597
+ body:,
598
+ **options
599
+ )
600
+ Models::MigrateInstancesResponse.from(res)
601
+ end
602
+
603
+ # Start Instance by UUID
604
+ #
605
+ # `PUT /v1/instances/{uuid}/start`
606
+ #
607
+ # @param uuid [String]
608
+ # @param body [Models::StartInstanceByUUIDRequestBody, Hash, Array] the request body
609
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
610
+ # @return [Models::StartInstancesResponse, nil] the response envelope
611
+ # @raise [Unikraft::Cloud::Error]
612
+ def start_instance_by_uuid(uuid:, body:, **options)
613
+ res = @client.request(
614
+ method: "PUT",
615
+ path: "/v1/instances/#{Core::URL.escape_segment(uuid)}/start",
616
+ body:,
617
+ **options
618
+ )
619
+ Models::StartInstancesResponse.from(res)
620
+ end
621
+
622
+ # Start Instances
623
+ #
624
+ # `PUT /v1/instances/start`
625
+ #
626
+ # @param body [Hash, Array] the request body
627
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
628
+ # @return [Models::StartInstancesResponse, nil] the response envelope
629
+ # @raise [Unikraft::Cloud::Error]
630
+ def start_instances(body:, **options)
631
+ res = @client.request(
632
+ method: "PUT",
633
+ path: "/v1/instances/start",
634
+ body:,
635
+ **options
636
+ )
637
+ Models::StartInstancesResponse.from(res)
638
+ end
639
+
640
+ # Stop Instance by UUID
641
+ #
642
+ # `PUT /v1/instances/{uuid}/stop`
643
+ #
644
+ # @param uuid [String]
645
+ # @param body [Models::StopInstanceByUUIDRequestBody, Hash, Array] the request body
646
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
647
+ # @return [Models::StopInstancesResponse, nil] the response envelope
648
+ # @raise [Unikraft::Cloud::Error]
649
+ def stop_instance_by_uuid(uuid:, body:, **options)
650
+ res = @client.request(
651
+ method: "PUT",
652
+ path: "/v1/instances/#{Core::URL.escape_segment(uuid)}/stop",
653
+ body:,
654
+ **options
655
+ )
656
+ Models::StopInstancesResponse.from(res)
657
+ end
658
+
659
+ # Stop Instances
660
+ #
661
+ # `PUT /v1/instances/stop`
662
+ #
663
+ # @param body [Hash, Array] the request body
664
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
665
+ # @return [Models::StopInstancesResponse, nil] the response envelope
666
+ # @raise [Unikraft::Cloud::Error]
667
+ def stop_instances(body:, **options)
668
+ res = @client.request(
669
+ method: "PUT",
670
+ path: "/v1/instances/stop",
671
+ body:,
672
+ **options
673
+ )
674
+ Models::StopInstancesResponse.from(res)
675
+ end
676
+
677
+ # Suspend Instance by UUID
678
+ #
679
+ # `PUT /v1/instances/{uuid}/suspend`
680
+ #
681
+ # @param uuid [String]
682
+ # @param body [Models::SuspendInstanceByUUIDRequestBody, Hash, Array] the request body
683
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
684
+ # @return [Models::SuspendInstancesResponse, nil] the response envelope
685
+ # @raise [Unikraft::Cloud::Error]
686
+ def suspend_instance_by_uuid(uuid:, body:, **options)
687
+ res = @client.request(
688
+ method: "PUT",
689
+ path: "/v1/instances/#{Core::URL.escape_segment(uuid)}/suspend",
690
+ body:,
691
+ **options
692
+ )
693
+ Models::SuspendInstancesResponse.from(res)
694
+ end
695
+
696
+ # Suspend Instances
697
+ #
698
+ # `PUT /v1/instances/suspend`
699
+ #
700
+ # @param body [Hash, Array] the request body
701
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
702
+ # @return [Models::SuspendInstancesResponse, nil] the response envelope
703
+ # @raise [Unikraft::Cloud::Error]
704
+ def suspend_instances(body:, **options)
705
+ res = @client.request(
706
+ method: "PUT",
707
+ path: "/v1/instances/suspend",
708
+ body:,
709
+ **options
710
+ )
711
+ Models::SuspendInstancesResponse.from(res)
712
+ end
713
+
714
+ # Update Checkpoint Instance by UUID
715
+ #
716
+ # `PATCH /v1/instances/checkpoints/{uuid}`
717
+ #
718
+ # @param uuid [String]
719
+ # @param body [Models::UpdateCheckpointInstanceByUUIDRequestBody, Hash, Array] the request body
720
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
721
+ # @return [Models::UpdateCheckpointInstancesResponse, nil] the response envelope
722
+ # @raise [Unikraft::Cloud::Error]
723
+ def update_checkpoint_instance_by_uuid(uuid:, body:, **options)
724
+ res = @client.request(
725
+ method: "PATCH",
726
+ path: "/v1/instances/checkpoints/#{Core::URL.escape_segment(uuid)}",
727
+ body:,
728
+ **options
729
+ )
730
+ Models::UpdateCheckpointInstancesResponse.from(res)
731
+ end
732
+
733
+ # Update Checkpoint Instances
734
+ #
735
+ # `PATCH /v1/instances/checkpoints`
736
+ #
737
+ # @param body [Hash, Array] the request body
738
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
739
+ # @return [Models::UpdateCheckpointInstancesResponse, nil] the response envelope
740
+ # @raise [Unikraft::Cloud::Error]
741
+ def update_checkpoint_instances(body:, **options)
742
+ res = @client.request(
743
+ method: "PATCH",
744
+ path: "/v1/instances/checkpoints",
745
+ body:,
746
+ **options
747
+ )
748
+ Models::UpdateCheckpointInstancesResponse.from(res)
749
+ end
750
+
751
+ # Update Instance by UUID
752
+ #
753
+ # `PATCH /v1/instances/{uuid}`
754
+ #
755
+ # @param uuid [String]
756
+ # @param body [Models::UpdateInstanceByUUIDRequestBody, Hash, Array] the request body
757
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
758
+ # @return [Models::UpdateInstancesResponse, nil] the response envelope
759
+ # @raise [Unikraft::Cloud::Error]
760
+ def update_instance_by_uuid(uuid:, body:, **options)
761
+ res = @client.request(
762
+ method: "PATCH",
763
+ path: "/v1/instances/#{Core::URL.escape_segment(uuid)}",
764
+ body:,
765
+ **options
766
+ )
767
+ Models::UpdateInstancesResponse.from(res)
768
+ end
769
+
770
+ # Update Instances
771
+ #
772
+ # `PATCH /v1/instances`
773
+ #
774
+ # @param body [Hash, Array] the request body
775
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
776
+ # @return [Models::UpdateInstancesResponse, nil] the response envelope
777
+ # @raise [Unikraft::Cloud::Error]
778
+ def update_instances(body:, **options)
779
+ res = @client.request(
780
+ method: "PATCH",
781
+ path: "/v1/instances",
782
+ body:,
783
+ **options
784
+ )
785
+ Models::UpdateInstancesResponse.from(res)
786
+ end
787
+
788
+ # Update template instance by UUID
789
+ #
790
+ # `PATCH /v1/instances/templates/{uuid}`
791
+ #
792
+ # @param uuid [String]
793
+ # @param body [Models::UpdateTemplateInstanceByUUIDRequestBody, Hash, Array] the request body
794
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
795
+ # @return [Models::UpdateTemplateInstancesResponse, nil] the response envelope
796
+ # @raise [Unikraft::Cloud::Error]
797
+ def update_template_instance_by_uuid(uuid:, body:, **options)
798
+ res = @client.request(
799
+ method: "PATCH",
800
+ path: "/v1/instances/templates/#{Core::URL.escape_segment(uuid)}",
801
+ body:,
802
+ **options
803
+ )
804
+ Models::UpdateTemplateInstancesResponse.from(res)
805
+ end
806
+
807
+ # Update template instances
808
+ #
809
+ # `PATCH /v1/instances/templates`
810
+ #
811
+ # @param body [Hash, Array] the request body
812
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
813
+ # @return [Models::UpdateTemplateInstancesResponse, nil] the response envelope
814
+ # @raise [Unikraft::Cloud::Error]
815
+ def update_template_instances(body:, **options)
816
+ res = @client.request(
817
+ method: "PATCH",
818
+ path: "/v1/instances/templates",
819
+ body:,
820
+ **options
821
+ )
822
+ Models::UpdateTemplateInstancesResponse.from(res)
823
+ end
824
+
825
+ # Wait for Instance State by UUID
826
+ #
827
+ # `GET /v1/instances/{uuid}/wait`
828
+ #
829
+ # @param uuid [String]
830
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
831
+ # @return [Models::WaitInstancesResponse, nil] the response envelope
832
+ # @raise [Unikraft::Cloud::Error]
833
+ def wait_instance_by_uuid(uuid:, **options)
834
+ res = @client.request(
835
+ method: "GET",
836
+ path: "/v1/instances/#{Core::URL.escape_segment(uuid)}/wait",
837
+ **options
838
+ )
839
+ Models::WaitInstancesResponse.from(res)
840
+ end
841
+
842
+ # Wait for Instances States
843
+ #
844
+ # `GET /v1/instances/wait`
845
+ #
846
+ # @param uuid [Array<String>, nil] The UUID of the resource.
847
+ # @param name [Array<String>, nil] The name of the resource.
848
+ # @param state [Array<String>, nil] The desired state to wait for. Default is `running`.
849
+ # @param timeout_ms [Array<String>, nil]
850
+ # @param timeout_s [Array<String>, nil]
851
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
852
+ # @return [Models::WaitInstancesResponse, nil] the response envelope
853
+ # @raise [Unikraft::Cloud::Error]
854
+ def wait_instances(uuid: nil, name: nil, state: nil, timeout_ms: nil, timeout_s: nil, **options)
855
+ res = @client.request(
856
+ method: "GET",
857
+ path: "/v1/instances/wait",
858
+ query: {
859
+ uuid:,
860
+ name:,
861
+ state:,
862
+ timeout_ms:,
863
+ timeout_s:
864
+ },
865
+ **options
866
+ )
867
+ Models::WaitInstancesResponse.from(res)
868
+ end
869
+ end
870
+ end
871
+ end
872
+ end
873
+ end