aly 0.3.3 → 0.3.4
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/aly/app.rb +8 -8
- data/lib/aly/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 710c187d9fac4262f8c0507ba0334d54b983dd1bcdf19248e5f4cb2d52cf707d
|
4
|
+
data.tar.gz: ef60807c9b0184da58027f9048da53845924aaa5edcc4beac8c43d6dd0dd9236
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f366b47ab659a41bb3e1d9aa78045e281fb3330b02fa41f193ed83561d50c5b8f4aef313f9916549081e0126a3284797c7b715136accc76eea1714da1abc99a3
|
7
|
+
data.tar.gz: 985ea70ca8b61ec19d9ab78c1db6f7692c5f5e992116f7b18c92c15943d0474165685530c2898f93e7bc1de5637f090fdd9839b3a79ef40ce655a72300f60b14
|
data/Gemfile.lock
CHANGED
data/lib/aly/app.rb
CHANGED
@@ -18,7 +18,7 @@ end
|
|
18
18
|
module Aly
|
19
19
|
class App
|
20
20
|
def start(options)
|
21
|
-
send(options[:command], *options[:args], **options[:options])
|
21
|
+
send(options[:command], *options[:args], **(options[:options].transform_keys(&:to_sym)))
|
22
22
|
end
|
23
23
|
|
24
24
|
def ecs(*args, **options)
|
@@ -35,7 +35,7 @@ module Aly
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
-
if options[
|
38
|
+
if options[:full]
|
39
39
|
selected = selected.map do |row|
|
40
40
|
{
|
41
41
|
Id: row['InstanceId'],
|
@@ -48,7 +48,7 @@ module Aly
|
|
48
48
|
}
|
49
49
|
end
|
50
50
|
puts selected.table&.to_s
|
51
|
-
elsif options[
|
51
|
+
elsif options[:detail]
|
52
52
|
puts JSON.pretty_generate(selected)
|
53
53
|
else
|
54
54
|
selected = selected.map do |row|
|
@@ -77,7 +77,7 @@ module Aly
|
|
77
77
|
end
|
78
78
|
|
79
79
|
|
80
|
-
if options[
|
80
|
+
if options[:detail]
|
81
81
|
puts JSON.pretty_generate(selected)
|
82
82
|
else
|
83
83
|
net_intefraces = exec('ecs', 'DescribeNetworkInterfaces', '--pager', **options)['NetworkInterfaceSets']['NetworkInterfaceSet'].each_with_object({}) do |item, result|
|
@@ -203,7 +203,7 @@ module Aly
|
|
203
203
|
puts listener_rules.table.to_s.gsub(/^/, ' ')
|
204
204
|
puts
|
205
205
|
|
206
|
-
if options[
|
206
|
+
if options[:acl]
|
207
207
|
acl_ids = listeners.flat_map { |listener| listener['AclIds'] || [] }.uniq
|
208
208
|
unless acl_ids.empty?
|
209
209
|
alc_entries = acl_ids.flat_map do |acl_id|
|
@@ -271,9 +271,9 @@ module Aly
|
|
271
271
|
item['AllIPs'] = item['PrivateIP'] + item['PublicIP']
|
272
272
|
end
|
273
273
|
|
274
|
-
if options[
|
274
|
+
if options[:full]
|
275
275
|
full_slb(selected, eips, **options)
|
276
|
-
elsif options[
|
276
|
+
elsif options[:detail]
|
277
277
|
selected.each do |row|
|
278
278
|
described_load_balancer_attributes = exec('slb', 'DescribeLoadBalancerAttribute', "--LoadBalancerId=#{row['LoadBalancerId']}", **options)
|
279
279
|
row['BackendServers'] = described_load_balancer_attributes['BackendServers']['BackendServer']
|
@@ -500,7 +500,7 @@ module Aly
|
|
500
500
|
|
501
501
|
def exec(command, sub_command, *args, **options)
|
502
502
|
command = "aliyun #{command} #{sub_command} #{args.join(' ')}"
|
503
|
-
command += " -p #{options[
|
503
|
+
command += " -p #{options[:profile]}" if options[:profile]
|
504
504
|
JSON.parse(`#{command}`)
|
505
505
|
end
|
506
506
|
end
|
data/lib/aly/version.rb
CHANGED