cloudstack-cli 1.0.5 → 1.0.6
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/lib/cloudstack-cli/commands/router.rb +14 -16
- data/lib/cloudstack-cli/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e84e2c0d7b3711600594a643e966594a63559ecf
|
4
|
+
data.tar.gz: 4969bcbff43220ee17ffb883261c4a102bca7f0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0bf8526c12368a20db1b62afdba3551ec2a1b47b6580f478dcadc0113c746ca3c69ebad28c105ff4147bd967cebef6e5b62148fe975487d78a755e02cb76974
|
7
|
+
data.tar.gz: 446535092e456d529c46b33f3b9df8486d3664f9132c008df97d00552dd98cfb38020a165799492a448e5a26ca186756ed5eefda255f888252146fd21d19ce43
|
@@ -18,13 +18,13 @@ class Router < CloudstackCli::Base
|
|
18
18
|
enum: %w(table json yaml)
|
19
19
|
option :showid, type: :boolean, desc: "display the router ID"
|
20
20
|
option :verbose, aliases: '-V', desc: "display additional fields"
|
21
|
+
option :version, desc: "list virtual router elements by version"
|
21
22
|
def list
|
22
23
|
resolve_project
|
23
24
|
resolve_zone
|
24
25
|
resolve_account
|
25
26
|
|
26
27
|
routers = client.list_routers(options)
|
27
|
-
|
28
28
|
# show all routers unless project or account is set
|
29
29
|
if options[:listall] && !options[:project] && !options[:account]
|
30
30
|
client.list_projects(listall: true).each do |project|
|
@@ -33,16 +33,6 @@ class Router < CloudstackCli::Base
|
|
33
33
|
)
|
34
34
|
end
|
35
35
|
end
|
36
|
-
|
37
|
-
if options[:redundant_state]
|
38
|
-
routers = filter_by(
|
39
|
-
routers,
|
40
|
-
'redundantstate',
|
41
|
-
options[:redundant_state].downcase
|
42
|
-
)
|
43
|
-
end
|
44
|
-
|
45
|
-
routers.reverse! if options[:reverse]
|
46
36
|
print_routers(routers, options)
|
47
37
|
execute_router_commands(options[:command].downcase, routers) if options[:command]
|
48
38
|
end
|
@@ -58,7 +48,6 @@ class Router < CloudstackCli::Base
|
|
58
48
|
enum: %w(table json yaml)
|
59
49
|
def list_from_file(file)
|
60
50
|
routers = parse_file(file)["routers"]
|
61
|
-
routers.reverse! if options[:reverse]
|
62
51
|
print_routers(routers, options)
|
63
52
|
execute_router_commands(options[:command].downcase, routers) if options[:command]
|
64
53
|
end
|
@@ -152,6 +141,15 @@ class Router < CloudstackCli::Base
|
|
152
141
|
if routers.size < 1
|
153
142
|
say "No routers found."
|
154
143
|
else
|
144
|
+
if options[:redundant_state]
|
145
|
+
routers = filter_by(
|
146
|
+
routers,
|
147
|
+
'redundantstate',
|
148
|
+
options[:redundant_state].downcase
|
149
|
+
)
|
150
|
+
end
|
151
|
+
routers.reverse! if options[:reverse]
|
152
|
+
|
155
153
|
case options[:format].to_sym
|
156
154
|
when :yaml
|
157
155
|
puts({'routers' => routers}.to_yaml)
|
@@ -159,11 +157,11 @@ class Router < CloudstackCli::Base
|
|
159
157
|
say JSON.pretty_generate(routers: routers)
|
160
158
|
else
|
161
159
|
table = [%w(
|
162
|
-
Name Zone Account/Project IP Linklocal-IP Status
|
160
|
+
Name Zone Account/Project IP Linklocal-IP Status Version
|
163
161
|
)]
|
164
162
|
table[0].unshift('ID') if options[:showid]
|
165
163
|
if options[:verbose]
|
166
|
-
table[0].push('Redundant-State', 'Requ-Upgrade', '
|
164
|
+
table[0].push('Redundant-State', 'Requ-Upgrade', 'Offering')
|
167
165
|
end
|
168
166
|
routers.each do |router|
|
169
167
|
table << [
|
@@ -172,14 +170,14 @@ class Router < CloudstackCli::Base
|
|
172
170
|
router["project"] || router["account"],
|
173
171
|
router["nic"] && router["nic"].first ? router["nic"].first['ipaddress'] : "-",
|
174
172
|
router["linklocalip"] || "-",
|
175
|
-
router["state"]
|
173
|
+
router["state"],
|
174
|
+
router["version"] || "-"
|
176
175
|
]
|
177
176
|
table[-1].unshift(router["id"]) if options[:showid]
|
178
177
|
if options[:verbose]
|
179
178
|
table[-1].push(
|
180
179
|
print_redundant_state(router),
|
181
180
|
router["requiresupgrade"] || "-",
|
182
|
-
router["version"] || "-",
|
183
181
|
router["serviceofferingname"]
|
184
182
|
)
|
185
183
|
end
|