aly 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/aly/app.rb +9 -1
  3. data/lib/aly/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 71774f7e94aef222b01bdb89e409725b7590da99e0303f743fe07b348e3014af
4
- data.tar.gz: ea58043cb3c714f2c9912ad9d9ed14786b7812388e21782a23428fb99c37b6c2
3
+ metadata.gz: 34fd1e28efaddb6086f9733f1d9ba642899d7b8401b75b91c3a3ec8328e6d4d7
4
+ data.tar.gz: 43c4a862eb3068239a508dc08ad79e6842c315cbe6ea104a958cc7063fed7964
5
5
  SHA512:
6
- metadata.gz: 402e144c81c7cb72d4af14c4670402db19c6ff4c95c24dcf5822227faa71437ede5d5000df2364c3691323c42f7606970e699d9eff06eb69e98b93aa14769477
7
- data.tar.gz: ca963b6f79d0745412adea684c7424a1752b5887093fc2730c31792d4aaf032b9bc6c7eba901d5cf4a967fe4d2af62161bad92c63b11269a6c5a8a0132d9d2ac
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
- else forward_port = listener.dig('HTTPListenerConfig', 'ForwardPort')
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Aly
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
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.0
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-18 00:00:00.000000000 Z
11
+ date: 2021-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor