rancher-api-beta 0.8.0.pre.beta → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.gitlab-ci.yml +2 -2
- data/.rubocop.yml +2 -0
- data/.simplecov +1 -0
- data/Gemfile.lock +21 -4
- data/README.md +15 -0
- data/bin/console +3 -3
- data/bin/discover_api +13 -0
- data/lib/rancher/api.rb +1 -0
- data/lib/rancher/api/helpers.rb +6 -0
- data/lib/rancher/api/helpers/instance.rb +66 -0
- data/lib/rancher/api/helpers/machine.rb +42 -0
- data/lib/rancher/api/helpers/project.rb +20 -0
- data/lib/rancher/api/models.rb +158 -6
- data/lib/rancher/api/models/account.rb +57 -0
- data/lib/rancher/api/models/activesetting.rb +13 -0
- data/lib/rancher/api/models/addoutputsinput.rb +12 -0
- data/lib/rancher/api/models/addremoveservicelinkinput.rb +12 -0
- data/lib/rancher/api/models/agent.rb +23 -0
- data/lib/rancher/api/models/amazonec2config.rb +20 -0
- data/lib/rancher/api/models/apikey.rb +20 -0
- data/lib/rancher/api/models/auditlog.rb +21 -0
- data/lib/rancher/api/models/azureadconfig.rb +16 -0
- data/lib/rancher/api/models/azureconfig.rb +19 -0
- data/lib/rancher/api/models/backup.rb +24 -0
- data/lib/rancher/api/models/backuptarget.rb +18 -0
- data/lib/rancher/api/models/basemachineconfig.rb +12 -0
- data/lib/rancher/api/models/binding.rb +12 -0
- data/lib/rancher/api/models/blkiodeviceoption.rb +12 -0
- data/lib/rancher/api/models/catalogtemplate.rb +16 -0
- data/lib/rancher/api/models/certificate.rb +20 -0
- data/lib/rancher/api/models/changesecretinput.rb +12 -0
- data/lib/rancher/api/models/clustermembership.rb +13 -0
- data/lib/rancher/api/models/composeconfig.rb +12 -0
- data/lib/rancher/api/models/composeconfiginput.rb +12 -0
- data/lib/rancher/api/models/composeproject.rb +28 -0
- data/lib/rancher/api/models/composeservice.rb +30 -0
- data/lib/rancher/api/models/configitem.rb +12 -0
- data/lib/rancher/api/models/configitemstatus.rb +18 -0
- data/lib/rancher/api/models/container.rb +65 -0
- data/lib/rancher/api/models/containerevent.rb +20 -0
- data/lib/rancher/api/models/containerexec.rb +12 -0
- data/lib/rancher/api/models/containerlogs.rb +12 -0
- data/lib/rancher/api/models/containerproxy.rb +12 -0
- data/lib/rancher/api/models/credential.rb +20 -0
- data/lib/rancher/api/models/databasechangelog.rb +14 -0
- data/lib/rancher/api/models/databasechangeloglock.rb +12 -0
- data/lib/rancher/api/models/defaultnetwork.rb +21 -0
- data/lib/rancher/api/models/digitaloceanconfig.rb +14 -0
- data/lib/rancher/api/models/dnsservice.rb +30 -0
- data/lib/rancher/api/models/dockerbuild.rb +13 -0
- data/lib/rancher/api/models/extensionimplementation.rb +12 -0
- data/lib/rancher/api/models/extensionpoint.rb +12 -0
- data/lib/rancher/api/models/externaldnsevent.rb +20 -0
- data/lib/rancher/api/models/externalevent.rb +19 -0
- data/lib/rancher/api/models/externalhandler.rb +18 -0
- data/lib/rancher/api/models/externalhandlerexternalhandlerprocessmap.rb +20 -0
- data/lib/rancher/api/models/externalhandlerprocess.rb +17 -0
- data/lib/rancher/api/models/externalhandlerprocessconfig.rb +12 -0
- data/lib/rancher/api/models/externalhostevent.rb +21 -0
- data/lib/rancher/api/models/externalservice.rb +30 -0
- data/lib/rancher/api/models/externalserviceevent.rb +19 -0
- data/lib/rancher/api/models/externalstoragepoolevent.rb +19 -0
- data/lib/rancher/api/models/externalvolumeevent.rb +19 -0
- data/lib/rancher/api/models/fielddocumentation.rb +12 -0
- data/lib/rancher/api/models/genericobject.rb +18 -0
- data/lib/rancher/api/models/haconfig.rb +12 -0
- data/lib/rancher/api/models/haconfiginput.rb +15 -0
- data/lib/rancher/api/models/healthcheckinstancehostmap.rb +22 -0
- data/lib/rancher/api/models/host.rb +29 -1
- data/lib/rancher/api/models/hostaccess.rb +12 -0
- data/lib/rancher/api/models/hostapiproxytoken.rb +12 -0
- data/lib/rancher/api/models/hosttemplate.rb +19 -0
- data/lib/rancher/api/models/identity.rb +15 -0
- data/lib/rancher/api/models/image.rb +20 -0
- data/lib/rancher/api/models/inserviceupgradestrategy.rb +13 -0
- data/lib/rancher/api/models/instance.rb +23 -65
- data/lib/rancher/api/models/instanceconsole.rb +12 -0
- data/lib/rancher/api/models/instanceconsoleinput.rb +12 -0
- data/lib/rancher/api/models/instancehealthcheck.rb +14 -0
- data/lib/rancher/api/models/instancelink.rb +22 -0
- data/lib/rancher/api/models/instancestop.rb +12 -0
- data/lib/rancher/api/models/ipaddress.rb +12 -1
- data/lib/rancher/api/models/kubernetesservice.rb +29 -0
- data/lib/rancher/api/models/kubernetesstack.rb +29 -0
- data/lib/rancher/api/models/kubernetesstackupgrade.rb +12 -0
- data/lib/rancher/api/models/label.rb +20 -0
- data/lib/rancher/api/models/launchconfig.rb +66 -0
- data/lib/rancher/api/models/lbconfig.rb +14 -0
- data/lib/rancher/api/models/lbtargetconfig.rb +12 -0
- data/lib/rancher/api/models/ldapconfig.rb +16 -0
- data/lib/rancher/api/models/loadbalancercookiestickinesspolicy.rb +13 -0
- data/lib/rancher/api/models/loadbalancerservice.rb +31 -0
- data/lib/rancher/api/models/localauthconfig.rb +12 -0
- data/lib/rancher/api/models/logconfig.rb +12 -0
- data/lib/rancher/api/models/machine.rb +11 -34
- data/lib/rancher/api/models/machinedriver.rb +15 -0
- data/lib/rancher/api/models/mount.rb +22 -0
- data/lib/rancher/api/models/mountentry.rb +15 -0
- data/lib/rancher/api/models/network.rb +23 -0
- data/lib/rancher/api/models/networkdriver.rb +21 -0
- data/lib/rancher/api/models/networkdriverservice.rb +32 -0
- data/lib/rancher/api/models/networkpolicyrule.rb +13 -0
- data/lib/rancher/api/models/networkpolicyrulebetween.rb +12 -0
- data/lib/rancher/api/models/networkpolicyrulemember.rb +12 -0
- data/lib/rancher/api/models/networkpolicyrulewithin.rb +12 -0
- data/lib/rancher/api/models/nfsconfig.rb +12 -0
- data/lib/rancher/api/models/openldapconfig.rb +17 -0
- data/lib/rancher/api/models/{environment.rb → packetconfig.rb} +4 -3
- data/lib/rancher/api/models/password.rb +20 -0
- data/lib/rancher/api/models/physicalhost.rb +19 -0
- data/lib/rancher/api/models/port.rb +25 -0
- data/lib/rancher/api/models/portrule.rb +15 -0
- data/lib/rancher/api/models/processdefinition.rb +13 -0
- data/lib/rancher/api/models/processexecution.rb +15 -0
- data/lib/rancher/api/models/processinstance.rb +22 -0
- data/lib/rancher/api/models/processpool.rb +13 -0
- data/lib/rancher/api/models/processsummary.rb +12 -0
- data/lib/rancher/api/models/project.rb +48 -9
- data/lib/rancher/api/models/projectmember.rb +18 -0
- data/lib/rancher/api/models/projecttemplate.rb +19 -0
- data/lib/rancher/api/models/publicendpoint.rb +16 -0
- data/lib/rancher/api/models/publish.rb +16 -0
- data/lib/rancher/api/models/pulltask.rb +18 -0
- data/lib/rancher/api/models/recreateonquorumstrategyconfig.rb +12 -0
- data/lib/rancher/api/models/register.rb +18 -0
- data/lib/rancher/api/models/registrationtoken.rb +20 -0
- data/lib/rancher/api/models/registry.rb +11 -1
- data/lib/rancher/api/models/registrycredential.rb +11 -1
- data/lib/rancher/api/models/resourcedefinition.rb +12 -0
- data/lib/rancher/api/models/restartpolicy.rb +12 -0
- data/lib/rancher/api/models/restorefrombackupinput.rb +14 -0
- data/lib/rancher/api/models/reverttosnapshotinput.rb +14 -0
- data/lib/rancher/api/models/rollingrestartstrategy.rb +12 -0
- data/lib/rancher/api/models/scalepolicy.rb +12 -0
- data/lib/rancher/api/models/scheduledupgrade.rb +19 -0
- data/lib/rancher/api/models/schema.rb +13 -0
- data/lib/rancher/api/models/secondarylaunchconfig.rb +66 -0
- data/lib/rancher/api/models/secret.rb +17 -0
- data/lib/rancher/api/models/secretreference.rb +14 -0
- data/lib/rancher/api/models/service.rb +21 -2
- data/lib/rancher/api/models/servicebinding.rb +12 -0
- data/lib/rancher/api/models/serviceconsumemap.rb +23 -0
- data/lib/rancher/api/models/serviceevent.rb +22 -0
- data/lib/rancher/api/models/serviceexposemap.rb +22 -0
- data/lib/rancher/api/models/servicelink.rb +14 -0
- data/lib/rancher/api/models/servicelog.rb +22 -0
- data/lib/rancher/api/models/serviceproxy.rb +12 -0
- data/lib/rancher/api/models/servicerestart.rb +12 -0
- data/lib/rancher/api/models/servicesportrange.rb +12 -0
- data/lib/rancher/api/models/serviceupgrade.rb +12 -0
- data/lib/rancher/api/models/serviceupgradestrategy.rb +12 -0
- data/lib/rancher/api/models/setprojectmembersinput.rb +12 -0
- data/lib/rancher/api/models/setservicelinksinput.rb +12 -0
- data/lib/rancher/api/models/setting.rb +13 -0
- data/lib/rancher/api/models/snapshot.rb +20 -0
- data/lib/rancher/api/models/snapshotbackupinput.rb +15 -0
- data/lib/rancher/api/models/stack.rb +29 -0
- data/lib/rancher/api/models/stackupgrade.rb +13 -0
- data/lib/rancher/api/models/statetransition.rb +12 -0
- data/lib/rancher/api/models/statsaccess.rb +12 -0
- data/lib/rancher/api/models/storagedriver.rb +22 -0
- data/lib/rancher/api/models/storagedriverservice.rb +32 -0
- data/lib/rancher/api/models/storagepool.rb +25 -0
- data/lib/rancher/api/models/subnet.rb +21 -0
- data/lib/rancher/api/models/targetportrule.rb +12 -0
- data/lib/rancher/api/models/task.rb +14 -0
- data/lib/rancher/api/models/taskinstance.rb +17 -0
- data/lib/rancher/api/models/toserviceupgradestrategy.rb +14 -0
- data/lib/rancher/api/models/typedocumentation.rb +12 -0
- data/lib/rancher/api/models/ulimit.rb +12 -0
- data/lib/rancher/api/models/userpreference.rb +18 -0
- data/lib/rancher/api/models/virtualmachine.rb +60 -0
- data/lib/rancher/api/models/virtualmachinedisk.rb +13 -0
- data/lib/rancher/api/models/volume.rb +36 -0
- data/lib/rancher/api/models/volumeactivateinput.rb +14 -0
- data/lib/rancher/api/models/volumesnapshotinput.rb +12 -0
- data/lib/rancher/api/models/volumetemplate.rb +21 -0
- data/lib/rancher/api/version.rb +1 -1
- data/lib/rancher/api_discovery.rb +98 -0
- data/rancher-api-beta.gemspec +2 -0
- data/scripts/vcr_record.rb +31 -0
- data/templates/model.erb +22 -0
- data/vagrant-rancher/.gitignore +2 -0
- data/vagrant-rancher/README.md +24 -0
- data/vagrant-rancher/Vagrantfile +70 -0
- data/vagrant-rancher/ansible/docker.yml +65 -0
- data/vagrant-rancher/ansible/master.yml +3 -0
- data/vagrant-rancher/ansible/nfs-server.yml +30 -0
- data/vagrant-rancher/ansible/node.yml +2 -0
- metadata +203 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d16be61c28c4c8bce9e7cb097a03c8a705ac41ee
|
4
|
+
data.tar.gz: f3676b5f26d0e5cc40f001649d832e9418059c49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d439d1db115e0817647e9975b19f8fd5cf3fe4812cd4c767bfb3df80a185a55f92681f9a606a61dfb6611b204e7d455d2324fc7bf98840b2badf87887e4a2a0
|
7
|
+
data.tar.gz: ce52401c805c19c0ec5c2ed607335709c941101b6c003a4393fdb0f802053e1872433b248bcd50290c804e6f23c5e055d9daadfad0fa57fe0bef4edadb613b46
|
data/.gitignore
CHANGED
data/.gitlab-ci.yml
CHANGED
data/.rubocop.yml
CHANGED
data/.simplecov
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rancher-api-beta (0.8.
|
4
|
+
rancher-api-beta (0.8.1)
|
5
5
|
faraday_middleware
|
6
6
|
faye-websocket
|
7
7
|
her (~> 0.8.6)
|
@@ -9,9 +9,9 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
activemodel (5.1.
|
13
|
-
activesupport (= 5.1.
|
14
|
-
activesupport (5.1.
|
12
|
+
activemodel (5.1.1)
|
13
|
+
activesupport (= 5.1.1)
|
14
|
+
activesupport (5.1.1)
|
15
15
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
16
16
|
i18n (~> 0.7)
|
17
17
|
minitest (~> 5.1)
|
@@ -28,6 +28,8 @@ GEM
|
|
28
28
|
safe_yaml (~> 1.0.0)
|
29
29
|
diff-lcs (1.3)
|
30
30
|
docile (1.1.5)
|
31
|
+
domain_name (0.5.20170404)
|
32
|
+
unf (>= 0.0.5, < 1.0.0)
|
31
33
|
eventmachine (1.2.3)
|
32
34
|
faraday (0.12.1)
|
33
35
|
multipart-post (>= 1.2, < 3)
|
@@ -58,6 +60,8 @@ GEM
|
|
58
60
|
activesupport (>= 3.0.0, <= 6.0.0)
|
59
61
|
faraday (>= 0.8, < 1.0)
|
60
62
|
multi_json (~> 1.7)
|
63
|
+
http-cookie (1.0.3)
|
64
|
+
domain_name (~> 0.5)
|
61
65
|
httplog (0.99.3)
|
62
66
|
colorize
|
63
67
|
rack
|
@@ -69,10 +73,14 @@ GEM
|
|
69
73
|
ruby_dep (~> 1.2)
|
70
74
|
lumberjack (1.0.12)
|
71
75
|
method_source (0.8.2)
|
76
|
+
mime-types (3.1)
|
77
|
+
mime-types-data (~> 3.2015)
|
78
|
+
mime-types-data (3.2016.0521)
|
72
79
|
minitest (5.10.2)
|
73
80
|
multi_json (1.12.1)
|
74
81
|
multipart-post (2.0.0)
|
75
82
|
nenv (0.3.0)
|
83
|
+
netrc (0.11.0)
|
76
84
|
notiffany (0.1.1)
|
77
85
|
nenv (~> 0.1)
|
78
86
|
shellany (~> 0.0)
|
@@ -91,6 +99,10 @@ GEM
|
|
91
99
|
rb-fsevent (0.9.8)
|
92
100
|
rb-inotify (0.9.8)
|
93
101
|
ffi (>= 0.5.0)
|
102
|
+
rest-client (2.0.2)
|
103
|
+
http-cookie (>= 1.0.2, < 2.0)
|
104
|
+
mime-types (>= 1.16, < 4.0)
|
105
|
+
netrc (~> 0.8)
|
94
106
|
rspec (3.6.0)
|
95
107
|
rspec-core (~> 3.6.0)
|
96
108
|
rspec-expectations (~> 3.6.0)
|
@@ -124,6 +136,9 @@ GEM
|
|
124
136
|
thread_safe (0.3.6)
|
125
137
|
tzinfo (1.2.3)
|
126
138
|
thread_safe (~> 0.1)
|
139
|
+
unf (0.1.4)
|
140
|
+
unf_ext
|
141
|
+
unf_ext (0.0.7.4)
|
127
142
|
unicode-display_width (1.2.1)
|
128
143
|
vcr (3.0.3)
|
129
144
|
webmock (3.0.1)
|
@@ -138,6 +153,7 @@ PLATFORMS
|
|
138
153
|
ruby
|
139
154
|
|
140
155
|
DEPENDENCIES
|
156
|
+
activesupport
|
141
157
|
awesome_print
|
142
158
|
bundler (~> 1.14.5)
|
143
159
|
byebug
|
@@ -146,6 +162,7 @@ DEPENDENCIES
|
|
146
162
|
pry
|
147
163
|
rake (~> 12.0)
|
148
164
|
rancher-api-beta!
|
165
|
+
rest-client
|
149
166
|
rspec (~> 3.6.0)
|
150
167
|
rubocop
|
151
168
|
simplecov
|
data/README.md
CHANGED
@@ -188,6 +188,21 @@ puts container.execute(['bundle', 'exec', 'rake', 'db:create', 'db:migrate']).re
|
|
188
188
|
|
189
189
|
## Development
|
190
190
|
|
191
|
+
### Generate models from API schema
|
192
|
+
|
193
|
+
```bash
|
194
|
+
cd vagrant-rancher && vagrant up
|
195
|
+
|
196
|
+
```
|
197
|
+
|
198
|
+
### Record VCR Cassettes
|
199
|
+
If you added tests and want to record the VCR cassettes, run:
|
200
|
+
|
201
|
+
```bash
|
202
|
+
./scripts/vcr_record.rb
|
203
|
+
GENERATE_CODE=true bin/discover_api
|
204
|
+
```
|
205
|
+
|
191
206
|
### Console
|
192
207
|
To load environment with pry run `pry -I lib -r rancher/api`
|
193
208
|
|
data/bin/console
CHANGED
@@ -8,9 +8,9 @@ require 'rancher/api'
|
|
8
8
|
# with your gem easier. You can also use a different console, if you like.
|
9
9
|
|
10
10
|
Rancher::Api.configure do |config|
|
11
|
-
config.url = RANCHER_URL
|
12
|
-
config.access_key = RANCHER_ACCESS_KEY
|
13
|
-
config.secret_key = RANCHER_SECRET_KEY
|
11
|
+
config.url = ENV['RANCHER_URL']
|
12
|
+
config.access_key = ENV['RANCHER_ACCESS_KEY']
|
13
|
+
config.secret_key = ENV['RANCHER_SECRET_KEY']
|
14
14
|
end
|
15
15
|
|
16
16
|
# (If you use this, don't forget to add pry to your Gemfile!)
|
data/bin/discover_api
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'rancher/api'
|
6
|
+
require 'rancher/api_discovery'
|
7
|
+
|
8
|
+
ENV['RANCHER_URL'] = 'http://192.168.123.11:8080/v2-beta'
|
9
|
+
|
10
|
+
require 'pry'
|
11
|
+
crawler = Rancher::ApiDiscovery::Crawler.new
|
12
|
+
crawler.run
|
13
|
+
crawler.generate_code if ENV['GENERATE_CODE']
|
data/lib/rancher/api.rb
CHANGED
@@ -0,0 +1,66 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rancher/api/models/instance/action'
|
4
|
+
|
5
|
+
module Rancher
|
6
|
+
module Api
|
7
|
+
module Helpers
|
8
|
+
module Instance
|
9
|
+
#
|
10
|
+
# Actions: execute, logs, restart, setlabels, stop, update
|
11
|
+
#
|
12
|
+
|
13
|
+
#
|
14
|
+
# Execute works like this:
|
15
|
+
# - send request with command (array of strings)
|
16
|
+
# - in response you get WebSocket URL and token
|
17
|
+
# - connect to container using WebSocket and send token as parameter
|
18
|
+
# - get response and exit websocket connection
|
19
|
+
#
|
20
|
+
|
21
|
+
# HTTP/1.1 POST /v1/projects/1a5/containers/1i382/?action=execute
|
22
|
+
# Host: 188.166.70.58:8080
|
23
|
+
# Accept: application/json
|
24
|
+
# Content-Type: application/json
|
25
|
+
# Content-Length: 112
|
26
|
+
|
27
|
+
# {
|
28
|
+
# "attachStdin": true,
|
29
|
+
# "attachStdout": true,
|
30
|
+
# "command": [
|
31
|
+
# "rake",
|
32
|
+
# "db:create",
|
33
|
+
# "db:schema:load",
|
34
|
+
# "db:seed"
|
35
|
+
# ],
|
36
|
+
# "tty": true
|
37
|
+
# }
|
38
|
+
|
39
|
+
def execute(command)
|
40
|
+
url = actions['execute']
|
41
|
+
|
42
|
+
data = {
|
43
|
+
'attachStdin' => true,
|
44
|
+
'attachStdout' => true,
|
45
|
+
'command' => command,
|
46
|
+
'tty' => true
|
47
|
+
}
|
48
|
+
|
49
|
+
action = Action.post(url, data)
|
50
|
+
action.run!
|
51
|
+
end
|
52
|
+
|
53
|
+
def logs(lines = 20)
|
54
|
+
url = actions['logs']
|
55
|
+
data = {
|
56
|
+
'follow' => false,
|
57
|
+
'lines' => lines
|
58
|
+
}
|
59
|
+
|
60
|
+
action = Action.post(url, data)
|
61
|
+
action.run!
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rancher/api/models/machine/driver_config'
|
4
|
+
|
5
|
+
module Rancher
|
6
|
+
module Api
|
7
|
+
module Helpers
|
8
|
+
module Machine
|
9
|
+
DIGITAL_OCEAN = 'digitalocean'
|
10
|
+
VMWARE_VSPHERE = 'vmwarevsphere'
|
11
|
+
|
12
|
+
def self.included(base)
|
13
|
+
base.extend(ClassMethods)
|
14
|
+
end
|
15
|
+
|
16
|
+
module ClassMethods
|
17
|
+
def transitioning
|
18
|
+
all.select { |m| m.transitioning.eql?('yes') }
|
19
|
+
end
|
20
|
+
|
21
|
+
def active
|
22
|
+
where(state: 'active')
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def driver_config
|
27
|
+
case driver
|
28
|
+
when DIGITAL_OCEAN, VMWARE_VSPHERE
|
29
|
+
DriverConfig.new(attributes["#{driver}Config"])
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def driver_config=(dc)
|
34
|
+
case driver
|
35
|
+
when DIGITAL_OCEAN, VMWARE_VSPHERE
|
36
|
+
attributes["#{driver}Config"] = dc.attributes
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Rancher
|
4
|
+
module Api
|
5
|
+
module Helpers
|
6
|
+
module Project
|
7
|
+
def self.included(base)
|
8
|
+
base.extend(ClassMethods)
|
9
|
+
end
|
10
|
+
|
11
|
+
module ClassMethods
|
12
|
+
def find_by_name(name:)
|
13
|
+
# filters not working for name yet, so using select
|
14
|
+
all.reject { |e| e.state.eql?('purged') }.select { |e| e.name.eql?(name) }
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/rancher/api/models.rb
CHANGED
@@ -1,14 +1,166 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
require 'rancher/api/
|
5
|
-
|
6
|
-
require 'rancher/api/models/
|
3
|
+
require 'rancher/api/models/account'
|
4
|
+
require 'rancher/api/models/activesetting'
|
5
|
+
require 'rancher/api/models/addoutputsinput'
|
6
|
+
require 'rancher/api/models/addremoveservicelinkinput'
|
7
|
+
require 'rancher/api/models/agent'
|
8
|
+
require 'rancher/api/models/amazonec2config'
|
9
|
+
require 'rancher/api/models/apikey'
|
10
|
+
require 'rancher/api/models/auditlog'
|
11
|
+
require 'rancher/api/models/azureconfig'
|
12
|
+
require 'rancher/api/models/azureadconfig'
|
13
|
+
require 'rancher/api/models/backup'
|
14
|
+
require 'rancher/api/models/backuptarget'
|
15
|
+
require 'rancher/api/models/basemachineconfig'
|
16
|
+
require 'rancher/api/models/binding'
|
17
|
+
require 'rancher/api/models/blkiodeviceoption'
|
18
|
+
require 'rancher/api/models/catalogtemplate'
|
19
|
+
require 'rancher/api/models/certificate'
|
20
|
+
require 'rancher/api/models/changesecretinput'
|
21
|
+
require 'rancher/api/models/clustermembership'
|
22
|
+
require 'rancher/api/models/composeconfig'
|
23
|
+
require 'rancher/api/models/composeconfiginput'
|
24
|
+
require 'rancher/api/models/composeproject'
|
25
|
+
require 'rancher/api/models/composeservice'
|
26
|
+
require 'rancher/api/models/configitem'
|
27
|
+
require 'rancher/api/models/configitemstatus'
|
28
|
+
require 'rancher/api/models/container'
|
29
|
+
require 'rancher/api/models/containerevent'
|
30
|
+
require 'rancher/api/models/containerexec'
|
31
|
+
require 'rancher/api/models/containerlogs'
|
32
|
+
require 'rancher/api/models/containerproxy'
|
33
|
+
require 'rancher/api/models/credential'
|
34
|
+
require 'rancher/api/models/databasechangelog'
|
35
|
+
require 'rancher/api/models/databasechangeloglock'
|
36
|
+
require 'rancher/api/models/defaultnetwork'
|
37
|
+
require 'rancher/api/models/digitaloceanconfig'
|
38
|
+
require 'rancher/api/models/dnsservice'
|
39
|
+
require 'rancher/api/models/dockerbuild'
|
40
|
+
require 'rancher/api/models/extensionimplementation'
|
41
|
+
require 'rancher/api/models/extensionpoint'
|
42
|
+
require 'rancher/api/models/externaldnsevent'
|
43
|
+
require 'rancher/api/models/externalevent'
|
44
|
+
require 'rancher/api/models/externalhandler'
|
45
|
+
require 'rancher/api/models/externalhandlerexternalhandlerprocessmap'
|
46
|
+
require 'rancher/api/models/externalhandlerprocess'
|
47
|
+
require 'rancher/api/models/externalhandlerprocessconfig'
|
48
|
+
require 'rancher/api/models/externalhostevent'
|
49
|
+
require 'rancher/api/models/externalservice'
|
50
|
+
require 'rancher/api/models/externalserviceevent'
|
51
|
+
require 'rancher/api/models/externalstoragepoolevent'
|
52
|
+
require 'rancher/api/models/externalvolumeevent'
|
53
|
+
require 'rancher/api/models/fielddocumentation'
|
54
|
+
require 'rancher/api/models/genericobject'
|
55
|
+
require 'rancher/api/models/haconfig'
|
56
|
+
require 'rancher/api/models/haconfiginput'
|
57
|
+
require 'rancher/api/models/healthcheckinstancehostmap'
|
7
58
|
require 'rancher/api/models/host'
|
59
|
+
require 'rancher/api/models/hostaccess'
|
60
|
+
require 'rancher/api/models/hostapiproxytoken'
|
61
|
+
require 'rancher/api/models/hosttemplate'
|
62
|
+
require 'rancher/api/models/identity'
|
63
|
+
require 'rancher/api/models/image'
|
64
|
+
require 'rancher/api/models/inserviceupgradestrategy'
|
8
65
|
require 'rancher/api/models/instance'
|
66
|
+
require 'rancher/api/models/instanceconsole'
|
67
|
+
require 'rancher/api/models/instanceconsoleinput'
|
68
|
+
require 'rancher/api/models/instancehealthcheck'
|
69
|
+
require 'rancher/api/models/instancelink'
|
70
|
+
require 'rancher/api/models/instancestop'
|
71
|
+
require 'rancher/api/models/ipaddress'
|
72
|
+
require 'rancher/api/models/kubernetesservice'
|
73
|
+
require 'rancher/api/models/kubernetesstack'
|
74
|
+
require 'rancher/api/models/kubernetesstackupgrade'
|
75
|
+
require 'rancher/api/models/label'
|
76
|
+
require 'rancher/api/models/launchconfig'
|
77
|
+
require 'rancher/api/models/lbconfig'
|
78
|
+
require 'rancher/api/models/lbtargetconfig'
|
79
|
+
require 'rancher/api/models/ldapconfig'
|
80
|
+
require 'rancher/api/models/loadbalancercookiestickinesspolicy'
|
81
|
+
require 'rancher/api/models/loadbalancerservice'
|
82
|
+
require 'rancher/api/models/localauthconfig'
|
83
|
+
require 'rancher/api/models/logconfig'
|
9
84
|
require 'rancher/api/models/machine'
|
85
|
+
require 'rancher/api/models/machinedriver'
|
86
|
+
require 'rancher/api/models/mount'
|
87
|
+
require 'rancher/api/models/mountentry'
|
88
|
+
require 'rancher/api/models/network'
|
89
|
+
require 'rancher/api/models/networkdriver'
|
90
|
+
require 'rancher/api/models/networkdriverservice'
|
91
|
+
require 'rancher/api/models/networkpolicyrule'
|
92
|
+
require 'rancher/api/models/networkpolicyrulebetween'
|
93
|
+
require 'rancher/api/models/networkpolicyrulemember'
|
94
|
+
require 'rancher/api/models/networkpolicyrulewithin'
|
95
|
+
require 'rancher/api/models/nfsconfig'
|
96
|
+
require 'rancher/api/models/openldapconfig'
|
97
|
+
require 'rancher/api/models/packetconfig'
|
98
|
+
require 'rancher/api/models/password'
|
99
|
+
require 'rancher/api/models/physicalhost'
|
100
|
+
require 'rancher/api/models/port'
|
101
|
+
require 'rancher/api/models/portrule'
|
102
|
+
require 'rancher/api/models/processdefinition'
|
103
|
+
require 'rancher/api/models/processexecution'
|
104
|
+
require 'rancher/api/models/processinstance'
|
105
|
+
require 'rancher/api/models/processpool'
|
106
|
+
require 'rancher/api/models/processsummary'
|
10
107
|
require 'rancher/api/models/project'
|
11
|
-
require 'rancher/api/models/
|
12
|
-
require 'rancher/api/models/
|
108
|
+
require 'rancher/api/models/projectmember'
|
109
|
+
require 'rancher/api/models/projecttemplate'
|
110
|
+
require 'rancher/api/models/publicendpoint'
|
111
|
+
require 'rancher/api/models/publish'
|
112
|
+
require 'rancher/api/models/pulltask'
|
113
|
+
require 'rancher/api/models/recreateonquorumstrategyconfig'
|
114
|
+
require 'rancher/api/models/register'
|
115
|
+
require 'rancher/api/models/registrationtoken'
|
13
116
|
require 'rancher/api/models/registry'
|
14
117
|
require 'rancher/api/models/registrycredential'
|
118
|
+
require 'rancher/api/models/resourcedefinition'
|
119
|
+
require 'rancher/api/models/restartpolicy'
|
120
|
+
require 'rancher/api/models/restorefrombackupinput'
|
121
|
+
require 'rancher/api/models/reverttosnapshotinput'
|
122
|
+
require 'rancher/api/models/rollingrestartstrategy'
|
123
|
+
require 'rancher/api/models/scalepolicy'
|
124
|
+
require 'rancher/api/models/scheduledupgrade'
|
125
|
+
require 'rancher/api/models/schema'
|
126
|
+
require 'rancher/api/models/secondarylaunchconfig'
|
127
|
+
require 'rancher/api/models/secret'
|
128
|
+
require 'rancher/api/models/secretreference'
|
129
|
+
require 'rancher/api/models/service'
|
130
|
+
require 'rancher/api/models/servicebinding'
|
131
|
+
require 'rancher/api/models/serviceconsumemap'
|
132
|
+
require 'rancher/api/models/serviceevent'
|
133
|
+
require 'rancher/api/models/serviceexposemap'
|
134
|
+
require 'rancher/api/models/servicelink'
|
135
|
+
require 'rancher/api/models/servicelog'
|
136
|
+
require 'rancher/api/models/serviceproxy'
|
137
|
+
require 'rancher/api/models/servicerestart'
|
138
|
+
require 'rancher/api/models/serviceupgrade'
|
139
|
+
require 'rancher/api/models/serviceupgradestrategy'
|
140
|
+
require 'rancher/api/models/servicesportrange'
|
141
|
+
require 'rancher/api/models/setprojectmembersinput'
|
142
|
+
require 'rancher/api/models/setservicelinksinput'
|
143
|
+
require 'rancher/api/models/setting'
|
144
|
+
require 'rancher/api/models/snapshot'
|
145
|
+
require 'rancher/api/models/snapshotbackupinput'
|
146
|
+
require 'rancher/api/models/stack'
|
147
|
+
require 'rancher/api/models/stackupgrade'
|
148
|
+
require 'rancher/api/models/statetransition'
|
149
|
+
require 'rancher/api/models/statsaccess'
|
150
|
+
require 'rancher/api/models/storagedriver'
|
151
|
+
require 'rancher/api/models/storagedriverservice'
|
152
|
+
require 'rancher/api/models/storagepool'
|
153
|
+
require 'rancher/api/models/subnet'
|
154
|
+
require 'rancher/api/models/targetportrule'
|
155
|
+
require 'rancher/api/models/task'
|
156
|
+
require 'rancher/api/models/taskinstance'
|
157
|
+
require 'rancher/api/models/toserviceupgradestrategy'
|
158
|
+
require 'rancher/api/models/typedocumentation'
|
159
|
+
require 'rancher/api/models/ulimit'
|
160
|
+
require 'rancher/api/models/userpreference'
|
161
|
+
require 'rancher/api/models/virtualmachine'
|
162
|
+
require 'rancher/api/models/virtualmachinedisk'
|
163
|
+
require 'rancher/api/models/volume'
|
164
|
+
require 'rancher/api/models/volumeactivateinput'
|
165
|
+
require 'rancher/api/models/volumesnapshotinput'
|
166
|
+
require 'rancher/api/models/volumetemplate'
|