pnap_rancher_api 2.0.4 → 2.0.5
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 +4 -4
- data/VERSION +1 -1
- data/docs/Cluster.md +1 -1
- data/docs/ClustersApi.md +1 -1
- data/docs/WorkloadClusterConfig.md +2 -2
- data/lib/pnap_rancher_api/api/clusters_api.rb +7 -7
- data/lib/pnap_rancher_api/api_client.rb +17 -14
- data/lib/pnap_rancher_api/api_error.rb +1 -1
- data/lib/pnap_rancher_api/api_model_base.rb +88 -0
- data/lib/pnap_rancher_api/configuration.rb +11 -1
- data/lib/pnap_rancher_api/models/cluster.rb +22 -79
- data/lib/pnap_rancher_api/models/delete_result.rb +31 -78
- data/lib/pnap_rancher_api/models/error.rb +21 -78
- data/lib/pnap_rancher_api/models/node.rb +11 -78
- data/lib/pnap_rancher_api/models/node_pool.rb +13 -80
- data/lib/pnap_rancher_api/models/rancher_cluster_certificates.rb +11 -78
- data/lib/pnap_rancher_api/models/rancher_cluster_config.rb +11 -78
- data/lib/pnap_rancher_api/models/rancher_server_metadata.rb +11 -78
- data/lib/pnap_rancher_api/models/ssh_config.rb +11 -78
- data/lib/pnap_rancher_api/models/workload_cluster_config.rb +33 -80
- data/lib/pnap_rancher_api/version.rb +1 -2
- data/lib/pnap_rancher_api.rb +2 -1
- data/pnap_rancher_api.gemspec +6 -6
- data/spec/api/clusters_api_spec.rb +2 -2
- data/spec/models/cluster_spec.rb +2 -2
- data/spec/models/delete_result_spec.rb +2 -2
- data/spec/models/error_spec.rb +2 -2
- data/spec/models/node_pool_spec.rb +2 -2
- data/spec/models/node_spec.rb +2 -2
- data/spec/models/rancher_cluster_certificates_spec.rb +2 -2
- data/spec/models/rancher_cluster_config_spec.rb +2 -2
- data/spec/models/rancher_server_metadata_spec.rb +2 -2
- data/spec/models/ssh_config_spec.rb +2 -2
- data/spec/models/workload_cluster_config_spec.rb +2 -2
- data/spec/spec_helper.rb +1 -1
- metadata +14 -10
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c2750929cbe69b2947937d7ac2c8319d297586003a4cb499a5da05113b9966c2
|
|
4
|
+
data.tar.gz: 43be06ad8c4896a5e81488657f4804a2a25fdd232e09aa06401bedf07d31496a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7b86c7750bf2379968fbc6afbacdb8b2a1f267ce35042926d9896a6e17f47a090109b34644e9be6c0e196e04816a80bee758cded09afe66cd4927b6a85d9ca6f
|
|
7
|
+
data.tar.gz: 8aa59beb0fb11c914c558bf7715b5d189d8db3b0927e8bf3562526c6f17042c3929dad57828c63a478cd673961979c2d9850206d01688a8ad323822a99c4daa3
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.0.
|
|
1
|
+
2.0.5
|
data/docs/Cluster.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
| **id** | **String** | (Read-only) The Cluster identifier. | [optional][readonly] |
|
|
8
8
|
| **name** | **String** | Cluster name. This field is autogenerated if not provided. | [optional] |
|
|
9
9
|
| **description** | **String** | Cluster description. | [optional] |
|
|
10
|
-
| **location** | **String** | Deployment location. Cannot be changed once a cluster is created. Currently this field should be set to `PHX`, `ASH`, `SGP`, `NLD`, `CHI`
|
|
10
|
+
| **location** | **String** | Deployment location. Cannot be changed once a cluster is created. Currently this field should be set to `PHX`, `ASH`, `SGP`, `NLD`, `CHI` or `SEA`. | |
|
|
11
11
|
| **initial_cluster_version** | **String** | (Read-only) The Rancher version that was installed on the cluster during the first creation process. | [optional][readonly] |
|
|
12
12
|
| **node_pools** | [**Array<NodePool>**](NodePool.md) | The node pools associated with the cluster. | [optional] |
|
|
13
13
|
| **configuration** | [**RancherClusterConfig**](RancherClusterConfig.md) | | [optional] |
|
data/docs/ClustersApi.md
CHANGED
|
@@ -220,7 +220,7 @@ end
|
|
|
220
220
|
|
|
221
221
|
Create a Rancher Server Deployment.
|
|
222
222
|
|
|
223
|
-
Create a Rancher Server Deployment as described in <a href='https://ranchermanager.docs.rancher.com/
|
|
223
|
+
Create a Rancher Server Deployment as described in <a href='https://ranchermanager.docs.rancher.com/reference-guides/rancher-manager-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>. Knowledge base article to help you can be found <a href='https://phoenixnap.com/kb/bmc-rancher-workload-cluster#ftoc-heading-5' target='_blank'>here</a>.
|
|
224
224
|
|
|
225
225
|
### Examples
|
|
226
226
|
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
7
|
| **name** | **String** | The name of the workload cluster. This field is autogenerated if not provided. | [optional] |
|
|
8
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.
|
|
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`
|
|
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.c4.small`, `d1.c4.medium`, `d1.c4.large`, `d1.m4.medium`, `d2.c1.medium`, `d2.c2.medium`, `d2.c3.medium`, `d2.c4.medium`, `d2.c5.medium`, `d2.c1.large`, `d2.c2.large`, `d2.c3.large`, `d2.c4.large`, `d2.c5.large`, `d2.m1.xlarge`, `d2.m2.xxlarge`, `d2.m3.xlarge`, `d2.m4.xlarge`, `d2.m5.xlarge`, `d2.c4.db1.pliops1`, `d3.m4.xlarge`, `d3.m5.xlarge`, `d3.m6.xlarge`, `a1.c5.large`, `d3.s5.xlarge`, `d3.m4.xxlarge`, `d3.m5.xxlarge`, `d3.m6.xxlarge`, `s3.c3.medium`, `s3.c3.large`, `d3.c4.medium`, `d3.c5.medium`, `d3.c6.medium`, `d3.c1.large`, `d3.c2.large`, `d3.c3.large`, `d3.m1.xlarge`, `d3.m2.xlarge`, `d3.m3.xlarge`, `d3.g2.c1.xlarge`, `d3.g2.c2.xlarge` or `d3.g2.c3.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` or `SEA`. | |
|
|
11
11
|
|
|
12
12
|
## Example
|
|
13
13
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -45,7 +45,7 @@ module RancherApi
|
|
|
45
45
|
# header parameters
|
|
46
46
|
header_params = opts[:header_params] || {}
|
|
47
47
|
# HTTP header 'Accept' (if needed)
|
|
48
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
48
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
49
49
|
|
|
50
50
|
# form parameters
|
|
51
51
|
form_params = opts[:form_params] || {}
|
|
@@ -108,7 +108,7 @@ module RancherApi
|
|
|
108
108
|
# header parameters
|
|
109
109
|
header_params = opts[:header_params] || {}
|
|
110
110
|
# HTTP header 'Accept' (if needed)
|
|
111
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
111
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
112
112
|
|
|
113
113
|
# form parameters
|
|
114
114
|
form_params = opts[:form_params] || {}
|
|
@@ -171,7 +171,7 @@ module RancherApi
|
|
|
171
171
|
# header parameters
|
|
172
172
|
header_params = opts[:header_params] || {}
|
|
173
173
|
# HTTP header 'Accept' (if needed)
|
|
174
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
174
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
175
175
|
|
|
176
176
|
# form parameters
|
|
177
177
|
form_params = opts[:form_params] || {}
|
|
@@ -203,7 +203,7 @@ module RancherApi
|
|
|
203
203
|
end
|
|
204
204
|
|
|
205
205
|
# Create a Rancher Server Deployment.
|
|
206
|
-
# Create a Rancher Server Deployment as described in <a href='https://ranchermanager.docs.rancher.com/
|
|
206
|
+
# Create a Rancher Server Deployment as described in <a href='https://ranchermanager.docs.rancher.com/reference-guides/rancher-manager-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>. Knowledge base article to help you can be found <a href='https://phoenixnap.com/kb/bmc-rancher-workload-cluster#ftoc-heading-5' target='_blank'>here</a>.
|
|
207
207
|
# @param cluster [Cluster]
|
|
208
208
|
# @param [Hash] opts the optional parameters
|
|
209
209
|
# @return [Cluster]
|
|
@@ -213,7 +213,7 @@ module RancherApi
|
|
|
213
213
|
end
|
|
214
214
|
|
|
215
215
|
# Create a Rancher Server Deployment.
|
|
216
|
-
# Create a Rancher Server Deployment as described in <a href='https://ranchermanager.docs.rancher.com/
|
|
216
|
+
# Create a Rancher Server Deployment as described in <a href='https://ranchermanager.docs.rancher.com/reference-guides/rancher-manager-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>. Knowledge base article to help you can be found <a href='https://phoenixnap.com/kb/bmc-rancher-workload-cluster#ftoc-heading-5' target='_blank'>here</a>.
|
|
217
217
|
# @param cluster [Cluster]
|
|
218
218
|
# @param [Hash] opts the optional parameters
|
|
219
219
|
# @return [Array<(Cluster, Integer, Hash)>] Cluster data, response status code and response headers
|
|
@@ -234,7 +234,7 @@ module RancherApi
|
|
|
234
234
|
# header parameters
|
|
235
235
|
header_params = opts[:header_params] || {}
|
|
236
236
|
# HTTP header 'Accept' (if needed)
|
|
237
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
237
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
238
238
|
# HTTP header 'Content-Type'
|
|
239
239
|
content_type = @api_client.select_header_content_type(['application/json'])
|
|
240
240
|
if !content_type.nil?
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -52,7 +52,8 @@ module RancherApi
|
|
|
52
52
|
# the data deserialized from response body (may be a Tempfile or nil), response status code and response headers.
|
|
53
53
|
def call_api(http_method, path, opts = {})
|
|
54
54
|
request = build_request(http_method, path, opts)
|
|
55
|
-
tempfile =
|
|
55
|
+
tempfile = nil
|
|
56
|
+
(download_file(request) { tempfile = _1 }) if opts[:return_type] == 'File'
|
|
56
57
|
response = request.run
|
|
57
58
|
|
|
58
59
|
if @config.debugging
|
|
@@ -191,19 +192,17 @@ module RancherApi
|
|
|
191
192
|
chunk.force_encoding(encoding)
|
|
192
193
|
tempfile.write(chunk)
|
|
193
194
|
end
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
195
|
+
request.on_complete do
|
|
196
|
+
if !tempfile
|
|
197
|
+
fail ApiError.new("Failed to create the tempfile based on the HTTP response from the server: #{request.inspect}")
|
|
198
|
+
end
|
|
197
199
|
tempfile.close
|
|
198
200
|
@config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
|
|
199
201
|
"with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
|
|
200
202
|
"will be deleted automatically with GC. It's also recommended to delete the temp file "\
|
|
201
203
|
"explicitly with `tempfile.delete`"
|
|
202
|
-
|
|
203
|
-
fail ApiError.new("Failed to create the tempfile based on the HTTP response from the server: #{request.inspect}")
|
|
204
|
+
yield tempfile if block_given?
|
|
204
205
|
end
|
|
205
|
-
|
|
206
|
-
tempfile
|
|
207
206
|
end
|
|
208
207
|
|
|
209
208
|
# Check if the given MIME is a JSON MIME.
|
|
@@ -215,7 +214,7 @@ module RancherApi
|
|
|
215
214
|
# @param [String] mime MIME
|
|
216
215
|
# @return [Boolean] True if the MIME is application/json
|
|
217
216
|
def json_mime?(mime)
|
|
218
|
-
(mime == '*/*') || !(mime =~
|
|
217
|
+
(mime == '*/*') || !(mime =~ /^Application\/.*json(?!p)(;.*)?/i).nil?
|
|
219
218
|
end
|
|
220
219
|
|
|
221
220
|
# Deserialize the response to the given return type.
|
|
@@ -282,9 +281,13 @@ module RancherApi
|
|
|
282
281
|
data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
|
|
283
282
|
end
|
|
284
283
|
else
|
|
285
|
-
# models (e.g. Pet) or oneOf
|
|
284
|
+
# models (e.g. Pet) or oneOf/anyOf
|
|
286
285
|
klass = RancherApi.const_get(return_type)
|
|
287
|
-
klass.respond_to?(:openapi_one_of)
|
|
286
|
+
if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of)
|
|
287
|
+
klass.build(data)
|
|
288
|
+
else
|
|
289
|
+
klass.build_from_hash(data)
|
|
290
|
+
end
|
|
288
291
|
end
|
|
289
292
|
end
|
|
290
293
|
|
|
@@ -294,7 +297,7 @@ module RancherApi
|
|
|
294
297
|
# @param [String] filename the filename to be sanitized
|
|
295
298
|
# @return [String] the sanitized filename
|
|
296
299
|
def sanitize_filename(filename)
|
|
297
|
-
filename.
|
|
300
|
+
filename.split(/[\/\\]/).last
|
|
298
301
|
end
|
|
299
302
|
|
|
300
303
|
def build_request_url(path, opts = {})
|
|
@@ -394,4 +397,4 @@ module RancherApi
|
|
|
394
397
|
end
|
|
395
398
|
end
|
|
396
399
|
end
|
|
397
|
-
end
|
|
400
|
+
end
|
|
@@ -0,0 +1,88 @@
|
|
|
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
|
+
Generator version: 7.20.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
module RancherApi
|
|
14
|
+
class ApiModelBase
|
|
15
|
+
# Deserializes the data based on type
|
|
16
|
+
# @param string type Data type
|
|
17
|
+
# @param string value Value to be deserialized
|
|
18
|
+
# @return [Object] Deserialized data
|
|
19
|
+
def self._deserialize(type, value)
|
|
20
|
+
case type.to_sym
|
|
21
|
+
when :Time
|
|
22
|
+
Time.parse(value)
|
|
23
|
+
when :Date
|
|
24
|
+
Date.parse(value)
|
|
25
|
+
when :String
|
|
26
|
+
value.to_s
|
|
27
|
+
when :Integer
|
|
28
|
+
value.to_i
|
|
29
|
+
when :Float
|
|
30
|
+
value.to_f
|
|
31
|
+
when :Boolean
|
|
32
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
33
|
+
true
|
|
34
|
+
else
|
|
35
|
+
false
|
|
36
|
+
end
|
|
37
|
+
when :Object
|
|
38
|
+
# generic object (usually a Hash), return directly
|
|
39
|
+
value
|
|
40
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
41
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
42
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
43
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
44
|
+
k_type = Regexp.last_match[:k_type]
|
|
45
|
+
v_type = Regexp.last_match[:v_type]
|
|
46
|
+
{}.tap do |hash|
|
|
47
|
+
value.each do |k, v|
|
|
48
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
else # model
|
|
52
|
+
# models (e.g. Pet) or oneOf
|
|
53
|
+
klass = RancherApi.const_get(type)
|
|
54
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Returns the string representation of the object
|
|
59
|
+
# @return [String] String presentation of the object
|
|
60
|
+
def to_s
|
|
61
|
+
to_hash.to_s
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
65
|
+
# @return [Hash] Returns the object in the form of hash
|
|
66
|
+
def to_body
|
|
67
|
+
to_hash
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Outputs non-array value in the form of hash
|
|
71
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
72
|
+
# @param [Object] value Any valid value
|
|
73
|
+
# @return [Hash] Returns the value in the form of hash
|
|
74
|
+
def _to_hash(value)
|
|
75
|
+
if value.is_a?(Array)
|
|
76
|
+
value.compact.map { |v| _to_hash(v) }
|
|
77
|
+
elsif value.is_a?(Hash)
|
|
78
|
+
{}.tap do |hash|
|
|
79
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
80
|
+
end
|
|
81
|
+
elsif value.respond_to? :to_hash
|
|
82
|
+
value.to_hash
|
|
83
|
+
else
|
|
84
|
+
value
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -79,6 +79,14 @@ module RancherApi
|
|
|
79
79
|
# @return [true, false]
|
|
80
80
|
attr_accessor :debugging
|
|
81
81
|
|
|
82
|
+
# Set this to ignore operation servers for the API client. This is useful when you need to
|
|
83
|
+
# send requests to a different server than the one specified in the OpenAPI document.
|
|
84
|
+
# Will default to the base url defined in the spec but can be overridden by setting
|
|
85
|
+
# `scheme`, `host`, `base_path` directly.
|
|
86
|
+
# Default to false.
|
|
87
|
+
# @return [true, false]
|
|
88
|
+
attr_accessor :ignore_operation_servers
|
|
89
|
+
|
|
82
90
|
# Defines the logger used for debugging.
|
|
83
91
|
# Default to `Rails.logger` (when in Rails) or logging to STDOUT.
|
|
84
92
|
#
|
|
@@ -166,6 +174,7 @@ module RancherApi
|
|
|
166
174
|
@timeout = 0
|
|
167
175
|
@params_encoding = nil
|
|
168
176
|
@debugging = false
|
|
177
|
+
@ignore_operation_servers = false
|
|
169
178
|
@inject_format = false
|
|
170
179
|
@force_ending_format = false
|
|
171
180
|
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
|
@@ -200,6 +209,7 @@ module RancherApi
|
|
|
200
209
|
|
|
201
210
|
# Returns base URL for specified operation based on server settings
|
|
202
211
|
def base_url(operation = nil)
|
|
212
|
+
return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers
|
|
203
213
|
if operation_server_settings.key?(operation) then
|
|
204
214
|
index = server_operation_index.fetch(operation, server_index)
|
|
205
215
|
server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module RancherApi
|
|
17
17
|
# Cluster details.
|
|
18
|
-
class Cluster
|
|
18
|
+
class Cluster < ApiModelBase
|
|
19
19
|
# (Read-only) The Cluster identifier.
|
|
20
20
|
attr_accessor :id
|
|
21
21
|
|
|
@@ -25,7 +25,7 @@ module RancherApi
|
|
|
25
25
|
# Cluster description.
|
|
26
26
|
attr_accessor :description
|
|
27
27
|
|
|
28
|
-
# Deployment location. Cannot be changed once a cluster is created. Currently this field should be set to `PHX`, `ASH`, `SGP`, `NLD`, `CHI
|
|
28
|
+
# Deployment location. Cannot be changed once a cluster is created. Currently this field should be set to `PHX`, `ASH`, `SGP`, `NLD`, `CHI` or `SEA`.
|
|
29
29
|
attr_accessor :location
|
|
30
30
|
|
|
31
31
|
# (Read-only) The Rancher version that was installed on the cluster during the first creation process.
|
|
@@ -59,9 +59,14 @@ module RancherApi
|
|
|
59
59
|
}
|
|
60
60
|
end
|
|
61
61
|
|
|
62
|
+
# Returns attribute mapping this model knows about
|
|
63
|
+
def self.acceptable_attribute_map
|
|
64
|
+
attribute_map
|
|
65
|
+
end
|
|
66
|
+
|
|
62
67
|
# Returns all the JSON keys this model knows about
|
|
63
68
|
def self.acceptable_attributes
|
|
64
|
-
|
|
69
|
+
acceptable_attribute_map.values
|
|
65
70
|
end
|
|
66
71
|
|
|
67
72
|
# Attribute type mapping.
|
|
@@ -94,9 +99,10 @@ module RancherApi
|
|
|
94
99
|
end
|
|
95
100
|
|
|
96
101
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
102
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
97
103
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
98
|
-
if (!
|
|
99
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `RancherApi::Cluster`. Please check the name to make sure it's valid. List of attributes: " +
|
|
104
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
105
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `RancherApi::Cluster`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
100
106
|
end
|
|
101
107
|
h[k.to_sym] = v
|
|
102
108
|
}
|
|
@@ -176,6 +182,16 @@ module RancherApi
|
|
|
176
182
|
true
|
|
177
183
|
end
|
|
178
184
|
|
|
185
|
+
# Custom attribute writer method with validation
|
|
186
|
+
# @param [Object] location Value to be assigned
|
|
187
|
+
def location=(location)
|
|
188
|
+
if location.nil?
|
|
189
|
+
fail ArgumentError, 'location cannot be nil'
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
@location = location
|
|
193
|
+
end
|
|
194
|
+
|
|
179
195
|
# Custom attribute writer method with validation
|
|
180
196
|
# @param [Object] node_pools Value to be assigned
|
|
181
197
|
def node_pools=(node_pools)
|
|
@@ -246,61 +262,6 @@ module RancherApi
|
|
|
246
262
|
new(transformed_hash)
|
|
247
263
|
end
|
|
248
264
|
|
|
249
|
-
# Deserializes the data based on type
|
|
250
|
-
# @param string type Data type
|
|
251
|
-
# @param string value Value to be deserialized
|
|
252
|
-
# @return [Object] Deserialized data
|
|
253
|
-
def self._deserialize(type, value)
|
|
254
|
-
case type.to_sym
|
|
255
|
-
when :Time
|
|
256
|
-
Time.parse(value)
|
|
257
|
-
when :Date
|
|
258
|
-
Date.parse(value)
|
|
259
|
-
when :String
|
|
260
|
-
value.to_s
|
|
261
|
-
when :Integer
|
|
262
|
-
value.to_i
|
|
263
|
-
when :Float
|
|
264
|
-
value.to_f
|
|
265
|
-
when :Boolean
|
|
266
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
267
|
-
true
|
|
268
|
-
else
|
|
269
|
-
false
|
|
270
|
-
end
|
|
271
|
-
when :Object
|
|
272
|
-
# generic object (usually a Hash), return directly
|
|
273
|
-
value
|
|
274
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
275
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
276
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
277
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
278
|
-
k_type = Regexp.last_match[:k_type]
|
|
279
|
-
v_type = Regexp.last_match[:v_type]
|
|
280
|
-
{}.tap do |hash|
|
|
281
|
-
value.each do |k, v|
|
|
282
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
283
|
-
end
|
|
284
|
-
end
|
|
285
|
-
else # model
|
|
286
|
-
# models (e.g. Pet) or oneOf
|
|
287
|
-
klass = RancherApi.const_get(type)
|
|
288
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
289
|
-
end
|
|
290
|
-
end
|
|
291
|
-
|
|
292
|
-
# Returns the string representation of the object
|
|
293
|
-
# @return [String] String presentation of the object
|
|
294
|
-
def to_s
|
|
295
|
-
to_hash.to_s
|
|
296
|
-
end
|
|
297
|
-
|
|
298
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
299
|
-
# @return [Hash] Returns the object in the form of hash
|
|
300
|
-
def to_body
|
|
301
|
-
to_hash
|
|
302
|
-
end
|
|
303
|
-
|
|
304
265
|
# Returns the object in the form of hash
|
|
305
266
|
# @return [Hash] Returns the object in the form of hash
|
|
306
267
|
def to_hash
|
|
@@ -317,24 +278,6 @@ module RancherApi
|
|
|
317
278
|
hash
|
|
318
279
|
end
|
|
319
280
|
|
|
320
|
-
# Outputs non-array value in the form of hash
|
|
321
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
322
|
-
# @param [Object] value Any valid value
|
|
323
|
-
# @return [Hash] Returns the value in the form of hash
|
|
324
|
-
def _to_hash(value)
|
|
325
|
-
if value.is_a?(Array)
|
|
326
|
-
value.compact.map { |v| _to_hash(v) }
|
|
327
|
-
elsif value.is_a?(Hash)
|
|
328
|
-
{}.tap do |hash|
|
|
329
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
330
|
-
end
|
|
331
|
-
elsif value.respond_to? :to_hash
|
|
332
|
-
value.to_hash
|
|
333
|
-
else
|
|
334
|
-
value
|
|
335
|
-
end
|
|
336
|
-
end
|
|
337
|
-
|
|
338
281
|
end
|
|
339
282
|
|
|
340
283
|
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module RancherApi
|
|
17
17
|
# Result of a successful delete action.
|
|
18
|
-
class DeleteResult
|
|
18
|
+
class DeleteResult < ApiModelBase
|
|
19
19
|
# Solution cluster has been deleted.
|
|
20
20
|
attr_accessor :result
|
|
21
21
|
|
|
@@ -30,9 +30,14 @@ module RancherApi
|
|
|
30
30
|
}
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
+
# Returns attribute mapping this model knows about
|
|
34
|
+
def self.acceptable_attribute_map
|
|
35
|
+
attribute_map
|
|
36
|
+
end
|
|
37
|
+
|
|
33
38
|
# Returns all the JSON keys this model knows about
|
|
34
39
|
def self.acceptable_attributes
|
|
35
|
-
|
|
40
|
+
acceptable_attribute_map.values
|
|
36
41
|
end
|
|
37
42
|
|
|
38
43
|
# Attribute type mapping.
|
|
@@ -57,9 +62,10 @@ module RancherApi
|
|
|
57
62
|
end
|
|
58
63
|
|
|
59
64
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
65
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
60
66
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
61
|
-
if (!
|
|
62
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `RancherApi::DeleteResult`. Please check the name to make sure it's valid. List of attributes: " +
|
|
67
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
68
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `RancherApi::DeleteResult`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
63
69
|
end
|
|
64
70
|
h[k.to_sym] = v
|
|
65
71
|
}
|
|
@@ -102,6 +108,26 @@ module RancherApi
|
|
|
102
108
|
true
|
|
103
109
|
end
|
|
104
110
|
|
|
111
|
+
# Custom attribute writer method with validation
|
|
112
|
+
# @param [Object] result Value to be assigned
|
|
113
|
+
def result=(result)
|
|
114
|
+
if result.nil?
|
|
115
|
+
fail ArgumentError, 'result cannot be nil'
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
@result = result
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Custom attribute writer method with validation
|
|
122
|
+
# @param [Object] cluster_id Value to be assigned
|
|
123
|
+
def cluster_id=(cluster_id)
|
|
124
|
+
if cluster_id.nil?
|
|
125
|
+
fail ArgumentError, 'cluster_id cannot be nil'
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
@cluster_id = cluster_id
|
|
129
|
+
end
|
|
130
|
+
|
|
105
131
|
# Checks equality by comparing each attribute.
|
|
106
132
|
# @param [Object] Object to be compared
|
|
107
133
|
def ==(o)
|
|
@@ -146,61 +172,6 @@ module RancherApi
|
|
|
146
172
|
new(transformed_hash)
|
|
147
173
|
end
|
|
148
174
|
|
|
149
|
-
# Deserializes the data based on type
|
|
150
|
-
# @param string type Data type
|
|
151
|
-
# @param string value Value to be deserialized
|
|
152
|
-
# @return [Object] Deserialized data
|
|
153
|
-
def self._deserialize(type, value)
|
|
154
|
-
case type.to_sym
|
|
155
|
-
when :Time
|
|
156
|
-
Time.parse(value)
|
|
157
|
-
when :Date
|
|
158
|
-
Date.parse(value)
|
|
159
|
-
when :String
|
|
160
|
-
value.to_s
|
|
161
|
-
when :Integer
|
|
162
|
-
value.to_i
|
|
163
|
-
when :Float
|
|
164
|
-
value.to_f
|
|
165
|
-
when :Boolean
|
|
166
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
167
|
-
true
|
|
168
|
-
else
|
|
169
|
-
false
|
|
170
|
-
end
|
|
171
|
-
when :Object
|
|
172
|
-
# generic object (usually a Hash), return directly
|
|
173
|
-
value
|
|
174
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
175
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
176
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
177
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
178
|
-
k_type = Regexp.last_match[:k_type]
|
|
179
|
-
v_type = Regexp.last_match[:v_type]
|
|
180
|
-
{}.tap do |hash|
|
|
181
|
-
value.each do |k, v|
|
|
182
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
183
|
-
end
|
|
184
|
-
end
|
|
185
|
-
else # model
|
|
186
|
-
# models (e.g. Pet) or oneOf
|
|
187
|
-
klass = RancherApi.const_get(type)
|
|
188
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
189
|
-
end
|
|
190
|
-
end
|
|
191
|
-
|
|
192
|
-
# Returns the string representation of the object
|
|
193
|
-
# @return [String] String presentation of the object
|
|
194
|
-
def to_s
|
|
195
|
-
to_hash.to_s
|
|
196
|
-
end
|
|
197
|
-
|
|
198
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
199
|
-
# @return [Hash] Returns the object in the form of hash
|
|
200
|
-
def to_body
|
|
201
|
-
to_hash
|
|
202
|
-
end
|
|
203
|
-
|
|
204
175
|
# Returns the object in the form of hash
|
|
205
176
|
# @return [Hash] Returns the object in the form of hash
|
|
206
177
|
def to_hash
|
|
@@ -217,24 +188,6 @@ module RancherApi
|
|
|
217
188
|
hash
|
|
218
189
|
end
|
|
219
190
|
|
|
220
|
-
# Outputs non-array value in the form of hash
|
|
221
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
222
|
-
# @param [Object] value Any valid value
|
|
223
|
-
# @return [Hash] Returns the value in the form of hash
|
|
224
|
-
def _to_hash(value)
|
|
225
|
-
if value.is_a?(Array)
|
|
226
|
-
value.compact.map { |v| _to_hash(v) }
|
|
227
|
-
elsif value.is_a?(Hash)
|
|
228
|
-
{}.tap do |hash|
|
|
229
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
230
|
-
end
|
|
231
|
-
elsif value.respond_to? :to_hash
|
|
232
|
-
value.to_hash
|
|
233
|
-
else
|
|
234
|
-
value
|
|
235
|
-
end
|
|
236
|
-
end
|
|
237
|
-
|
|
238
191
|
end
|
|
239
192
|
|
|
240
193
|
end
|