cloudstack-cli 1.0.6 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/cloudstack-cli/commands/router.rb +28 -12
- data/lib/cloudstack-cli/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 876fe294818f0d84f011416a71de1605f0a524c1
|
4
|
+
data.tar.gz: 7006b7e86331e87eae113a50b2874ce9fb6e8d2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef8c9130515ac72cc3980fcece0888010c08e812adae6f5fb845a9495d5d9da4feb9a30e00a8820d55ca8ecb164da0bd479e1e5f6257c8260899c0f046c87425
|
7
|
+
data.tar.gz: ae75e18b13014a2347a3e41c166d790667d27ceceaf7425e1a264dced5b3f0a86f2de57aaf388b0b89cd7628ecf84e97aef67b0385f1bbbbeb675a3ff5243adc
|
data/Gemfile.lock
CHANGED
@@ -11,7 +11,7 @@ class Router < CloudstackCli::Base
|
|
11
11
|
option :reverse, type: :boolean, default: false, desc: "reverse listing of routers"
|
12
12
|
option :command,
|
13
13
|
desc: "command to execute for each router",
|
14
|
-
enum: %w(START STOP REBOOT)
|
14
|
+
enum: %w(START STOP REBOOT STOP_START)
|
15
15
|
option :concurrency, type: :numeric, default: 10, aliases: '-C',
|
16
16
|
desc: "number of concurrent command to execute"
|
17
17
|
option :format, default: "table",
|
@@ -79,7 +79,7 @@ class Router < CloudstackCli::Base
|
|
79
79
|
end
|
80
80
|
|
81
81
|
desc "reboot NAME [NAME2 ..]", "reboot virtual router(s)"
|
82
|
-
option :force, desc: "
|
82
|
+
option :force, desc: "reboot without confirmation", type: :boolean, aliases: '-f'
|
83
83
|
def reboot(*names)
|
84
84
|
routers = names.map {|name| client.list_routers(name: name).first}
|
85
85
|
print_routers(routers)
|
@@ -125,6 +125,20 @@ class Router < CloudstackCli::Base
|
|
125
125
|
watch_jobs(jobs)
|
126
126
|
end
|
127
127
|
|
128
|
+
desc "show NAME [NAME2 ..]", "show detailed infos about a virtual router(s)"
|
129
|
+
option :project
|
130
|
+
def show(*names)
|
131
|
+
routers = names.map {|name| get_router(name)}
|
132
|
+
table = []
|
133
|
+
routers.each do |router|
|
134
|
+
router.each do |key, value|
|
135
|
+
table << [ set_color("#{key}:", :yellow), "#{value}" ]
|
136
|
+
end
|
137
|
+
table << [ "-" * 20 ] unless router == routers[-1]
|
138
|
+
end
|
139
|
+
print_table table
|
140
|
+
end
|
141
|
+
|
128
142
|
no_commands do
|
129
143
|
|
130
144
|
def get_router(name)
|
@@ -150,6 +164,7 @@ class Router < CloudstackCli::Base
|
|
150
164
|
end
|
151
165
|
routers.reverse! if options[:reverse]
|
152
166
|
|
167
|
+
options[:format] ||= "table"
|
153
168
|
case options[:format].to_sym
|
154
169
|
when :yaml
|
155
170
|
puts({'routers' => routers}.to_yaml)
|
@@ -194,22 +209,23 @@ class Router < CloudstackCli::Base
|
|
194
209
|
end
|
195
210
|
|
196
211
|
def execute_router_commands(command, routers)
|
197
|
-
unless %w(start stop reboot).include?(command)
|
212
|
+
unless %w(start stop reboot stop_start).include?(command)
|
198
213
|
say "\nCommand #{options[:command]} not supported.", :red
|
199
214
|
exit 1
|
200
215
|
end
|
201
216
|
exit unless yes?("\n#{command.capitalize} the router(s) above? [y/N]:", :magenta)
|
202
217
|
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
218
|
+
command.split("_").each do |cmd|
|
219
|
+
jobs = routers.map do |router|
|
220
|
+
{
|
221
|
+
job_id: nil,
|
222
|
+
object_id: router["id"],
|
223
|
+
name: "#{cmd.capitalize} router #{router['name']}",
|
224
|
+
status: -1
|
225
|
+
}
|
226
|
+
end
|
227
|
+
run_background_jobs(jobs, "#{cmd}_router")
|
210
228
|
end
|
211
|
-
|
212
|
-
run_background_jobs(jobs, "#{command}_router")
|
213
229
|
end
|
214
230
|
|
215
231
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudstack-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nik Wolfgramm
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|