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
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b3e1ebc4f9061db1c418c05fa8b4c1b0fb3e9fe72fb53d6ec755a745ab8513bf
|
4
|
+
data.tar.gz: 18138cc637f6bff2be3c9e74dcd0ee98b8a1b04163e68662ba0c54a6205332a8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9f048555f2302b2050964f9cf20a0fbcfcf5e3640ce36b613ba17a6f65d8e61241d01198a896a0b7fa481ba9c361c71fca578b23943a02e4120770948ed90f50
|
7
|
+
data.tar.gz: 48cc63e93d5e501295dfb804e227125c977272f6ceb02ea658c29af8aa8a8a3926f63b150b68467413962ea9a2e6c6714e073b16e780dbb463cf5b858dfa82e9
|
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,154 @@
|
|
1
|
+
# pnap_rancher_api
|
2
|
+
|
3
|
+
RancherApi - the Ruby gem for the Rancher Solution API
|
4
|
+
|
5
|
+
Simplify enterprise-grade Kubernetes cluster operations and management with Rancher on Bare Metal Cloud.
|
6
|
+
Deploy Kubernetes clusters using a few API calls.<br>
|
7
|
+
<br>
|
8
|
+
<span class='pnap-api-knowledge-base-link'>
|
9
|
+
Knowledge base articles to help you can be found
|
10
|
+
<a href='https://phoenixnap.com/kb/rancher-bmc-integration-kubernetes' target='_blank'>here</a>
|
11
|
+
</span><br>
|
12
|
+
<br>
|
13
|
+
<b>All URLs are relative to (https://api.phoenixnap.com/solutions/rancher/v1beta)</b>
|
14
|
+
|
15
|
+
|
16
|
+
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
17
|
+
|
18
|
+
- API version: 0.1
|
19
|
+
For more information, please visit [https://phoenixnap.com/](https://phoenixnap.com/)
|
20
|
+
|
21
|
+
## Installation
|
22
|
+
|
23
|
+
### Build a gem
|
24
|
+
|
25
|
+
To build the Ruby code into a gem:
|
26
|
+
|
27
|
+
```shell
|
28
|
+
gem build pnap_rancher_api.gemspec
|
29
|
+
```
|
30
|
+
|
31
|
+
Then either install the gem locally, replacing `<VERSION>` with the actual version:
|
32
|
+
|
33
|
+
```shell
|
34
|
+
gem install ./pnap_rancher_api-<VERSION>.gem
|
35
|
+
```
|
36
|
+
|
37
|
+
(for development, run `gem install --dev ./pnap_rancher_api-<VERSION>.gem` to install the development dependencies)
|
38
|
+
|
39
|
+
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
40
|
+
|
41
|
+
Finally add this to the Gemfile:
|
42
|
+
|
43
|
+
gem 'pnap_rancher_api', '~> <VERSION>'
|
44
|
+
|
45
|
+
### Install from Git
|
46
|
+
|
47
|
+
To install this Gem from this repository, you'll need to get Bundler by doing `gem install bundler`. Add the following line in your Gemfile:
|
48
|
+
|
49
|
+
gem 'pnap_rancher_api', git: 'https://github.com/phoenixnap/ruby-sdk-bmc-poc', glob: 'RancherApi/*.gemspec'
|
50
|
+
|
51
|
+
If you'd like the development version:
|
52
|
+
|
53
|
+
gem 'pnap_rancher_api', git: 'https://github.com/phoenixnap/ruby-sdk-bmc-poc', glob: 'RancherApi/*.gemspec', branch: 'develop'
|
54
|
+
|
55
|
+
Then run `bundle install`.
|
56
|
+
|
57
|
+
### Include the Ruby code directly
|
58
|
+
|
59
|
+
Include the Ruby code directly using `-I` as follows:
|
60
|
+
|
61
|
+
```shell
|
62
|
+
ruby -Ilib script.rb
|
63
|
+
```
|
64
|
+
|
65
|
+
## Getting Started
|
66
|
+
|
67
|
+
Please follow the [installation](#installation) procedure and then run the following code:
|
68
|
+
|
69
|
+
```ruby
|
70
|
+
# Load the gem
|
71
|
+
require 'pnap_rancher_api'
|
72
|
+
|
73
|
+
# Setup authorization
|
74
|
+
RancherApi.configure do |config|
|
75
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
76
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
77
|
+
end
|
78
|
+
|
79
|
+
api_instance = RancherApi::ClustersApi.new
|
80
|
+
|
81
|
+
begin
|
82
|
+
#Cluster list.
|
83
|
+
result = api_instance.clusters_get
|
84
|
+
p result
|
85
|
+
rescue RancherApi::ApiError => e
|
86
|
+
puts "Exception when calling ClustersApi->clusters_get: #{e}"
|
87
|
+
end
|
88
|
+
|
89
|
+
```
|
90
|
+
|
91
|
+
Authorization can also be setup by using the [`oauth`](https://github.com/oauth-xx/oauth2) library:
|
92
|
+
|
93
|
+
```ruby
|
94
|
+
# Load the gem
|
95
|
+
require 'pnap_rancher_api'
|
96
|
+
require 'oauth2'
|
97
|
+
|
98
|
+
# Setup variables for getting a token.
|
99
|
+
client_id = 'YOUR_CLIENT_ID'
|
100
|
+
client_secret = 'YOUR_CLIENT_SECRET'
|
101
|
+
auth_url = 'https://auth.phoenixnap.com/auth/realms/BMC/protocol/openid-connect/token'
|
102
|
+
|
103
|
+
|
104
|
+
# Setup authorization
|
105
|
+
RancherApi.configure do |config|
|
106
|
+
# Retrieve the token using OAuth2.
|
107
|
+
client = OAuth2::Client.new(client_id, client_secret, token_url: auth_url)
|
108
|
+
token = client.client_credentials.get_token
|
109
|
+
|
110
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
111
|
+
config.access_token = token.token
|
112
|
+
end
|
113
|
+
|
114
|
+
```
|
115
|
+
|
116
|
+
## Documentation for API Endpoints
|
117
|
+
|
118
|
+
All URIs are relative to *https://api.phoenixnap.com/solutions/rancher/v1beta*
|
119
|
+
|
120
|
+
Class | Method | HTTP request | Description
|
121
|
+
------------ | ------------- | ------------- | -------------
|
122
|
+
*RancherApi::ClustersApi* | [**clusters_get**](docs/ClustersApi.md#clusters_get) | **GET** /clusters | Cluster list.
|
123
|
+
*RancherApi::ClustersApi* | [**clusters_id_delete**](docs/ClustersApi.md#clusters_id_delete) | **DELETE** /clusters/{id} | Delete a cluster.
|
124
|
+
*RancherApi::ClustersApi* | [**clusters_id_get**](docs/ClustersApi.md#clusters_id_get) | **GET** /clusters/{id} | Retrieve a Cluster
|
125
|
+
*RancherApi::ClustersApi* | [**clusters_post**](docs/ClustersApi.md#clusters_post) | **POST** /clusters | Create a Rancher Server Deployment.
|
126
|
+
|
127
|
+
|
128
|
+
## Documentation for Models
|
129
|
+
|
130
|
+
- [RancherApi::Cluster](docs/Cluster.md)
|
131
|
+
- [RancherApi::DeleteResult](docs/DeleteResult.md)
|
132
|
+
- [RancherApi::Error](docs/Error.md)
|
133
|
+
- [RancherApi::Node](docs/Node.md)
|
134
|
+
- [RancherApi::NodePool](docs/NodePool.md)
|
135
|
+
- [RancherApi::RancherClusterCertificates](docs/RancherClusterCertificates.md)
|
136
|
+
- [RancherApi::RancherClusterConfig](docs/RancherClusterConfig.md)
|
137
|
+
- [RancherApi::RancherServerMetadata](docs/RancherServerMetadata.md)
|
138
|
+
- [RancherApi::SshConfig](docs/SshConfig.md)
|
139
|
+
- [RancherApi::WorkloadClusterConfig](docs/WorkloadClusterConfig.md)
|
140
|
+
|
141
|
+
|
142
|
+
## Documentation for Authorization
|
143
|
+
|
144
|
+
|
145
|
+
### OAuth2
|
146
|
+
|
147
|
+
|
148
|
+
- **Type**: OAuth
|
149
|
+
- **Flow**: application
|
150
|
+
- **Authorization URL**:
|
151
|
+
- **Scopes**:
|
152
|
+
- bmc: Grants full access to bmc-api.
|
153
|
+
- bmc.read: Grants read only access to bmc-api.
|
154
|
+
|
data/Rakefile
ADDED
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.0.0
|
data/docs/Cluster.md
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# RancherApi::Cluster
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **id** | **String** | (Read-only) The Cluster identifier. | [optional][readonly] |
|
8
|
+
| **name** | **String** | Cluster name. This field is autogenerated if not provided. | [optional] |
|
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`, `SEA` or `AUS`. | |
|
11
|
+
| **initial_cluster_version** | **String** | (Read-only) The Rancher version that was installed on the cluster during the first creation process. | [optional][readonly] |
|
12
|
+
| **node_pools** | [**Array<NodePool>**](NodePool.md) | The node pools associated with the cluster. | [optional] |
|
13
|
+
| **configuration** | [**RancherClusterConfig**](RancherClusterConfig.md) | | [optional] |
|
14
|
+
| **metadata** | [**RancherServerMetadata**](RancherServerMetadata.md) | | [optional][readonly] |
|
15
|
+
| **workload_configuration** | [**WorkloadClusterConfig**](WorkloadClusterConfig.md) | | [optional] |
|
16
|
+
| **status_description** | **String** | The cluster status | [optional][readonly] |
|
17
|
+
|
18
|
+
## Example
|
19
|
+
|
20
|
+
```ruby
|
21
|
+
require 'pnap_rancher_api'
|
22
|
+
|
23
|
+
instance = RancherApi::Cluster.new(
|
24
|
+
id: 6047127fed34ecc3ba8402d2,
|
25
|
+
name: Rancher Management Cluster,
|
26
|
+
description: My first Rancher Server Cluster.,
|
27
|
+
location: PHX,
|
28
|
+
initial_cluster_version: v2.5.9,
|
29
|
+
node_pools: null,
|
30
|
+
configuration: null,
|
31
|
+
metadata: null,
|
32
|
+
workload_configuration: null,
|
33
|
+
status_description: Creating
|
34
|
+
)
|
35
|
+
```
|
36
|
+
|
data/docs/ClustersApi.md
ADDED
@@ -0,0 +1,286 @@
|
|
1
|
+
# RancherApi::ClustersApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://api.phoenixnap.com/solutions/rancher/v1beta*
|
4
|
+
|
5
|
+
| Method | HTTP request | Description |
|
6
|
+
| ------ | ------------ | ----------- |
|
7
|
+
| [**clusters_get**](ClustersApi.md#clusters_get) | **GET** /clusters | Cluster list. |
|
8
|
+
| [**clusters_id_delete**](ClustersApi.md#clusters_id_delete) | **DELETE** /clusters/{id} | Delete a cluster. |
|
9
|
+
| [**clusters_id_get**](ClustersApi.md#clusters_id_get) | **GET** /clusters/{id} | Retrieve a Cluster |
|
10
|
+
| [**clusters_post**](ClustersApi.md#clusters_post) | **POST** /clusters | Create a Rancher Server Deployment. |
|
11
|
+
|
12
|
+
|
13
|
+
## clusters_get
|
14
|
+
|
15
|
+
> <Array<Cluster>> clusters_get
|
16
|
+
|
17
|
+
Cluster list.
|
18
|
+
|
19
|
+
Cluster list.
|
20
|
+
|
21
|
+
### Examples
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
require 'time'
|
25
|
+
require 'pnap_rancher_api'
|
26
|
+
# setup authorization
|
27
|
+
RancherApi.configure do |config|
|
28
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
29
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
30
|
+
end
|
31
|
+
|
32
|
+
api_instance = RancherApi::ClustersApi.new
|
33
|
+
|
34
|
+
begin
|
35
|
+
# Cluster list.
|
36
|
+
result = api_instance.clusters_get
|
37
|
+
p result
|
38
|
+
rescue RancherApi::ApiError => e
|
39
|
+
puts "Error when calling ClustersApi->clusters_get: #{e}"
|
40
|
+
end
|
41
|
+
```
|
42
|
+
|
43
|
+
#### Using the clusters_get_with_http_info variant
|
44
|
+
|
45
|
+
This returns an Array which contains the response data, status code and headers.
|
46
|
+
|
47
|
+
> <Array(<Array<Cluster>>, Integer, Hash)> clusters_get_with_http_info
|
48
|
+
|
49
|
+
```ruby
|
50
|
+
begin
|
51
|
+
# Cluster list.
|
52
|
+
data, status_code, headers = api_instance.clusters_get_with_http_info
|
53
|
+
p status_code # => 2xx
|
54
|
+
p headers # => { ... }
|
55
|
+
p data # => <Array<Cluster>>
|
56
|
+
rescue RancherApi::ApiError => e
|
57
|
+
puts "Error when calling ClustersApi->clusters_get_with_http_info: #{e}"
|
58
|
+
end
|
59
|
+
```
|
60
|
+
|
61
|
+
### Parameters
|
62
|
+
|
63
|
+
This endpoint does not need any parameter.
|
64
|
+
|
65
|
+
### Return type
|
66
|
+
|
67
|
+
[**Array<Cluster>**](Cluster.md)
|
68
|
+
|
69
|
+
### Authorization
|
70
|
+
|
71
|
+
[OAuth2](../README.md#OAuth2)
|
72
|
+
|
73
|
+
### HTTP request headers
|
74
|
+
|
75
|
+
- **Content-Type**: Not defined
|
76
|
+
- **Accept**: application/json
|
77
|
+
|
78
|
+
|
79
|
+
## clusters_id_delete
|
80
|
+
|
81
|
+
> <DeleteResult> clusters_id_delete(id)
|
82
|
+
|
83
|
+
Delete a cluster.
|
84
|
+
|
85
|
+
Delete a cluster.
|
86
|
+
|
87
|
+
### Examples
|
88
|
+
|
89
|
+
```ruby
|
90
|
+
require 'time'
|
91
|
+
require 'pnap_rancher_api'
|
92
|
+
# setup authorization
|
93
|
+
RancherApi.configure do |config|
|
94
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
95
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
96
|
+
end
|
97
|
+
|
98
|
+
api_instance = RancherApi::ClustersApi.new
|
99
|
+
id = '123' # String | The Cluster identifier.
|
100
|
+
|
101
|
+
begin
|
102
|
+
# Delete a cluster.
|
103
|
+
result = api_instance.clusters_id_delete(id)
|
104
|
+
p result
|
105
|
+
rescue RancherApi::ApiError => e
|
106
|
+
puts "Error when calling ClustersApi->clusters_id_delete: #{e}"
|
107
|
+
end
|
108
|
+
```
|
109
|
+
|
110
|
+
#### Using the clusters_id_delete_with_http_info variant
|
111
|
+
|
112
|
+
This returns an Array which contains the response data, status code and headers.
|
113
|
+
|
114
|
+
> <Array(<DeleteResult>, Integer, Hash)> clusters_id_delete_with_http_info(id)
|
115
|
+
|
116
|
+
```ruby
|
117
|
+
begin
|
118
|
+
# Delete a cluster.
|
119
|
+
data, status_code, headers = api_instance.clusters_id_delete_with_http_info(id)
|
120
|
+
p status_code # => 2xx
|
121
|
+
p headers # => { ... }
|
122
|
+
p data # => <DeleteResult>
|
123
|
+
rescue RancherApi::ApiError => e
|
124
|
+
puts "Error when calling ClustersApi->clusters_id_delete_with_http_info: #{e}"
|
125
|
+
end
|
126
|
+
```
|
127
|
+
|
128
|
+
### Parameters
|
129
|
+
|
130
|
+
| Name | Type | Description | Notes |
|
131
|
+
| ---- | ---- | ----------- | ----- |
|
132
|
+
| **id** | **String** | The Cluster identifier. | |
|
133
|
+
|
134
|
+
### Return type
|
135
|
+
|
136
|
+
[**DeleteResult**](DeleteResult.md)
|
137
|
+
|
138
|
+
### Authorization
|
139
|
+
|
140
|
+
[OAuth2](../README.md#OAuth2)
|
141
|
+
|
142
|
+
### HTTP request headers
|
143
|
+
|
144
|
+
- **Content-Type**: Not defined
|
145
|
+
- **Accept**: application/json
|
146
|
+
|
147
|
+
|
148
|
+
## clusters_id_get
|
149
|
+
|
150
|
+
> <Cluster> clusters_id_get(id)
|
151
|
+
|
152
|
+
Retrieve a Cluster
|
153
|
+
|
154
|
+
Retrieve a Cluster
|
155
|
+
|
156
|
+
### Examples
|
157
|
+
|
158
|
+
```ruby
|
159
|
+
require 'time'
|
160
|
+
require 'pnap_rancher_api'
|
161
|
+
# setup authorization
|
162
|
+
RancherApi.configure do |config|
|
163
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
164
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
165
|
+
end
|
166
|
+
|
167
|
+
api_instance = RancherApi::ClustersApi.new
|
168
|
+
id = '123' # String | The Cluster identifier.
|
169
|
+
|
170
|
+
begin
|
171
|
+
# Retrieve a Cluster
|
172
|
+
result = api_instance.clusters_id_get(id)
|
173
|
+
p result
|
174
|
+
rescue RancherApi::ApiError => e
|
175
|
+
puts "Error when calling ClustersApi->clusters_id_get: #{e}"
|
176
|
+
end
|
177
|
+
```
|
178
|
+
|
179
|
+
#### Using the clusters_id_get_with_http_info variant
|
180
|
+
|
181
|
+
This returns an Array which contains the response data, status code and headers.
|
182
|
+
|
183
|
+
> <Array(<Cluster>, Integer, Hash)> clusters_id_get_with_http_info(id)
|
184
|
+
|
185
|
+
```ruby
|
186
|
+
begin
|
187
|
+
# Retrieve a Cluster
|
188
|
+
data, status_code, headers = api_instance.clusters_id_get_with_http_info(id)
|
189
|
+
p status_code # => 2xx
|
190
|
+
p headers # => { ... }
|
191
|
+
p data # => <Cluster>
|
192
|
+
rescue RancherApi::ApiError => e
|
193
|
+
puts "Error when calling ClustersApi->clusters_id_get_with_http_info: #{e}"
|
194
|
+
end
|
195
|
+
```
|
196
|
+
|
197
|
+
### Parameters
|
198
|
+
|
199
|
+
| Name | Type | Description | Notes |
|
200
|
+
| ---- | ---- | ----------- | ----- |
|
201
|
+
| **id** | **String** | The Cluster identifier. | |
|
202
|
+
|
203
|
+
### Return type
|
204
|
+
|
205
|
+
[**Cluster**](Cluster.md)
|
206
|
+
|
207
|
+
### Authorization
|
208
|
+
|
209
|
+
[OAuth2](../README.md#OAuth2)
|
210
|
+
|
211
|
+
### HTTP request headers
|
212
|
+
|
213
|
+
- **Content-Type**: Not defined
|
214
|
+
- **Accept**: application/json
|
215
|
+
|
216
|
+
|
217
|
+
## clusters_post
|
218
|
+
|
219
|
+
> <Cluster> clusters_post(opts)
|
220
|
+
|
221
|
+
Create a Rancher Server Deployment.
|
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>.
|
224
|
+
|
225
|
+
### Examples
|
226
|
+
|
227
|
+
```ruby
|
228
|
+
require 'time'
|
229
|
+
require 'pnap_rancher_api'
|
230
|
+
# setup authorization
|
231
|
+
RancherApi.configure do |config|
|
232
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
233
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
234
|
+
end
|
235
|
+
|
236
|
+
api_instance = RancherApi::ClustersApi.new
|
237
|
+
opts = {
|
238
|
+
cluster: RancherApi::Cluster.new({location: 'PHX'}) # Cluster |
|
239
|
+
}
|
240
|
+
|
241
|
+
begin
|
242
|
+
# Create a Rancher Server Deployment.
|
243
|
+
result = api_instance.clusters_post(opts)
|
244
|
+
p result
|
245
|
+
rescue RancherApi::ApiError => e
|
246
|
+
puts "Error when calling ClustersApi->clusters_post: #{e}"
|
247
|
+
end
|
248
|
+
```
|
249
|
+
|
250
|
+
#### Using the clusters_post_with_http_info variant
|
251
|
+
|
252
|
+
This returns an Array which contains the response data, status code and headers.
|
253
|
+
|
254
|
+
> <Array(<Cluster>, Integer, Hash)> clusters_post_with_http_info(opts)
|
255
|
+
|
256
|
+
```ruby
|
257
|
+
begin
|
258
|
+
# Create a Rancher Server Deployment.
|
259
|
+
data, status_code, headers = api_instance.clusters_post_with_http_info(opts)
|
260
|
+
p status_code # => 2xx
|
261
|
+
p headers # => { ... }
|
262
|
+
p data # => <Cluster>
|
263
|
+
rescue RancherApi::ApiError => e
|
264
|
+
puts "Error when calling ClustersApi->clusters_post_with_http_info: #{e}"
|
265
|
+
end
|
266
|
+
```
|
267
|
+
|
268
|
+
### Parameters
|
269
|
+
|
270
|
+
| Name | Type | Description | Notes |
|
271
|
+
| ---- | ---- | ----------- | ----- |
|
272
|
+
| **cluster** | [**Cluster**](Cluster.md) | | [optional] |
|
273
|
+
|
274
|
+
### Return type
|
275
|
+
|
276
|
+
[**Cluster**](Cluster.md)
|
277
|
+
|
278
|
+
### Authorization
|
279
|
+
|
280
|
+
[OAuth2](../README.md#OAuth2)
|
281
|
+
|
282
|
+
### HTTP request headers
|
283
|
+
|
284
|
+
- **Content-Type**: application/json
|
285
|
+
- **Accept**: application/json
|
286
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# RancherApi::DeleteResult
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **result** | **String** | Solution cluster has been deleted. | |
|
8
|
+
| **cluster_id** | **String** | The unique identifier of the solution cluster. | [optional] |
|
9
|
+
|
10
|
+
## Example
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
require 'pnap_rancher_api'
|
14
|
+
|
15
|
+
instance = RancherApi::DeleteResult.new(
|
16
|
+
result: Solution cluster has been deleted.,
|
17
|
+
cluster_id: x78sdkjds879sd7cx8
|
18
|
+
)
|
19
|
+
```
|
20
|
+
|
data/docs/Error.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# RancherApi::Error
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **message** | **String** | The description detailing the cause of the error code. | [readonly] |
|
8
|
+
| **validation_errors** | **Array<String>** | Validation errors, if any. | [optional][readonly] |
|
9
|
+
|
10
|
+
## Example
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
require 'pnap_rancher_api'
|
14
|
+
|
15
|
+
instance = RancherApi::Error.new(
|
16
|
+
message: null,
|
17
|
+
validation_errors: null
|
18
|
+
)
|
19
|
+
```
|
20
|
+
|
data/docs/Node.md
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# RancherApi::Node
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **server_id** | **String** | The server identifier. | [optional] |
|
8
|
+
|
9
|
+
## Example
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require 'pnap_rancher_api'
|
13
|
+
|
14
|
+
instance = RancherApi::Node.new(
|
15
|
+
server_id: 60b08f04adab617be44068bb
|
16
|
+
)
|
17
|
+
```
|
18
|
+
|
data/docs/NodePool.md
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# RancherApi::NodePool
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **name** | **String** | The name of the node pool. | [optional] |
|
8
|
+
| **node_count** | **Integer** | Number of configured nodes, currently only node counts of 1 and 3 are possible. | [optional] |
|
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** | [**SshConfig**](SshConfig.md) | | [optional] |
|
11
|
+
| **nodes** | [**Array<Node>**](Node.md) | (Read-only) The nodes associated with this node pool. | [optional][readonly] |
|
12
|
+
|
13
|
+
## Example
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
require 'pnap_rancher_api'
|
17
|
+
|
18
|
+
instance = RancherApi::NodePool.new(
|
19
|
+
name: Rancher Server node pool.,
|
20
|
+
node_count: null,
|
21
|
+
server_type: s0.d1.small,
|
22
|
+
ssh_config: null,
|
23
|
+
nodes: null
|
24
|
+
)
|
25
|
+
```
|
26
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# RancherApi::RancherClusterCertificates
|
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::RancherClusterCertificates.new(
|
17
|
+
ca_certificate: null,
|
18
|
+
certificate: null,
|
19
|
+
certificate_key: null
|
20
|
+
)
|
21
|
+
```
|
22
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# RancherApi::RancherClusterConfig
|
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** | [**RancherClusterCertificates**](RancherClusterCertificates.md) | | [optional] |
|
14
|
+
|
15
|
+
## Example
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
require 'pnap_rancher_api'
|
19
|
+
|
20
|
+
instance = RancherApi::RancherClusterConfig.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,22 @@
|
|
1
|
+
# RancherApi::RancherServerMetadata
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **url** | **String** | The Rancher Server URL. | [optional] |
|
8
|
+
| **username** | **String** | The username to use to login to the Rancher Server. This field is returned only as a response to the create cluster request. Make sure to take note or you will not be able to access the server. | [optional] |
|
9
|
+
| **password** | **String** | This is the password to be used to login to the Rancher Server. This field is returned only as a response to the create cluster request. Make sure to take note or you will not be able to access the server. | [optional] |
|
10
|
+
|
11
|
+
## Example
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
require 'pnap_rancher_api'
|
15
|
+
|
16
|
+
instance = RancherApi::RancherServerMetadata.new(
|
17
|
+
url: https://rancher/,
|
18
|
+
username: admin,
|
19
|
+
password: 1234567890abcd!
|
20
|
+
)
|
21
|
+
```
|
22
|
+
|