pnap_rancher_api 1.0.0 → 1.0.2
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/README.md +4 -0
- data/VERSION +1 -1
- data/docs/Cluster.md +2 -2
- data/docs/ClusterConfiguration.md +30 -0
- data/docs/ClusterWorkloadConfiguration.md +24 -0
- data/docs/ClustersApi.md +1 -1
- data/docs/DeleteResult.md +1 -1
- data/docs/NodePool.md +1 -1
- data/docs/NodePoolSshConfig.md +22 -0
- data/docs/RancherClusterConfig.md +1 -1
- data/docs/RancherClusterConfigCertificates.md +22 -0
- data/lib/pnap_rancher_api/api/clusters_api.rb +3 -3
- data/lib/pnap_rancher_api/api_client.rb +4 -2
- data/lib/pnap_rancher_api/api_error.rb +1 -1
- data/lib/pnap_rancher_api/configuration.rb +3 -2
- data/lib/pnap_rancher_api/models/cluster.rb +4 -6
- data/lib/pnap_rancher_api/models/cluster_configuration.rb +290 -0
- data/lib/pnap_rancher_api/models/cluster_workload_configuration.rb +271 -0
- data/lib/pnap_rancher_api/models/delete_result.rb +7 -1
- data/lib/pnap_rancher_api/models/error.rb +2 -1
- data/lib/pnap_rancher_api/models/node.rb +2 -1
- data/lib/pnap_rancher_api/models/node_pool.rb +3 -3
- data/lib/pnap_rancher_api/models/node_pool_ssh_config.rb +253 -0
- data/lib/pnap_rancher_api/models/rancher_cluster_certificates.rb +2 -1
- data/lib/pnap_rancher_api/models/rancher_cluster_config.rb +3 -3
- data/lib/pnap_rancher_api/models/rancher_cluster_config_certificates.rb +247 -0
- data/lib/pnap_rancher_api/models/rancher_server_metadata.rb +2 -1
- data/lib/pnap_rancher_api/models/ssh_config.rb +2 -1
- data/lib/pnap_rancher_api/models/workload_cluster_config.rb +2 -1
- data/lib/pnap_rancher_api/version.rb +1 -1
- data/lib/pnap_rancher_api.rb +5 -1
- data/pnap_rancher_api.gemspec +2 -2
- data/spec/api_client_spec.rb +1 -1
- data/spec/configuration_spec.rb +1 -1
- data/spec/models/cluster_configuration_spec.rb +70 -0
- data/spec/models/cluster_workload_configuration_spec.rb +52 -0
- data/spec/models/node_pool_ssh_config_spec.rb +46 -0
- data/spec/models/rancher_cluster_config_certificates_spec.rb +46 -0
- data/spec/spec_helper.rb +1 -1
- metadata +26 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d912962a5ce26c096564b5e1b1a42f29d42355eddd59b756c48f58232a3cf07
|
4
|
+
data.tar.gz: e3d1bf9083096c355c48e32c3a33e917af00eabc66662a296090ce407c9bb72f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8a1c18fa6a21611d859bce67d9e8e4da3297a65f0611125e0b01342904a2d978b06fbadc7d2ea18ce15b5313880464c15ce411583a69f0fd586c3c51c551334
|
7
|
+
data.tar.gz: 2bd46c0deb00d913ff393d1de85bfa99c39b468c45f161408acdaab080ae75301bf8498d697491bd8a4ae4a20da3037658baea7b112dbde29f3144439eabff63
|
data/README.md
CHANGED
@@ -128,12 +128,16 @@ Class | Method | HTTP request | Description
|
|
128
128
|
## Documentation for Models
|
129
129
|
|
130
130
|
- [RancherApi::Cluster](docs/Cluster.md)
|
131
|
+
- [RancherApi::ClusterConfiguration](docs/ClusterConfiguration.md)
|
132
|
+
- [RancherApi::ClusterWorkloadConfiguration](docs/ClusterWorkloadConfiguration.md)
|
131
133
|
- [RancherApi::DeleteResult](docs/DeleteResult.md)
|
132
134
|
- [RancherApi::Error](docs/Error.md)
|
133
135
|
- [RancherApi::Node](docs/Node.md)
|
134
136
|
- [RancherApi::NodePool](docs/NodePool.md)
|
137
|
+
- [RancherApi::NodePoolSshConfig](docs/NodePoolSshConfig.md)
|
135
138
|
- [RancherApi::RancherClusterCertificates](docs/RancherClusterCertificates.md)
|
136
139
|
- [RancherApi::RancherClusterConfig](docs/RancherClusterConfig.md)
|
140
|
+
- [RancherApi::RancherClusterConfigCertificates](docs/RancherClusterConfigCertificates.md)
|
137
141
|
- [RancherApi::RancherServerMetadata](docs/RancherServerMetadata.md)
|
138
142
|
- [RancherApi::SshConfig](docs/SshConfig.md)
|
139
143
|
- [RancherApi::WorkloadClusterConfig](docs/WorkloadClusterConfig.md)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.2
|
data/docs/Cluster.md
CHANGED
@@ -10,9 +10,9 @@
|
|
10
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`, `SEA` or `AUS`. | |
|
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
|
-
| **configuration** | [**
|
13
|
+
| **configuration** | [**ClusterConfiguration**](ClusterConfiguration.md) | | [optional] |
|
14
14
|
| **metadata** | [**RancherServerMetadata**](RancherServerMetadata.md) | | [optional][readonly] |
|
15
|
-
| **workload_configuration** | [**
|
15
|
+
| **workload_configuration** | [**ClusterWorkloadConfiguration**](ClusterWorkloadConfiguration.md) | | [optional] |
|
16
16
|
| **status_description** | **String** | The cluster status | [optional][readonly] |
|
17
17
|
|
18
18
|
## Example
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# RancherApi::ClusterConfiguration
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **token** | **String** | Shared secret used to join a server or agent to a cluster. | [optional] |
|
8
|
+
| **tls_san** | **String** | This maps to ranchers `tls-san`. Add additional hostname or IP as a Subject Alternative Name in the TLS cert. | [optional] |
|
9
|
+
| **etcd_snapshot_schedule_cron** | **String** | This maps to ranchers `etcd-snapshot-schedule-cron`. Snapshot interval time in cron spec. eg. every 5 hours ‘0 */5 * * *’. Default: at 12 am/pm | [optional][default to '0 0,12 * * *'] |
|
10
|
+
| **etcd_snapshot_retention** | **Integer** | This maps to ranchers `etcd-snapshot-retention`. Number of snapshots to retain. | [optional][default to 5] |
|
11
|
+
| **node_taint** | **String** | This maps to ranchers `node-taint`. Registering kubelet with set of taints. By default, server nodes will be schedulable and thus your workloads can get launched on them. If you wish to have a dedicated control plane where no user workloads will run, you can use taints. | [optional] |
|
12
|
+
| **cluster_domain** | **String** | This maps to ranchers `cluster-domain`. Cluster Domain. | [optional] |
|
13
|
+
| **certificates** | [**RancherClusterConfigCertificates**](RancherClusterConfigCertificates.md) | | [optional] |
|
14
|
+
|
15
|
+
## Example
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
require 'pnap_rancher_api'
|
19
|
+
|
20
|
+
instance = RancherApi::ClusterConfiguration.new(
|
21
|
+
token: gS7SnDnY5st0ryJxMXA7,
|
22
|
+
tls_san: mydomain.com,
|
23
|
+
etcd_snapshot_schedule_cron: 0 0,12 * * *,
|
24
|
+
etcd_snapshot_retention: 5,
|
25
|
+
node_taint: CriticalAddonsOnly=true:NoExecute,
|
26
|
+
cluster_domain: cluster.local,
|
27
|
+
certificates: null
|
28
|
+
)
|
29
|
+
```
|
30
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# RancherApi::ClusterWorkloadConfiguration
|
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::ClusterWorkloadConfiguration.new(
|
18
|
+
name: Workload CLuster,
|
19
|
+
server_count: 3,
|
20
|
+
server_type: s0.d1.small,
|
21
|
+
location: PHX
|
22
|
+
)
|
23
|
+
```
|
24
|
+
|
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://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>.
|
223
|
+
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>. 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
|
|
data/docs/DeleteResult.md
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
| Name | Type | Description | Notes |
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
7
7
|
| **result** | **String** | Solution cluster has been deleted. | |
|
8
|
-
| **cluster_id** | **String** | The unique identifier of the solution cluster. |
|
8
|
+
| **cluster_id** | **String** | The unique identifier of the solution cluster. | |
|
9
9
|
|
10
10
|
## Example
|
11
11
|
|
data/docs/NodePool.md
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
| **name** | **String** | The name of the node pool. | [optional] |
|
8
8
|
| **node_count** | **Integer** | Number of configured nodes, currently only node counts of 1 and 3 are possible. | [optional] |
|
9
9
|
| **server_type** | **String** | Node server type. Cannot be changed once a server 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`, `s2.c1.small`, `s2.c1.medium`, `s2.c1.large`, `s2.c2.small`, `s2.c2.medium`, `s2.c2.large`, `s1.e1.small`, `s1.e1.medium`, `s1.e1.large`. | [optional][default to 's0.d1.small'] |
|
10
|
-
| **ssh_config** | [**
|
10
|
+
| **ssh_config** | [**NodePoolSshConfig**](NodePoolSshConfig.md) | | [optional] |
|
11
11
|
| **nodes** | [**Array<Node>**](Node.md) | (Read-only) The nodes associated with this node pool. | [optional][readonly] |
|
12
12
|
|
13
13
|
## Example
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# RancherApi::NodePoolSshConfig
|
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::NodePoolSshConfig.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
|
+
|
@@ -10,7 +10,7 @@
|
|
10
10
|
| **etcd_snapshot_retention** | **Integer** | This maps to ranchers `etcd-snapshot-retention`. Number of snapshots to retain. | [optional][default to 5] |
|
11
11
|
| **node_taint** | **String** | This maps to ranchers `node-taint`. Registering kubelet with set of taints. By default, server nodes will be schedulable and thus your workloads can get launched on them. If you wish to have a dedicated control plane where no user workloads will run, you can use taints. | [optional] |
|
12
12
|
| **cluster_domain** | **String** | This maps to ranchers `cluster-domain`. Cluster Domain. | [optional] |
|
13
|
-
| **certificates** | [**
|
13
|
+
| **certificates** | [**RancherClusterConfigCertificates**](RancherClusterConfigCertificates.md) | | [optional] |
|
14
14
|
|
15
15
|
## Example
|
16
16
|
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# RancherApi::RancherClusterConfigCertificates
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **ca_certificate** | **String** | The SSL CA certificate to be used for rancher admin. | [optional] |
|
8
|
+
| **certificate** | **String** | The SSL certificate to be used for rancher admin. | [optional] |
|
9
|
+
| **certificate_key** | **String** | The SSL certificate key to be used for rancher admin. | [optional] |
|
10
|
+
|
11
|
+
## Example
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
require 'pnap_rancher_api'
|
15
|
+
|
16
|
+
instance = RancherApi::RancherClusterConfigCertificates.new(
|
17
|
+
ca_certificate: null,
|
18
|
+
certificate: null,
|
19
|
+
certificate_key: null
|
20
|
+
)
|
21
|
+
```
|
22
|
+
|
@@ -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
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 6.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -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://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>.
|
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>. 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 [Hash] opts the optional parameters
|
208
208
|
# @option opts [Cluster] :cluster
|
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://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>.
|
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>. 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 [Hash] opts the optional parameters
|
218
218
|
# @option opts [Cluster] :cluster
|
219
219
|
# @return [Array<(Cluster, Integer, Hash)>] Cluster data, response status code and response headers
|
@@ -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
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 6.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -95,6 +95,7 @@ module RancherApi
|
|
95
95
|
header_params = @default_headers.merge(opts[:header_params] || {})
|
96
96
|
query_params = opts[:query_params] || {}
|
97
97
|
form_params = opts[:form_params] || {}
|
98
|
+
follow_location = opts[:follow_location] || true
|
98
99
|
|
99
100
|
update_params_for_auth! header_params, query_params, opts[:auth_names]
|
100
101
|
|
@@ -111,7 +112,8 @@ module RancherApi
|
|
111
112
|
:ssl_verifyhost => _verify_ssl_host,
|
112
113
|
:sslcert => @config.cert_file,
|
113
114
|
:sslkey => @config.key_file,
|
114
|
-
:verbose => @config.debugging
|
115
|
+
:verbose => @config.debugging,
|
116
|
+
:followlocation => follow_location
|
115
117
|
}
|
116
118
|
|
117
119
|
# set custom cert, if provided
|
@@ -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
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 6.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -133,6 +133,7 @@ module RancherApi
|
|
133
133
|
# https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
|
134
134
|
attr_accessor :params_encoding
|
135
135
|
|
136
|
+
|
136
137
|
attr_accessor :inject_format
|
137
138
|
|
138
139
|
attr_accessor :force_ending_format
|
@@ -150,10 +151,10 @@ module RancherApi
|
|
150
151
|
@client_side_validation = true
|
151
152
|
@verify_ssl = true
|
152
153
|
@verify_ssl_host = true
|
153
|
-
@params_encoding = nil
|
154
154
|
@cert_file = nil
|
155
155
|
@key_file = nil
|
156
156
|
@timeout = 0
|
157
|
+
@params_encoding = nil
|
157
158
|
@debugging = false
|
158
159
|
@inject_format = false
|
159
160
|
@force_ending_format = false
|
@@ -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
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 6.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -73,9 +73,9 @@ module RancherApi
|
|
73
73
|
:'location' => :'String',
|
74
74
|
:'initial_cluster_version' => :'String',
|
75
75
|
:'node_pools' => :'Array<NodePool>',
|
76
|
-
:'configuration' => :'
|
76
|
+
:'configuration' => :'ClusterConfiguration',
|
77
77
|
:'metadata' => :'RancherServerMetadata',
|
78
|
-
:'workload_configuration' => :'
|
78
|
+
:'workload_configuration' => :'ClusterWorkloadConfiguration',
|
79
79
|
:'status_description' => :'String'
|
80
80
|
}
|
81
81
|
end
|
@@ -83,9 +83,6 @@ module RancherApi
|
|
83
83
|
# List of attributes with nullable: true
|
84
84
|
def self.openapi_nullable
|
85
85
|
Set.new([
|
86
|
-
:'configuration',
|
87
|
-
:'metadata',
|
88
|
-
:'workload_configuration',
|
89
86
|
])
|
90
87
|
end
|
91
88
|
|
@@ -230,6 +227,7 @@ module RancherApi
|
|
230
227
|
# @return [Object] Returns the model itself
|
231
228
|
def build_from_hash(attributes)
|
232
229
|
return nil unless attributes.is_a?(Hash)
|
230
|
+
attributes = attributes.transform_keys(&:to_sym)
|
233
231
|
self.class.openapi_types.each_pair do |key, type|
|
234
232
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
235
233
|
self.send("#{key}=", nil)
|
@@ -0,0 +1,290 @@
|
|
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: 6.1.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module RancherApi
|
17
|
+
class ClusterConfiguration
|
18
|
+
# Shared secret used to join a server or agent to a cluster.
|
19
|
+
attr_accessor :token
|
20
|
+
|
21
|
+
# This maps to ranchers `tls-san`. Add additional hostname or IP as a Subject Alternative Name in the TLS cert.
|
22
|
+
attr_accessor :tls_san
|
23
|
+
|
24
|
+
# This maps to ranchers `etcd-snapshot-schedule-cron`. Snapshot interval time in cron spec. eg. every 5 hours ‘0 */5 * * *’. Default: at 12 am/pm
|
25
|
+
attr_accessor :etcd_snapshot_schedule_cron
|
26
|
+
|
27
|
+
# This maps to ranchers `etcd-snapshot-retention`. Number of snapshots to retain.
|
28
|
+
attr_accessor :etcd_snapshot_retention
|
29
|
+
|
30
|
+
# This maps to ranchers `node-taint`. Registering kubelet with set of taints. By default, server nodes will be schedulable and thus your workloads can get launched on them. If you wish to have a dedicated control plane where no user workloads will run, you can use taints.
|
31
|
+
attr_accessor :node_taint
|
32
|
+
|
33
|
+
# This maps to ranchers `cluster-domain`. Cluster Domain.
|
34
|
+
attr_accessor :cluster_domain
|
35
|
+
|
36
|
+
attr_accessor :certificates
|
37
|
+
|
38
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
39
|
+
def self.attribute_map
|
40
|
+
{
|
41
|
+
:'token' => :'token',
|
42
|
+
:'tls_san' => :'tlsSan',
|
43
|
+
:'etcd_snapshot_schedule_cron' => :'etcdSnapshotScheduleCron',
|
44
|
+
:'etcd_snapshot_retention' => :'etcdSnapshotRetention',
|
45
|
+
:'node_taint' => :'nodeTaint',
|
46
|
+
:'cluster_domain' => :'clusterDomain',
|
47
|
+
:'certificates' => :'certificates'
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
# Returns all the JSON keys this model knows about
|
52
|
+
def self.acceptable_attributes
|
53
|
+
attribute_map.values
|
54
|
+
end
|
55
|
+
|
56
|
+
# Attribute type mapping.
|
57
|
+
def self.openapi_types
|
58
|
+
{
|
59
|
+
:'token' => :'String',
|
60
|
+
:'tls_san' => :'String',
|
61
|
+
:'etcd_snapshot_schedule_cron' => :'String',
|
62
|
+
:'etcd_snapshot_retention' => :'Integer',
|
63
|
+
:'node_taint' => :'String',
|
64
|
+
:'cluster_domain' => :'String',
|
65
|
+
:'certificates' => :'RancherClusterConfigCertificates'
|
66
|
+
}
|
67
|
+
end
|
68
|
+
|
69
|
+
# List of attributes with nullable: true
|
70
|
+
def self.openapi_nullable
|
71
|
+
Set.new([
|
72
|
+
])
|
73
|
+
end
|
74
|
+
|
75
|
+
# List of class defined in allOf (OpenAPI v3)
|
76
|
+
def self.openapi_all_of
|
77
|
+
[
|
78
|
+
:'RancherClusterConfig'
|
79
|
+
]
|
80
|
+
end
|
81
|
+
|
82
|
+
# Initializes the object
|
83
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
84
|
+
def initialize(attributes = {})
|
85
|
+
if (!attributes.is_a?(Hash))
|
86
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `RancherApi::ClusterConfiguration` initialize method"
|
87
|
+
end
|
88
|
+
|
89
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
90
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
91
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
92
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `RancherApi::ClusterConfiguration`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
93
|
+
end
|
94
|
+
h[k.to_sym] = v
|
95
|
+
}
|
96
|
+
|
97
|
+
if attributes.key?(:'token')
|
98
|
+
self.token = attributes[:'token']
|
99
|
+
end
|
100
|
+
|
101
|
+
if attributes.key?(:'tls_san')
|
102
|
+
self.tls_san = attributes[:'tls_san']
|
103
|
+
end
|
104
|
+
|
105
|
+
if attributes.key?(:'etcd_snapshot_schedule_cron')
|
106
|
+
self.etcd_snapshot_schedule_cron = attributes[:'etcd_snapshot_schedule_cron']
|
107
|
+
else
|
108
|
+
self.etcd_snapshot_schedule_cron = '0 0,12 * * *'
|
109
|
+
end
|
110
|
+
|
111
|
+
if attributes.key?(:'etcd_snapshot_retention')
|
112
|
+
self.etcd_snapshot_retention = attributes[:'etcd_snapshot_retention']
|
113
|
+
else
|
114
|
+
self.etcd_snapshot_retention = 5
|
115
|
+
end
|
116
|
+
|
117
|
+
if attributes.key?(:'node_taint')
|
118
|
+
self.node_taint = attributes[:'node_taint']
|
119
|
+
end
|
120
|
+
|
121
|
+
if attributes.key?(:'cluster_domain')
|
122
|
+
self.cluster_domain = attributes[:'cluster_domain']
|
123
|
+
end
|
124
|
+
|
125
|
+
if attributes.key?(:'certificates')
|
126
|
+
self.certificates = attributes[:'certificates']
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
131
|
+
# @return Array for valid properties with the reasons
|
132
|
+
def list_invalid_properties
|
133
|
+
invalid_properties = Array.new
|
134
|
+
invalid_properties
|
135
|
+
end
|
136
|
+
|
137
|
+
# Check to see if the all the properties in the model are valid
|
138
|
+
# @return true if the model is valid
|
139
|
+
def valid?
|
140
|
+
true
|
141
|
+
end
|
142
|
+
|
143
|
+
# Checks equality by comparing each attribute.
|
144
|
+
# @param [Object] Object to be compared
|
145
|
+
def ==(o)
|
146
|
+
return true if self.equal?(o)
|
147
|
+
self.class == o.class &&
|
148
|
+
token == o.token &&
|
149
|
+
tls_san == o.tls_san &&
|
150
|
+
etcd_snapshot_schedule_cron == o.etcd_snapshot_schedule_cron &&
|
151
|
+
etcd_snapshot_retention == o.etcd_snapshot_retention &&
|
152
|
+
node_taint == o.node_taint &&
|
153
|
+
cluster_domain == o.cluster_domain &&
|
154
|
+
certificates == o.certificates
|
155
|
+
end
|
156
|
+
|
157
|
+
# @see the `==` method
|
158
|
+
# @param [Object] Object to be compared
|
159
|
+
def eql?(o)
|
160
|
+
self == o
|
161
|
+
end
|
162
|
+
|
163
|
+
# Calculates hash code according to all attributes.
|
164
|
+
# @return [Integer] Hash code
|
165
|
+
def hash
|
166
|
+
[token, tls_san, etcd_snapshot_schedule_cron, etcd_snapshot_retention, node_taint, cluster_domain, certificates].hash
|
167
|
+
end
|
168
|
+
|
169
|
+
# Builds the object from hash
|
170
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
171
|
+
# @return [Object] Returns the model itself
|
172
|
+
def self.build_from_hash(attributes)
|
173
|
+
new.build_from_hash(attributes)
|
174
|
+
end
|
175
|
+
|
176
|
+
# Builds the object from hash
|
177
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
178
|
+
# @return [Object] Returns the model itself
|
179
|
+
def build_from_hash(attributes)
|
180
|
+
return nil unless attributes.is_a?(Hash)
|
181
|
+
attributes = attributes.transform_keys(&:to_sym)
|
182
|
+
self.class.openapi_types.each_pair do |key, type|
|
183
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
184
|
+
self.send("#{key}=", nil)
|
185
|
+
elsif type =~ /\AArray<(.*)>/i
|
186
|
+
# check to ensure the input is an array given that the attribute
|
187
|
+
# is documented as an array but the input is not
|
188
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
189
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
190
|
+
end
|
191
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
192
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
193
|
+
end
|
194
|
+
end
|
195
|
+
|
196
|
+
self
|
197
|
+
end
|
198
|
+
|
199
|
+
# Deserializes the data based on type
|
200
|
+
# @param string type Data type
|
201
|
+
# @param string value Value to be deserialized
|
202
|
+
# @return [Object] Deserialized data
|
203
|
+
def _deserialize(type, value)
|
204
|
+
case type.to_sym
|
205
|
+
when :Time
|
206
|
+
Time.parse(value)
|
207
|
+
when :Date
|
208
|
+
Date.parse(value)
|
209
|
+
when :String
|
210
|
+
value.to_s
|
211
|
+
when :Integer
|
212
|
+
value.to_i
|
213
|
+
when :Float
|
214
|
+
value.to_f
|
215
|
+
when :Boolean
|
216
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
217
|
+
true
|
218
|
+
else
|
219
|
+
false
|
220
|
+
end
|
221
|
+
when :Object
|
222
|
+
# generic object (usually a Hash), return directly
|
223
|
+
value
|
224
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
225
|
+
inner_type = Regexp.last_match[:inner_type]
|
226
|
+
value.map { |v| _deserialize(inner_type, v) }
|
227
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
228
|
+
k_type = Regexp.last_match[:k_type]
|
229
|
+
v_type = Regexp.last_match[:v_type]
|
230
|
+
{}.tap do |hash|
|
231
|
+
value.each do |k, v|
|
232
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
233
|
+
end
|
234
|
+
end
|
235
|
+
else # model
|
236
|
+
# models (e.g. Pet) or oneOf
|
237
|
+
klass = RancherApi.const_get(type)
|
238
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
239
|
+
end
|
240
|
+
end
|
241
|
+
|
242
|
+
# Returns the string representation of the object
|
243
|
+
# @return [String] String presentation of the object
|
244
|
+
def to_s
|
245
|
+
to_hash.to_s
|
246
|
+
end
|
247
|
+
|
248
|
+
# to_body is an alias to to_hash (backward compatibility)
|
249
|
+
# @return [Hash] Returns the object in the form of hash
|
250
|
+
def to_body
|
251
|
+
to_hash
|
252
|
+
end
|
253
|
+
|
254
|
+
# Returns the object in the form of hash
|
255
|
+
# @return [Hash] Returns the object in the form of hash
|
256
|
+
def to_hash
|
257
|
+
hash = {}
|
258
|
+
self.class.attribute_map.each_pair do |attr, param|
|
259
|
+
value = self.send(attr)
|
260
|
+
if value.nil?
|
261
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
262
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
263
|
+
end
|
264
|
+
|
265
|
+
hash[param] = _to_hash(value)
|
266
|
+
end
|
267
|
+
hash
|
268
|
+
end
|
269
|
+
|
270
|
+
# Outputs non-array value in the form of hash
|
271
|
+
# For object, use to_hash. Otherwise, just return the value
|
272
|
+
# @param [Object] value Any valid value
|
273
|
+
# @return [Hash] Returns the value in the form of hash
|
274
|
+
def _to_hash(value)
|
275
|
+
if value.is_a?(Array)
|
276
|
+
value.compact.map { |v| _to_hash(v) }
|
277
|
+
elsif value.is_a?(Hash)
|
278
|
+
{}.tap do |hash|
|
279
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
280
|
+
end
|
281
|
+
elsif value.respond_to? :to_hash
|
282
|
+
value.to_hash
|
283
|
+
else
|
284
|
+
value
|
285
|
+
end
|
286
|
+
end
|
287
|
+
|
288
|
+
end
|
289
|
+
|
290
|
+
end
|