pnap_rancher_api 1.0.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/Gemfile +9 -0
- data/README.md +154 -0
- data/Rakefile +10 -0
- data/VERSION +1 -0
- data/docs/Cluster.md +36 -0
- data/docs/ClustersApi.md +286 -0
- data/docs/DeleteResult.md +20 -0
- data/docs/Error.md +20 -0
- data/docs/Node.md +18 -0
- data/docs/NodePool.md +26 -0
- data/docs/RancherClusterCertificates.md +22 -0
- data/docs/RancherClusterConfig.md +30 -0
- data/docs/RancherServerMetadata.md +22 -0
- data/docs/SshConfig.md +22 -0
- data/docs/WorkloadClusterConfig.md +24 -0
- data/lib/pnap_rancher_api/api/clusters_api.rb +269 -0
- data/lib/pnap_rancher_api/api_client.rb +392 -0
- data/lib/pnap_rancher_api/api_error.rb +57 -0
- data/lib/pnap_rancher_api/configuration.rb +278 -0
- data/lib/pnap_rancher_api/models/cluster.rb +341 -0
- data/lib/pnap_rancher_api/models/delete_result.rb +235 -0
- data/lib/pnap_rancher_api/models/error.rb +236 -0
- data/lib/pnap_rancher_api/models/node.rb +220 -0
- data/lib/pnap_rancher_api/models/node_pool.rb +264 -0
- data/lib/pnap_rancher_api/models/rancher_cluster_certificates.rb +240 -0
- data/lib/pnap_rancher_api/models/rancher_cluster_config.rb +284 -0
- data/lib/pnap_rancher_api/models/rancher_server_metadata.rb +240 -0
- data/lib/pnap_rancher_api/models/ssh_config.rb +246 -0
- data/lib/pnap_rancher_api/models/workload_cluster_config.rb +264 -0
- data/lib/pnap_rancher_api/version.rb +19 -0
- data/lib/pnap_rancher_api.rb +50 -0
- data/pnap_rancher_api.gemspec +39 -0
- data/spec/api/clusters_api_spec.rb +82 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/cluster_spec.rb +88 -0
- data/spec/models/delete_result_spec.rb +40 -0
- data/spec/models/error_spec.rb +40 -0
- data/spec/models/node_pool_spec.rb +58 -0
- data/spec/models/node_spec.rb +34 -0
- data/spec/models/rancher_cluster_certificates_spec.rb +46 -0
- data/spec/models/rancher_cluster_config_spec.rb +70 -0
- data/spec/models/rancher_server_metadata_spec.rb +46 -0
- data/spec/models/ssh_config_spec.rb +46 -0
- data/spec/models/workload_cluster_config_spec.rb +52 -0
- data/spec/spec_helper.rb +111 -0
- metadata +144 -0
data/docs/SshConfig.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# RancherApi::SshConfig
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **install_default_keys** | **Boolean** | Define whether public keys marked as default should be installed on this node. These are public keys that were already recorded on this system. Use <a href='https://developers.phoenixnap.com/docs/bmc/1/routes/ssh-keys/get' target='_blank'>GET /ssh-keys</a> to retrieve a list of possible values. | [optional][default to true] |
|
8
|
+
| **keys** | **Array<String>** | List of public SSH keys. | [optional] |
|
9
|
+
| **key_ids** | **Array<String>** | List of public SSH key identifiers. These are public keys that were already recorded on this system. Use <a href='https://developers.phoenixnap.com/docs/bmc/1/routes/ssh-keys/get' target='_blank'>GET /ssh-keys</a> to retrieve a list of possible values. | [optional] |
|
10
|
+
|
11
|
+
## Example
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
require 'pnap_rancher_api'
|
15
|
+
|
16
|
+
instance = RancherApi::SshConfig.new(
|
17
|
+
install_default_keys: true,
|
18
|
+
keys: [ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDF9LdAFElNCi7JoWh6KUcchrJ2Gac1aqGRPpdZNowObpRtmiRCecAMb7bUgNAaNfcmwiQi7tos9TlnFgprIcfMWb8MSs3ABYHmBgqEEt3RWYf0fAc9CsIpJdMCUG28TPGTlRXCEUVNKgLMdcseAlJoGp1CgbHWIN65fB3he3kAZcfpPn5mapV0tsl2p+ZyuAGRYdn5dJv2RZDHUZBkOeUobwsij+weHCKAFmKQKtCP7ybgVHaQjAPrj8MGnk1jBbjDt5ws+Be+9JNjQJee9zCKbAOsIo3i+GcUIkrw5jxPU/RTGlWBcemPaKHdciSzGcjWboapzIy49qypQhZe1U75 user],
|
19
|
+
key_ids: ["5fa54d1e91867c03a0a7b4a4"]
|
20
|
+
)
|
21
|
+
```
|
22
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# RancherApi::WorkloadClusterConfig
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **name** | **String** | The name of the workload cluster. This field is autogenerated if not provided. | [optional] |
|
8
|
+
| **server_count** | **Integer** | Number of configured servers. Currently only server counts of 1 and 3 are possible. | [optional][default to 1] |
|
9
|
+
| **server_type** | **String** | Node server type. Cannot be changed once the cluster is created. Currently this field should be set to either `s0.d1.small`, `s0.d1.medium`, `s1.c1.small`, `s1.c1.medium`, `s1.c2.medium`, `s1.c2.large`, `s1.e1.small`, `s1.e1.medium`, `s1.e1.large`, `s2.c1.small`, `s2.c1.medium`, `s2.c1.large`, `s2.c2.small`, `s2.c2.medium`, `s2.c2.large`, `d1.c1.small`, `d1.c2.small`, `d1.c3.small`, `d1.c4.small`, `d1.c1.medium`, `d1.c2.medium`, `d1.c3.medium`, `d1.c4.medium`, `d1.c1.large`, `d1.c2.large`, `d1.c3.large`, `d1.c4.large`, `d1.m1.medium`, `d1.m2.medium`, `d1.m3.medium`, `d1.m4.medium`, `d2.c3.medium`, `d2.c4.medium`, `d2.c5.medium`, `d2.c3.large`, `d2.c4.large`, `d2.c5.large`, `d2.m2.medium`, `d2.m2.large` or `d2.m2.xlarge`. | [default to 's0.d1.small'] |
|
10
|
+
| **location** | **String** | Workload cluster location. Cannot be changed once cluster is created. Currently this field should be set to `PHX`, `ASH`, `SGP`, `NLD`, `CHI`, `SEA` or `AUS`. | |
|
11
|
+
|
12
|
+
## Example
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
require 'pnap_rancher_api'
|
16
|
+
|
17
|
+
instance = RancherApi::WorkloadClusterConfig.new(
|
18
|
+
name: Workload CLuster,
|
19
|
+
server_count: 3,
|
20
|
+
server_type: s0.d1.small,
|
21
|
+
location: PHX
|
22
|
+
)
|
23
|
+
```
|
24
|
+
|
@@ -0,0 +1,269 @@
|
|
1
|
+
=begin
|
2
|
+
#Rancher Solution API
|
3
|
+
|
4
|
+
#Simplify enterprise-grade Kubernetes cluster operations and management with Rancher on Bare Metal Cloud. Deploy Kubernetes clusters using a few API calls.<br> <br> <span class='pnap-api-knowledge-base-link'> Knowledge base articles to help you can be found <a href='https://phoenixnap.com/kb/rancher-bmc-integration-kubernetes' target='_blank'>here</a> </span><br> <br> <b>All URLs are relative to (https://api.phoenixnap.com/solutions/rancher/v1beta)</b>
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 0.1
|
7
|
+
Contact: support@phoenixnap.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.4.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module RancherApi
|
16
|
+
class ClustersApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Cluster list.
|
23
|
+
# Cluster list.
|
24
|
+
# @param [Hash] opts the optional parameters
|
25
|
+
# @return [Array<Cluster>]
|
26
|
+
def clusters_get(opts = {})
|
27
|
+
data, _status_code, _headers = clusters_get_with_http_info(opts)
|
28
|
+
data
|
29
|
+
end
|
30
|
+
|
31
|
+
# Cluster list.
|
32
|
+
# Cluster list.
|
33
|
+
# @param [Hash] opts the optional parameters
|
34
|
+
# @return [Array<(Array<Cluster>, Integer, Hash)>] Array<Cluster> data, response status code and response headers
|
35
|
+
def clusters_get_with_http_info(opts = {})
|
36
|
+
if @api_client.config.debugging
|
37
|
+
@api_client.config.logger.debug 'Calling API: ClustersApi.clusters_get ...'
|
38
|
+
end
|
39
|
+
# resource path
|
40
|
+
local_var_path = '/clusters'
|
41
|
+
|
42
|
+
# query parameters
|
43
|
+
query_params = opts[:query_params] || {}
|
44
|
+
|
45
|
+
# header parameters
|
46
|
+
header_params = opts[:header_params] || {}
|
47
|
+
# HTTP header 'Accept' (if needed)
|
48
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
49
|
+
|
50
|
+
# form parameters
|
51
|
+
form_params = opts[:form_params] || {}
|
52
|
+
|
53
|
+
# http body (model)
|
54
|
+
post_body = opts[:debug_body]
|
55
|
+
|
56
|
+
# return_type
|
57
|
+
return_type = opts[:debug_return_type] || 'Array<Cluster>'
|
58
|
+
|
59
|
+
# auth_names
|
60
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
61
|
+
|
62
|
+
new_options = opts.merge(
|
63
|
+
:operation => :"ClustersApi.clusters_get",
|
64
|
+
:header_params => header_params,
|
65
|
+
:query_params => query_params,
|
66
|
+
:form_params => form_params,
|
67
|
+
:body => post_body,
|
68
|
+
:auth_names => auth_names,
|
69
|
+
:return_type => return_type
|
70
|
+
)
|
71
|
+
|
72
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
73
|
+
if @api_client.config.debugging
|
74
|
+
@api_client.config.logger.debug "API called: ClustersApi#clusters_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
75
|
+
end
|
76
|
+
return data, status_code, headers
|
77
|
+
end
|
78
|
+
|
79
|
+
# Delete a cluster.
|
80
|
+
# Delete a cluster.
|
81
|
+
# @param id [String] The Cluster identifier.
|
82
|
+
# @param [Hash] opts the optional parameters
|
83
|
+
# @return [DeleteResult]
|
84
|
+
def clusters_id_delete(id, opts = {})
|
85
|
+
data, _status_code, _headers = clusters_id_delete_with_http_info(id, opts)
|
86
|
+
data
|
87
|
+
end
|
88
|
+
|
89
|
+
# Delete a cluster.
|
90
|
+
# Delete a cluster.
|
91
|
+
# @param id [String] The Cluster identifier.
|
92
|
+
# @param [Hash] opts the optional parameters
|
93
|
+
# @return [Array<(DeleteResult, Integer, Hash)>] DeleteResult data, response status code and response headers
|
94
|
+
def clusters_id_delete_with_http_info(id, opts = {})
|
95
|
+
if @api_client.config.debugging
|
96
|
+
@api_client.config.logger.debug 'Calling API: ClustersApi.clusters_id_delete ...'
|
97
|
+
end
|
98
|
+
# verify the required parameter 'id' is set
|
99
|
+
if @api_client.config.client_side_validation && id.nil?
|
100
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ClustersApi.clusters_id_delete"
|
101
|
+
end
|
102
|
+
# resource path
|
103
|
+
local_var_path = '/clusters/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
104
|
+
|
105
|
+
# query parameters
|
106
|
+
query_params = opts[:query_params] || {}
|
107
|
+
|
108
|
+
# header parameters
|
109
|
+
header_params = opts[:header_params] || {}
|
110
|
+
# HTTP header 'Accept' (if needed)
|
111
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
112
|
+
|
113
|
+
# form parameters
|
114
|
+
form_params = opts[:form_params] || {}
|
115
|
+
|
116
|
+
# http body (model)
|
117
|
+
post_body = opts[:debug_body]
|
118
|
+
|
119
|
+
# return_type
|
120
|
+
return_type = opts[:debug_return_type] || 'DeleteResult'
|
121
|
+
|
122
|
+
# auth_names
|
123
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
124
|
+
|
125
|
+
new_options = opts.merge(
|
126
|
+
:operation => :"ClustersApi.clusters_id_delete",
|
127
|
+
:header_params => header_params,
|
128
|
+
:query_params => query_params,
|
129
|
+
:form_params => form_params,
|
130
|
+
:body => post_body,
|
131
|
+
:auth_names => auth_names,
|
132
|
+
:return_type => return_type
|
133
|
+
)
|
134
|
+
|
135
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
136
|
+
if @api_client.config.debugging
|
137
|
+
@api_client.config.logger.debug "API called: ClustersApi#clusters_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
138
|
+
end
|
139
|
+
return data, status_code, headers
|
140
|
+
end
|
141
|
+
|
142
|
+
# Retrieve a Cluster
|
143
|
+
# Retrieve a Cluster
|
144
|
+
# @param id [String] The Cluster identifier.
|
145
|
+
# @param [Hash] opts the optional parameters
|
146
|
+
# @return [Cluster]
|
147
|
+
def clusters_id_get(id, opts = {})
|
148
|
+
data, _status_code, _headers = clusters_id_get_with_http_info(id, opts)
|
149
|
+
data
|
150
|
+
end
|
151
|
+
|
152
|
+
# Retrieve a Cluster
|
153
|
+
# Retrieve a Cluster
|
154
|
+
# @param id [String] The Cluster identifier.
|
155
|
+
# @param [Hash] opts the optional parameters
|
156
|
+
# @return [Array<(Cluster, Integer, Hash)>] Cluster data, response status code and response headers
|
157
|
+
def clusters_id_get_with_http_info(id, opts = {})
|
158
|
+
if @api_client.config.debugging
|
159
|
+
@api_client.config.logger.debug 'Calling API: ClustersApi.clusters_id_get ...'
|
160
|
+
end
|
161
|
+
# verify the required parameter 'id' is set
|
162
|
+
if @api_client.config.client_side_validation && id.nil?
|
163
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ClustersApi.clusters_id_get"
|
164
|
+
end
|
165
|
+
# resource path
|
166
|
+
local_var_path = '/clusters/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
167
|
+
|
168
|
+
# query parameters
|
169
|
+
query_params = opts[:query_params] || {}
|
170
|
+
|
171
|
+
# header parameters
|
172
|
+
header_params = opts[:header_params] || {}
|
173
|
+
# HTTP header 'Accept' (if needed)
|
174
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
175
|
+
|
176
|
+
# form parameters
|
177
|
+
form_params = opts[:form_params] || {}
|
178
|
+
|
179
|
+
# http body (model)
|
180
|
+
post_body = opts[:debug_body]
|
181
|
+
|
182
|
+
# return_type
|
183
|
+
return_type = opts[:debug_return_type] || 'Cluster'
|
184
|
+
|
185
|
+
# auth_names
|
186
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
187
|
+
|
188
|
+
new_options = opts.merge(
|
189
|
+
:operation => :"ClustersApi.clusters_id_get",
|
190
|
+
:header_params => header_params,
|
191
|
+
:query_params => query_params,
|
192
|
+
:form_params => form_params,
|
193
|
+
:body => post_body,
|
194
|
+
:auth_names => auth_names,
|
195
|
+
:return_type => return_type
|
196
|
+
)
|
197
|
+
|
198
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
199
|
+
if @api_client.config.debugging
|
200
|
+
@api_client.config.logger.debug "API called: ClustersApi#clusters_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
201
|
+
end
|
202
|
+
return data, status_code, headers
|
203
|
+
end
|
204
|
+
|
205
|
+
# Create a Rancher Server Deployment.
|
206
|
+
# Create a Rancher Server Deployment as described in <a href='https://rancher.com/docs/rancher/v2.5/en/overview/architecture/#rancher-server-architecture' target='_blank'>Rancher Docs Architecture</a>. Rancher Server allows the creation, import and management of multiple Downstream User Kubernetes Clusters. <b>This is not a Downstream User Cluster</b>.
|
207
|
+
# @param [Hash] opts the optional parameters
|
208
|
+
# @option opts [Cluster] :cluster
|
209
|
+
# @return [Cluster]
|
210
|
+
def clusters_post(opts = {})
|
211
|
+
data, _status_code, _headers = clusters_post_with_http_info(opts)
|
212
|
+
data
|
213
|
+
end
|
214
|
+
|
215
|
+
# Create a Rancher Server Deployment.
|
216
|
+
# Create a Rancher Server Deployment as described in <a href='https://rancher.com/docs/rancher/v2.5/en/overview/architecture/#rancher-server-architecture' target='_blank'>Rancher Docs Architecture</a>. Rancher Server allows the creation, import and management of multiple Downstream User Kubernetes Clusters. <b>This is not a Downstream User Cluster</b>.
|
217
|
+
# @param [Hash] opts the optional parameters
|
218
|
+
# @option opts [Cluster] :cluster
|
219
|
+
# @return [Array<(Cluster, Integer, Hash)>] Cluster data, response status code and response headers
|
220
|
+
def clusters_post_with_http_info(opts = {})
|
221
|
+
if @api_client.config.debugging
|
222
|
+
@api_client.config.logger.debug 'Calling API: ClustersApi.clusters_post ...'
|
223
|
+
end
|
224
|
+
# resource path
|
225
|
+
local_var_path = '/clusters'
|
226
|
+
|
227
|
+
# query parameters
|
228
|
+
query_params = opts[:query_params] || {}
|
229
|
+
|
230
|
+
# header parameters
|
231
|
+
header_params = opts[:header_params] || {}
|
232
|
+
# HTTP header 'Accept' (if needed)
|
233
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
234
|
+
# HTTP header 'Content-Type'
|
235
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
236
|
+
if !content_type.nil?
|
237
|
+
header_params['Content-Type'] = content_type
|
238
|
+
end
|
239
|
+
|
240
|
+
# form parameters
|
241
|
+
form_params = opts[:form_params] || {}
|
242
|
+
|
243
|
+
# http body (model)
|
244
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'cluster'])
|
245
|
+
|
246
|
+
# return_type
|
247
|
+
return_type = opts[:debug_return_type] || 'Cluster'
|
248
|
+
|
249
|
+
# auth_names
|
250
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
251
|
+
|
252
|
+
new_options = opts.merge(
|
253
|
+
:operation => :"ClustersApi.clusters_post",
|
254
|
+
:header_params => header_params,
|
255
|
+
:query_params => query_params,
|
256
|
+
:form_params => form_params,
|
257
|
+
:body => post_body,
|
258
|
+
:auth_names => auth_names,
|
259
|
+
:return_type => return_type
|
260
|
+
)
|
261
|
+
|
262
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
263
|
+
if @api_client.config.debugging
|
264
|
+
@api_client.config.logger.debug "API called: ClustersApi#clusters_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
265
|
+
end
|
266
|
+
return data, status_code, headers
|
267
|
+
end
|
268
|
+
end
|
269
|
+
end
|