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.
- checksums.yaml +7 -0
- data/LICENSE.md +28 -0
- data/README.md +587 -0
- data/lib/unikraft/cloud/api/controlplane/auth.gen.rb +83 -0
- data/lib/unikraft/cloud/api/controlplane/images.gen.rb +51 -0
- data/lib/unikraft/cloud/api/controlplane/metros.gen.rb +45 -0
- data/lib/unikraft/cloud/api/controlplane/models.gen.rb +865 -0
- data/lib/unikraft/cloud/api/controlplane/node_activation_service.gen.rb +79 -0
- data/lib/unikraft/cloud/api/controlplane/node_service.gen.rb +276 -0
- data/lib/unikraft/cloud/api/controlplane/resources.gen.rb +12 -0
- data/lib/unikraft/cloud/api/controlplane.rb +49 -0
- data/lib/unikraft/cloud/api/platform/audit.gen.rb +55 -0
- data/lib/unikraft/cloud/api/platform/autoscale.gen.rb +231 -0
- data/lib/unikraft/cloud/api/platform/certificates.gen.rb +168 -0
- data/lib/unikraft/cloud/api/platform/images.gen.rb +109 -0
- data/lib/unikraft/cloud/api/platform/instances.gen.rb +873 -0
- data/lib/unikraft/cloud/api/platform/models.gen.rb +6456 -0
- data/lib/unikraft/cloud/api/platform/node.gen.rb +45 -0
- data/lib/unikraft/cloud/api/platform/resources.gen.rb +16 -0
- data/lib/unikraft/cloud/api/platform/services.gen.rb +172 -0
- data/lib/unikraft/cloud/api/platform/users.gen.rb +134 -0
- data/lib/unikraft/cloud/api/platform/volumes.gen.rb +430 -0
- data/lib/unikraft/cloud/api/platform.rb +64 -0
- data/lib/unikraft/cloud/api.rb +45 -0
- data/lib/unikraft/cloud/client.rb +186 -0
- data/lib/unikraft/cloud/core/base64.rb +36 -0
- data/lib/unikraft/cloud/core/errors.rb +96 -0
- data/lib/unikraft/cloud/core/fanout.rb +150 -0
- data/lib/unikraft/cloud/core/handle.rb +214 -0
- data/lib/unikraft/cloud/core/handle_set.rb +105 -0
- data/lib/unikraft/cloud/core/http.rb +361 -0
- data/lib/unikraft/cloud/core/metro.rb +75 -0
- data/lib/unikraft/cloud/core/pagination.rb +43 -0
- data/lib/unikraft/cloud/core/patch.rb +113 -0
- data/lib/unikraft/cloud/core/pool.rb +97 -0
- data/lib/unikraft/cloud/core/ready.rb +145 -0
- data/lib/unikraft/cloud/core/ref.rb +95 -0
- data/lib/unikraft/cloud/core/resource.rb +399 -0
- data/lib/unikraft/cloud/core/response.rb +96 -0
- data/lib/unikraft/cloud/core/session.rb +182 -0
- data/lib/unikraft/cloud/core/url.rb +34 -0
- data/lib/unikraft/cloud/model.rb +194 -0
- data/lib/unikraft/cloud/resources/certificates.rb +57 -0
- data/lib/unikraft/cloud/resources/instances.rb +172 -0
- data/lib/unikraft/cloud/resources/service_groups.rb +36 -0
- data/lib/unikraft/cloud/resources/users.rb +39 -0
- data/lib/unikraft/cloud/resources/volumes.rb +93 -0
- data/lib/unikraft/cloud/version.rb +11 -0
- data/lib/unikraft/cloud.rb +29 -0
- metadata +89 -0
|
@@ -0,0 +1,45 @@
|
|
|
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 `node` 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 NodeApi
|
|
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
|
+
# Health Check
|
|
27
|
+
#
|
|
28
|
+
# `GET /v1/healthz`
|
|
29
|
+
#
|
|
30
|
+
# @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
|
|
31
|
+
# @return [Models::HealthzResponse, nil] the response envelope
|
|
32
|
+
# @raise [Unikraft::Cloud::Error]
|
|
33
|
+
def healthz(**options)
|
|
34
|
+
res = @client.request(
|
|
35
|
+
method: "GET",
|
|
36
|
+
path: "/v1/healthz",
|
|
37
|
+
**options
|
|
38
|
+
)
|
|
39
|
+
Models::HealthzResponse.from(res)
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Code generated by openapi-gen; DO NOT EDIT.
|
|
4
|
+
#
|
|
5
|
+
# Loads every generated client of the Platform API.
|
|
6
|
+
|
|
7
|
+
require_relative "models.gen"
|
|
8
|
+
require_relative "audit.gen"
|
|
9
|
+
require_relative "autoscale.gen"
|
|
10
|
+
require_relative "certificates.gen"
|
|
11
|
+
require_relative "images.gen"
|
|
12
|
+
require_relative "instances.gen"
|
|
13
|
+
require_relative "node.gen"
|
|
14
|
+
require_relative "services.gen"
|
|
15
|
+
require_relative "users.gen"
|
|
16
|
+
require_relative "volumes.gen"
|
|
@@ -0,0 +1,172 @@
|
|
|
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 `services` 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 ServicesApi
|
|
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
|
+
# Create Service Group
|
|
27
|
+
#
|
|
28
|
+
# `POST /v1/services`
|
|
29
|
+
#
|
|
30
|
+
# @param body [Models::CreateServiceGroupRequest, Hash, Array] the request body
|
|
31
|
+
# @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
|
|
32
|
+
# @return [Models::CreateServiceGroupResponse, nil] the response envelope
|
|
33
|
+
# @raise [Unikraft::Cloud::Error]
|
|
34
|
+
def create_service_group(body:, **options)
|
|
35
|
+
res = @client.request(
|
|
36
|
+
method: "POST",
|
|
37
|
+
path: "/v1/services",
|
|
38
|
+
body:,
|
|
39
|
+
**options
|
|
40
|
+
)
|
|
41
|
+
Models::CreateServiceGroupResponse.from(res)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Delete Service Group by UUID
|
|
45
|
+
#
|
|
46
|
+
# `DELETE /v1/services/{uuid}`
|
|
47
|
+
#
|
|
48
|
+
# @param uuid [String]
|
|
49
|
+
# @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
|
|
50
|
+
# @return [Models::DeleteServiceGroupsResponse, nil] the response envelope
|
|
51
|
+
# @raise [Unikraft::Cloud::Error]
|
|
52
|
+
def delete_service_group_by_uuid(uuid:, **options)
|
|
53
|
+
res = @client.request(
|
|
54
|
+
method: "DELETE",
|
|
55
|
+
path: "/v1/services/#{Core::URL.escape_segment(uuid)}",
|
|
56
|
+
**options
|
|
57
|
+
)
|
|
58
|
+
Models::DeleteServiceGroupsResponse.from(res)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Delete Service Groups
|
|
62
|
+
#
|
|
63
|
+
# `DELETE /v1/services`
|
|
64
|
+
#
|
|
65
|
+
# @param body [Hash, Array] the request body
|
|
66
|
+
# @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
|
|
67
|
+
# @return [Models::DeleteServiceGroupsResponse, nil] the response envelope
|
|
68
|
+
# @raise [Unikraft::Cloud::Error]
|
|
69
|
+
def delete_service_groups(body:, **options)
|
|
70
|
+
res = @client.request(
|
|
71
|
+
method: "DELETE",
|
|
72
|
+
path: "/v1/services",
|
|
73
|
+
body:,
|
|
74
|
+
**options
|
|
75
|
+
)
|
|
76
|
+
Models::DeleteServiceGroupsResponse.from(res)
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Get Service Group by UUID
|
|
80
|
+
#
|
|
81
|
+
# `GET /v1/services/{uuid}`
|
|
82
|
+
#
|
|
83
|
+
# @param uuid [String]
|
|
84
|
+
# @param details [Boolean, nil]
|
|
85
|
+
# @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
|
|
86
|
+
# @return [Models::GetServiceGroupsResponse, nil] the response envelope
|
|
87
|
+
# @raise [Unikraft::Cloud::Error]
|
|
88
|
+
def get_service_group_by_uuid(uuid:, details: nil, **options)
|
|
89
|
+
res = @client.request(
|
|
90
|
+
method: "GET",
|
|
91
|
+
path: "/v1/services/#{Core::URL.escape_segment(uuid)}",
|
|
92
|
+
query: {
|
|
93
|
+
details:
|
|
94
|
+
},
|
|
95
|
+
**options
|
|
96
|
+
)
|
|
97
|
+
Models::GetServiceGroupsResponse.from(res)
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# List Service Groups
|
|
101
|
+
#
|
|
102
|
+
# `GET /v1/services`
|
|
103
|
+
#
|
|
104
|
+
# @param uuid [Array<String>, nil] The UUID of the resource.
|
|
105
|
+
# @param name [Array<String>, nil] The name of the resource.
|
|
106
|
+
# @param details [Boolean, nil]
|
|
107
|
+
# @param count [Integer, nil]
|
|
108
|
+
# @param from [String, nil]
|
|
109
|
+
# @param order [String, nil]
|
|
110
|
+
# @param sortby [String, nil]
|
|
111
|
+
# @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
|
|
112
|
+
# @return [Models::GetServiceGroupsResponse, nil] the response envelope
|
|
113
|
+
# @raise [Unikraft::Cloud::Error]
|
|
114
|
+
def get_service_groups(uuid: nil, name: nil, details: nil, count: nil, from: nil, order: nil, sortby: nil, **options)
|
|
115
|
+
res = @client.request(
|
|
116
|
+
method: "GET",
|
|
117
|
+
path: "/v1/services",
|
|
118
|
+
query: {
|
|
119
|
+
uuid:,
|
|
120
|
+
name:,
|
|
121
|
+
details:,
|
|
122
|
+
count:,
|
|
123
|
+
from:,
|
|
124
|
+
order:,
|
|
125
|
+
sortby:
|
|
126
|
+
},
|
|
127
|
+
**options
|
|
128
|
+
)
|
|
129
|
+
Models::GetServiceGroupsResponse.from(res)
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# Update Service Group by UUID
|
|
133
|
+
#
|
|
134
|
+
# `PATCH /v1/services/{uuid}`
|
|
135
|
+
#
|
|
136
|
+
# @param uuid [String]
|
|
137
|
+
# @param body [Models::UpdateServiceGroupByUUIDRequestBody, Hash, Array] the request body
|
|
138
|
+
# @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
|
|
139
|
+
# @return [Models::UpdateServiceGroupsResponse, nil] the response envelope
|
|
140
|
+
# @raise [Unikraft::Cloud::Error]
|
|
141
|
+
def update_service_group_by_uuid(uuid:, body:, **options)
|
|
142
|
+
res = @client.request(
|
|
143
|
+
method: "PATCH",
|
|
144
|
+
path: "/v1/services/#{Core::URL.escape_segment(uuid)}",
|
|
145
|
+
body:,
|
|
146
|
+
**options
|
|
147
|
+
)
|
|
148
|
+
Models::UpdateServiceGroupsResponse.from(res)
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Update Service Groups
|
|
152
|
+
#
|
|
153
|
+
# `PATCH /v1/services`
|
|
154
|
+
#
|
|
155
|
+
# @param body [Hash, Array] the request body
|
|
156
|
+
# @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
|
|
157
|
+
# @return [Models::UpdateServiceGroupsResponse, nil] the response envelope
|
|
158
|
+
# @raise [Unikraft::Cloud::Error]
|
|
159
|
+
def update_service_groups(body:, **options)
|
|
160
|
+
res = @client.request(
|
|
161
|
+
method: "PATCH",
|
|
162
|
+
path: "/v1/services",
|
|
163
|
+
body:,
|
|
164
|
+
**options
|
|
165
|
+
)
|
|
166
|
+
Models::UpdateServiceGroupsResponse.from(res)
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
end
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
end
|
|
@@ -0,0 +1,134 @@
|
|
|
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 `users` 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 UsersApi
|
|
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
|
+
# Get Current User Quotas
|
|
27
|
+
#
|
|
28
|
+
# `GET /v1/users/quotas`
|
|
29
|
+
#
|
|
30
|
+
# @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
|
|
31
|
+
# @return [Models::QuotasResponse, nil] the response envelope
|
|
32
|
+
# @raise [Unikraft::Cloud::Error]
|
|
33
|
+
def get_user(**options)
|
|
34
|
+
res = @client.request(
|
|
35
|
+
method: "GET",
|
|
36
|
+
path: "/v1/users/quotas",
|
|
37
|
+
**options
|
|
38
|
+
)
|
|
39
|
+
Models::QuotasResponse.from(res)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Get User Quotas by UUID
|
|
43
|
+
#
|
|
44
|
+
# `GET /v1/users/{uuid}/quotas`
|
|
45
|
+
#
|
|
46
|
+
# @param uuid [String]
|
|
47
|
+
# @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
|
|
48
|
+
# @return [Models::QuotasResponse, nil] the response envelope
|
|
49
|
+
# @raise [Unikraft::Cloud::Error]
|
|
50
|
+
def get_user_by_uuid(uuid:, **options)
|
|
51
|
+
res = @client.request(
|
|
52
|
+
method: "GET",
|
|
53
|
+
path: "/v1/users/#{Core::URL.escape_segment(uuid)}/quotas",
|
|
54
|
+
**options
|
|
55
|
+
)
|
|
56
|
+
Models::QuotasResponse.from(res)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Resume User by UUID
|
|
60
|
+
#
|
|
61
|
+
# `PUT /v1/users/{uuid}/resume`
|
|
62
|
+
#
|
|
63
|
+
# @param uuid [String]
|
|
64
|
+
# @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
|
|
65
|
+
# @return [Models::ResumeUsersResponse, nil] the response envelope
|
|
66
|
+
# @raise [Unikraft::Cloud::Error]
|
|
67
|
+
def resume_user_by_uuid(uuid:, **options)
|
|
68
|
+
res = @client.request(
|
|
69
|
+
method: "PUT",
|
|
70
|
+
path: "/v1/users/#{Core::URL.escape_segment(uuid)}/resume",
|
|
71
|
+
**options
|
|
72
|
+
)
|
|
73
|
+
Models::ResumeUsersResponse.from(res)
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Resume Users
|
|
77
|
+
#
|
|
78
|
+
# `PUT /v1/users/resume`
|
|
79
|
+
#
|
|
80
|
+
# @param body [Hash, Array] the request body
|
|
81
|
+
# @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
|
|
82
|
+
# @return [Models::ResumeUsersResponse, nil] the response envelope
|
|
83
|
+
# @raise [Unikraft::Cloud::Error]
|
|
84
|
+
def resume_users(body:, **options)
|
|
85
|
+
res = @client.request(
|
|
86
|
+
method: "PUT",
|
|
87
|
+
path: "/v1/users/resume",
|
|
88
|
+
body:,
|
|
89
|
+
**options
|
|
90
|
+
)
|
|
91
|
+
Models::ResumeUsersResponse.from(res)
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Suspend User by UUID
|
|
95
|
+
#
|
|
96
|
+
# `PUT /v1/users/{uuid}/suspend`
|
|
97
|
+
#
|
|
98
|
+
# @param uuid [String]
|
|
99
|
+
# @param body [Models::SuspendUserByUUIDRequestBody, Hash, Array, nil] the request body
|
|
100
|
+
# @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
|
|
101
|
+
# @return [Models::SuspendUsersResponse, nil] the response envelope
|
|
102
|
+
# @raise [Unikraft::Cloud::Error]
|
|
103
|
+
def suspend_user_by_uuid(uuid:, body: nil, **options)
|
|
104
|
+
res = @client.request(
|
|
105
|
+
method: "PUT",
|
|
106
|
+
path: "/v1/users/#{Core::URL.escape_segment(uuid)}/suspend",
|
|
107
|
+
body:,
|
|
108
|
+
**options
|
|
109
|
+
)
|
|
110
|
+
Models::SuspendUsersResponse.from(res)
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# Suspend Users
|
|
114
|
+
#
|
|
115
|
+
# `PUT /v1/users/suspend`
|
|
116
|
+
#
|
|
117
|
+
# @param body [Hash, Array] the request body
|
|
118
|
+
# @param options [Hash] per-call `headers:`, `base_url:` and `timeout:`
|
|
119
|
+
# @return [Models::SuspendUsersResponse, nil] the response envelope
|
|
120
|
+
# @raise [Unikraft::Cloud::Error]
|
|
121
|
+
def suspend_users(body:, **options)
|
|
122
|
+
res = @client.request(
|
|
123
|
+
method: "PUT",
|
|
124
|
+
path: "/v1/users/suspend",
|
|
125
|
+
body:,
|
|
126
|
+
**options
|
|
127
|
+
)
|
|
128
|
+
Models::SuspendUsersResponse.from(res)
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
end
|