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,430 @@
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 `volumes` 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 VolumesApi
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
+ # Attach Volume by UUID
27
+ #
28
+ # `PUT /v1/volumes/{uuid}/attach`
29
+ #
30
+ # @param uuid [String]
31
+ # @param body [Models::AttachVolumeByUUIDRequestBody, Hash, Array] the request body
32
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
33
+ # @return [Models::AttachVolumesResponse, nil] the response envelope
34
+ # @raise [Unikraft::Cloud::Error]
35
+ def attach_volume_by_uuid(uuid:, body:, **options)
36
+ res = @client.request(
37
+ method: "PUT",
38
+ path: "/v1/volumes/#{Core::URL.escape_segment(uuid)}/attach",
39
+ body:,
40
+ **options
41
+ )
42
+ Models::AttachVolumesResponse.from(res)
43
+ end
44
+
45
+ # Attach Volumes
46
+ #
47
+ # `PUT /v1/volumes/attach`
48
+ #
49
+ # @param body [Hash, Array] the request body
50
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
51
+ # @return [Models::AttachVolumesResponse, nil] the response envelope
52
+ # @raise [Unikraft::Cloud::Error]
53
+ def attach_volumes(body:, **options)
54
+ res = @client.request(
55
+ method: "PUT",
56
+ path: "/v1/volumes/attach",
57
+ body:,
58
+ **options
59
+ )
60
+ Models::AttachVolumesResponse.from(res)
61
+ end
62
+
63
+ # Clone Volume by UUID
64
+ #
65
+ # `POST /v1/volumes/{uuid}/clone`
66
+ #
67
+ # @param uuid [String]
68
+ # @param body [Models::CloneVolumeByUUIDRequestBody, Hash, Array] the request body
69
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
70
+ # @return [Models::CloneVolumesResponse, nil] the response envelope
71
+ # @raise [Unikraft::Cloud::Error]
72
+ def clone_volume_by_uuid(uuid:, body:, **options)
73
+ res = @client.request(
74
+ method: "POST",
75
+ path: "/v1/volumes/#{Core::URL.escape_segment(uuid)}/clone",
76
+ body:,
77
+ **options
78
+ )
79
+ Models::CloneVolumesResponse.from(res)
80
+ end
81
+
82
+ # Clone Volumes
83
+ #
84
+ # `POST /v1/volumes/clone`
85
+ #
86
+ # @param body [Hash, Array] the request body
87
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
88
+ # @return [Models::CloneVolumesResponse, nil] the response envelope
89
+ # @raise [Unikraft::Cloud::Error]
90
+ def clone_volumes(body:, **options)
91
+ res = @client.request(
92
+ method: "POST",
93
+ path: "/v1/volumes/clone",
94
+ body:,
95
+ **options
96
+ )
97
+ Models::CloneVolumesResponse.from(res)
98
+ end
99
+
100
+ # Create Template Volume
101
+ #
102
+ # `POST /v1/volumes/templates`
103
+ #
104
+ # @param body [Hash, Array] the request body
105
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
106
+ # @return [Models::CreateTemplateVolumesResponse, nil] the response envelope
107
+ # @raise [Unikraft::Cloud::Error]
108
+ def create_template_volume(body:, **options)
109
+ res = @client.request(
110
+ method: "POST",
111
+ path: "/v1/volumes/templates",
112
+ body:,
113
+ **options
114
+ )
115
+ Models::CreateTemplateVolumesResponse.from(res)
116
+ end
117
+
118
+ # Create Volume
119
+ #
120
+ # `POST /v1/volumes`
121
+ #
122
+ # @param body [Models::CreateVolumeRequest, Hash, Array] the request body
123
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
124
+ # @return [Models::CreateVolumeResponse, nil] the response envelope
125
+ # @raise [Unikraft::Cloud::Error]
126
+ def create_volume(body:, **options)
127
+ res = @client.request(
128
+ method: "POST",
129
+ path: "/v1/volumes",
130
+ body:,
131
+ **options
132
+ )
133
+ Models::CreateVolumeResponse.from(res)
134
+ end
135
+
136
+ # Delete Template Volume by UUID
137
+ #
138
+ # `DELETE /v1/volumes/templates/{uuid}`
139
+ #
140
+ # @param uuid [String]
141
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
142
+ # @return [Models::DeleteTemplateVolumesResponse, nil] the response envelope
143
+ # @raise [Unikraft::Cloud::Error]
144
+ def delete_template_volume_by_uuid(uuid:, **options)
145
+ res = @client.request(
146
+ method: "DELETE",
147
+ path: "/v1/volumes/templates/#{Core::URL.escape_segment(uuid)}",
148
+ **options
149
+ )
150
+ Models::DeleteTemplateVolumesResponse.from(res)
151
+ end
152
+
153
+ # Delete Template Volumes
154
+ #
155
+ # `DELETE /v1/volumes/templates`
156
+ #
157
+ # @param body [Hash, Array] the request body
158
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
159
+ # @return [Models::DeleteTemplateVolumesResponse, nil] the response envelope
160
+ # @raise [Unikraft::Cloud::Error]
161
+ def delete_template_volumes(body:, **options)
162
+ res = @client.request(
163
+ method: "DELETE",
164
+ path: "/v1/volumes/templates",
165
+ body:,
166
+ **options
167
+ )
168
+ Models::DeleteTemplateVolumesResponse.from(res)
169
+ end
170
+
171
+ # Delete Volume by UUID
172
+ #
173
+ # `DELETE /v1/volumes/{uuid}`
174
+ #
175
+ # @param uuid [String]
176
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
177
+ # @return [Models::DeleteVolumesResponse, nil] the response envelope
178
+ # @raise [Unikraft::Cloud::Error]
179
+ def delete_volume_by_uuid(uuid:, **options)
180
+ res = @client.request(
181
+ method: "DELETE",
182
+ path: "/v1/volumes/#{Core::URL.escape_segment(uuid)}",
183
+ **options
184
+ )
185
+ Models::DeleteVolumesResponse.from(res)
186
+ end
187
+
188
+ # Delete Volumes
189
+ #
190
+ # `DELETE /v1/volumes`
191
+ #
192
+ # @param body [Hash, Array] the request body
193
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
194
+ # @return [Models::DeleteVolumesResponse, nil] the response envelope
195
+ # @raise [Unikraft::Cloud::Error]
196
+ def delete_volumes(body:, **options)
197
+ res = @client.request(
198
+ method: "DELETE",
199
+ path: "/v1/volumes",
200
+ body:,
201
+ **options
202
+ )
203
+ Models::DeleteVolumesResponse.from(res)
204
+ end
205
+
206
+ # Detach Volume by UUID
207
+ #
208
+ # `PUT /v1/volumes/{uuid}/detach`
209
+ #
210
+ # @param uuid [String]
211
+ # @param body [Models::DetachVolumeByUUIDRequestBody, Hash, Array] the request body
212
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
213
+ # @return [Models::DetachVolumesResponse, nil] the response envelope
214
+ # @raise [Unikraft::Cloud::Error]
215
+ def detach_volume_by_uuid(uuid:, body:, **options)
216
+ res = @client.request(
217
+ method: "PUT",
218
+ path: "/v1/volumes/#{Core::URL.escape_segment(uuid)}/detach",
219
+ body:,
220
+ **options
221
+ )
222
+ Models::DetachVolumesResponse.from(res)
223
+ end
224
+
225
+ # Detach Volumes
226
+ #
227
+ # `PUT /v1/volumes/detach`
228
+ #
229
+ # @param body [Hash, Array] the request body
230
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
231
+ # @return [Models::DetachVolumesResponse, nil] the response envelope
232
+ # @raise [Unikraft::Cloud::Error]
233
+ def detach_volumes(body:, **options)
234
+ res = @client.request(
235
+ method: "PUT",
236
+ path: "/v1/volumes/detach",
237
+ body:,
238
+ **options
239
+ )
240
+ Models::DetachVolumesResponse.from(res)
241
+ end
242
+
243
+ # Get Template Volume by UUID
244
+ #
245
+ # `GET /v1/volumes/templates/{uuid}`
246
+ #
247
+ # @param uuid [String]
248
+ # @param details [Boolean, nil]
249
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
250
+ # @return [Models::GetTemplateVolumesResponse, nil] the response envelope
251
+ # @raise [Unikraft::Cloud::Error]
252
+ def get_template_volume_by_uuid(uuid:, details: nil, **options)
253
+ res = @client.request(
254
+ method: "GET",
255
+ path: "/v1/volumes/templates/#{Core::URL.escape_segment(uuid)}",
256
+ query: {
257
+ details:
258
+ },
259
+ **options
260
+ )
261
+ Models::GetTemplateVolumesResponse.from(res)
262
+ end
263
+
264
+ # List Template Volumes
265
+ #
266
+ # `GET /v1/volumes/templates`
267
+ #
268
+ # @param uuid [Array<String>, nil] The UUID of the resource.
269
+ # @param name [Array<String>, nil] The name of the resource.
270
+ # @param details [Boolean, nil]
271
+ # @param count [Integer, nil]
272
+ # @param from [String, nil]
273
+ # @param order [String, nil]
274
+ # @param sortby [String, nil]
275
+ # @param tags [Array<String>, nil]
276
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
277
+ # @return [Models::GetTemplateVolumesResponse, nil] the response envelope
278
+ # @raise [Unikraft::Cloud::Error]
279
+ def get_template_volumes(uuid: nil, name: nil, details: nil, count: nil, from: nil, order: nil, sortby: nil, tags: nil, **options)
280
+ res = @client.request(
281
+ method: "GET",
282
+ path: "/v1/volumes/templates",
283
+ query: {
284
+ uuid:,
285
+ name:,
286
+ details:,
287
+ count:,
288
+ from:,
289
+ order:,
290
+ sortby:,
291
+ tags: tags&.join(",")
292
+ },
293
+ **options
294
+ )
295
+ Models::GetTemplateVolumesResponse.from(res)
296
+ end
297
+
298
+ # Get Volume by UUID
299
+ #
300
+ # `GET /v1/volumes/{uuid}`
301
+ #
302
+ # @param uuid [String]
303
+ # @param details [Boolean, nil]
304
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
305
+ # @return [Models::GetVolumesResponse, nil] the response envelope
306
+ # @raise [Unikraft::Cloud::Error]
307
+ def get_volume_by_uuid(uuid:, details: nil, **options)
308
+ res = @client.request(
309
+ method: "GET",
310
+ path: "/v1/volumes/#{Core::URL.escape_segment(uuid)}",
311
+ query: {
312
+ details:
313
+ },
314
+ **options
315
+ )
316
+ Models::GetVolumesResponse.from(res)
317
+ end
318
+
319
+ # List Volumes
320
+ #
321
+ # `GET /v1/volumes`
322
+ #
323
+ # @param uuid [Array<String>, nil] The UUID of the resource.
324
+ # @param name [Array<String>, nil] The name of the resource.
325
+ # @param details [Boolean, nil]
326
+ # @param count [Integer, nil]
327
+ # @param from [String, nil]
328
+ # @param order [String, nil]
329
+ # @param sortby [String, nil]
330
+ # @param tags [Array<String>, nil]
331
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
332
+ # @return [Models::GetVolumesResponse, nil] the response envelope
333
+ # @raise [Unikraft::Cloud::Error]
334
+ def get_volumes(uuid: nil, name: nil, details: nil, count: nil, from: nil, order: nil, sortby: nil, tags: nil, **options)
335
+ res = @client.request(
336
+ method: "GET",
337
+ path: "/v1/volumes",
338
+ query: {
339
+ uuid:,
340
+ name:,
341
+ details:,
342
+ count:,
343
+ from:,
344
+ order:,
345
+ sortby:,
346
+ tags: tags&.join(",")
347
+ },
348
+ **options
349
+ )
350
+ Models::GetVolumesResponse.from(res)
351
+ end
352
+
353
+ # Update Template Volume by UUID
354
+ #
355
+ # `PATCH /v1/volumes/templates/{uuid}`
356
+ #
357
+ # @param uuid [String]
358
+ # @param body [Models::UpdateTemplateVolumeByUUIDRequestBody, Hash, Array] the request body
359
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
360
+ # @return [Models::UpdateTemplateVolumesResponse, nil] the response envelope
361
+ # @raise [Unikraft::Cloud::Error]
362
+ def update_template_volume_by_uuid(uuid:, body:, **options)
363
+ res = @client.request(
364
+ method: "PATCH",
365
+ path: "/v1/volumes/templates/#{Core::URL.escape_segment(uuid)}",
366
+ body:,
367
+ **options
368
+ )
369
+ Models::UpdateTemplateVolumesResponse.from(res)
370
+ end
371
+
372
+ # Update Template Volumes
373
+ #
374
+ # `PATCH /v1/volumes/templates`
375
+ #
376
+ # @param body [Hash, Array] the request body
377
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
378
+ # @return [Models::UpdateTemplateVolumesResponse, nil] the response envelope
379
+ # @raise [Unikraft::Cloud::Error]
380
+ def update_template_volumes(body:, **options)
381
+ res = @client.request(
382
+ method: "PATCH",
383
+ path: "/v1/volumes/templates",
384
+ body:,
385
+ **options
386
+ )
387
+ Models::UpdateTemplateVolumesResponse.from(res)
388
+ end
389
+
390
+ # Update Volume by UUID
391
+ #
392
+ # `PATCH /v1/volumes/{uuid}`
393
+ #
394
+ # @param uuid [String]
395
+ # @param body [Models::UpdateVolumeByUUIDRequestBody, Hash, Array] the request body
396
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
397
+ # @return [Models::UpdateVolumesResponse, nil] the response envelope
398
+ # @raise [Unikraft::Cloud::Error]
399
+ def update_volume_by_uuid(uuid:, body:, **options)
400
+ res = @client.request(
401
+ method: "PATCH",
402
+ path: "/v1/volumes/#{Core::URL.escape_segment(uuid)}",
403
+ body:,
404
+ **options
405
+ )
406
+ Models::UpdateVolumesResponse.from(res)
407
+ end
408
+
409
+ # Update Volumes
410
+ #
411
+ # `PATCH /v1/volumes`
412
+ #
413
+ # @param body [Hash, Array] the request body
414
+ # @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
415
+ # @return [Models::UpdateVolumesResponse, nil] the response envelope
416
+ # @raise [Unikraft::Cloud::Error]
417
+ def update_volumes(body:, **options)
418
+ res = @client.request(
419
+ method: "PATCH",
420
+ path: "/v1/volumes",
421
+ body:,
422
+ **options
423
+ )
424
+ Models::UpdateVolumesResponse.from(res)
425
+ end
426
+ end
427
+ end
428
+ end
429
+ end
430
+ end
@@ -0,0 +1,64 @@
1
+ # frozen_string_literal: true
2
+
3
+ # SPDX-License-Identifier: BSD-3-Clause
4
+ # Copyright (c) 2026, Unikraft GmbH.
5
+
6
+ require_relative "../core/http"
7
+ require_relative "platform/resources.gen"
8
+
9
+ module Unikraft
10
+ module Cloud
11
+ class API
12
+ # Every platform API resource, raw. The platform API is metro-scoped:
13
+ # these clients talk to the one metro their `base_url` names, and a
14
+ # single call can be redirected with `base_url:`. Fanning out across
15
+ # metros is the porcelain's job.
16
+ #
17
+ # @example
18
+ # api = Unikraft::Cloud::API::Platform.new(
19
+ # base_url: "https://api.fra.unikraft.cloud", token: ENV["UKC_TOKEN"]
20
+ # )
21
+ # res = api.instances.get_instances(count: 10, details: true)
22
+ # res.data.instances
23
+ class Platform
24
+ # @return [#request, #bytes, #stream] the shared transport
25
+ attr_reader :client
26
+ # @return [AuditApi] the audit event stream
27
+ attr_reader :audit
28
+ # @return [AutoscaleApi] autoscale configurations and policies
29
+ attr_reader :autoscale
30
+ # @return [CertificatesApi] TLS certificates
31
+ attr_reader :certificates
32
+ # @return [ImagesApi] the image registry (metro-scoped view)
33
+ attr_reader :images
34
+ # @return [InstancesApi] instances (microVMs)
35
+ attr_reader :instances
36
+ # @return [NodeApi] metro node information
37
+ attr_reader :node
38
+ # @return [ServicesApi] service groups (load-balanced networking)
39
+ attr_reader :services
40
+ # @return [UsersApi] users and quotas
41
+ attr_reader :users
42
+ # @return [VolumesApi] persistent volumes
43
+ attr_reader :volumes
44
+
45
+ # @param client [#request, #bytes, #stream, nil] a transport to share;
46
+ # when nil, one is built from `config`
47
+ # @param config [Hash] {Core::ApiClient#initialize} keywords, e.g.
48
+ # `base_url:` and `token:`
49
+ def initialize(client = nil, **config)
50
+ @client = client || Core::ApiClient.new(**config)
51
+ @audit = AuditApi.new(@client)
52
+ @autoscale = AutoscaleApi.new(@client)
53
+ @certificates = CertificatesApi.new(@client)
54
+ @images = ImagesApi.new(@client)
55
+ @instances = InstancesApi.new(@client)
56
+ @node = NodeApi.new(@client)
57
+ @services = ServicesApi.new(@client)
58
+ @users = UsersApi.new(@client)
59
+ @volumes = VolumesApi.new(@client)
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ # SPDX-License-Identifier: BSD-3-Clause
4
+ # Copyright (c) 2026, Unikraft GmbH.
5
+ #
6
+ # The raw ("plumbing") layer of every Unikraft Cloud API, in one place.
7
+ # Everything here mirrors the OpenAPI specification: operations are named
8
+ # after their operationId, and responses come back as the untouched envelope.
9
+
10
+ require_relative "api/platform"
11
+ require_relative "api/controlplane"
12
+
13
+ module Unikraft
14
+ module Cloud
15
+ # Both raw API surfaces, as exposed by `ukc.api`.
16
+ #
17
+ # @example
18
+ # api = Unikraft::Cloud::API.new(
19
+ # platform: { base_url: "https://api.fra.unikraft.cloud", token: token },
20
+ # controlplane: { base_url: "https://api.unikraft.cloud", token: token }
21
+ # )
22
+ # api.platform.instances.get_instances(count: 10)
23
+ # api.controlplane.metros.list_metros
24
+ class API
25
+ # @return [Platform] the metro-scoped platform API
26
+ attr_reader :platform
27
+ # @return [ControlPlane] the global control-plane API
28
+ attr_reader :controlplane
29
+
30
+ # @param platform [Hash, #request] {Core::ApiClient} keywords, or a
31
+ # transport to use as is
32
+ # @param controlplane [Hash, #request] likewise, for the control plane
33
+ def initialize(platform:, controlplane:)
34
+ @platform = build(Platform, platform)
35
+ @controlplane = build(ControlPlane, controlplane)
36
+ end
37
+
38
+ private
39
+
40
+ def build(klass, config)
41
+ config.is_a?(Hash) ? klass.new(**config) : klass.new(config)
42
+ end
43
+ end
44
+ end
45
+ end