aly 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aly/app.rb +9 -1
- data/lib/aly/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34fd1e28efaddb6086f9733f1d9ba642899d7b8401b75b91c3a3ec8328e6d4d7
|
4
|
+
data.tar.gz: 43c4a862eb3068239a508dc08ad79e6842c315cbe6ea104a958cc7063fed7964
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8217b6478e6291f5608be558d9356dad8baa71faea68b75f670c0e2b6e3f2a4cac5a378d81ea79b12259c6e46deceffdf16c11ffa053f4dc3f72013b5a5a60f3
|
7
|
+
data.tar.gz: e3a63a7c64d1a923e74e26f188a2b7f5729472125c6a9f3d1d5378ce9179429a0bd3406187c339e3b8c55dcfac4f3c0691dd2d6bc50c96ef14bde70e01b2a873
|
data/lib/aly/app.rb
CHANGED
@@ -24,6 +24,7 @@ module Aly
|
|
24
24
|
selected = raw_out['Instances']['Instance'].each do |item|
|
25
25
|
item['PrivateIP'] = (item['NetworkInterfaces']['NetworkInterface'] || []).map { |ni| ni['PrimaryIpAddress'] }.join(', ')
|
26
26
|
item['PublicIP'] = item['EipAddress']['IpAddress'] || ''
|
27
|
+
item['PublicIP'] = item['PublicIpAddress']['IpAddress'].join(', ') if item['PublicIP'] == ''
|
27
28
|
end
|
28
29
|
|
29
30
|
if query = args.first
|
@@ -108,6 +109,11 @@ module Aly
|
|
108
109
|
selected.each do |row|
|
109
110
|
described_load_balancer_attributes = exec('slb', 'DescribeLoadBalancerAttribute', "--LoadBalancerId=#{row['LoadBalancerId']}")
|
110
111
|
row['BackendServers'] = described_load_balancer_attributes['BackendServers']['BackendServer']
|
112
|
+
|
113
|
+
row['Listeners'].select { |e| e['VServerGroupId'] }.each do |listener|
|
114
|
+
vserver_group = exec('slb', 'DescribeVServerGroupAttribute', "--VServerGroupId=#{listener['VServerGroupId']}")
|
115
|
+
listener['VServerGroup'] = vserver_group
|
116
|
+
end
|
111
117
|
end
|
112
118
|
|
113
119
|
puts JSON.pretty_generate(selected)
|
@@ -118,8 +124,10 @@ module Aly
|
|
118
124
|
backend_port = listener['BackendServerPort']
|
119
125
|
if backend_port
|
120
126
|
"#{listener_port}:#{backend_port}"
|
121
|
-
|
127
|
+
elsif forward_port = listener.dig('HTTPListenerConfig', 'ForwardPort')
|
122
128
|
"#{listener_port}->#{forward_port}"
|
129
|
+
elsif vserver_group_id = listener['VServerGroupId']
|
130
|
+
"#{listener_port}->#{vserver_group_id}"
|
123
131
|
end
|
124
132
|
end.compact.join(', ')
|
125
133
|
|
data/lib/aly/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Liu Xiang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|