awful 0.0.18 → 0.0.19
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/awful/datapipeline.rb +2 -3
- data/lib/awful/elb.rb +23 -6
- data/lib/awful/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: e3c48ef8ad16b349fc7e1d0d15a8cf17e4ea7a67
|
4
|
+
data.tar.gz: 8382b4c4a018639909af71234e1b7efffb2b3b35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47ed8385d4cfe2d8d48e7499f27ed2b5874c871ef48ea5a1dadfe1bbfaca6cf6b509fa3c64f8f70f3468d52cf14b273d54cff8f19192612b09011a49fea01f66
|
7
|
+
data.tar.gz: 3aa7f6b767cdef46965e4681aef007612003de1c74a9f708872b052d874c768c69f7144c8449654199bdff90554255ab213e3caeaa897e4f4b85ce1b67542a0f
|
data/lib/awful/datapipeline.rb
CHANGED
@@ -11,13 +11,12 @@ module Awful
|
|
11
11
|
end
|
12
12
|
|
13
13
|
if options[:long]
|
14
|
-
fields = %w[ @name @creationTime ]
|
15
14
|
datapipeline.describe_pipelines(pipeline_ids: dps.map(&:id)).pipeline_description_list.map do |dp|
|
16
15
|
dp.fields.each_with_object({}) do |f, h|
|
17
16
|
h[f.key] = f.string_value # convert array of structs to hash
|
18
|
-
end
|
17
|
+
end.merge('id' => dp.pipeline_id)
|
19
18
|
end.tap do |list|
|
20
|
-
print_table list.map { |d| d.values_at('@creationTime', '
|
19
|
+
print_table list.map { |d| d.values_at('@creationTime', 'id', '@pipelineState', '@healthStatus', 'name') }.sort
|
21
20
|
end
|
22
21
|
else
|
23
22
|
puts dps.map(&:name).sort
|
data/lib/awful/elb.rb
CHANGED
@@ -19,17 +19,22 @@ module Awful
|
|
19
19
|
end
|
20
20
|
|
21
21
|
desc 'instances NAME', 'list instances and states for elb NAME'
|
22
|
+
method_option :long, aliases: '-l', default: false, desc: 'Long listing'
|
22
23
|
def instances(name)
|
23
24
|
instances = elb.describe_instance_health(load_balancer_name: name).map(&:instance_states).flatten
|
24
25
|
if instances.empty?
|
25
|
-
puts 'no instances'
|
26
|
+
instances.tap { puts 'no instances' }
|
26
27
|
else
|
27
28
|
instances_by_id = instances.inject({}) { |hash,instance| hash[instance.instance_id] = instance; hash }
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
29
|
+
if options[:long]
|
30
|
+
ec2.describe_instances(instance_ids: instances_by_id.keys).map(&:reservations).flatten.map(&:instances).flatten.map do |instance|
|
31
|
+
health = instances_by_id[instance.instance_id]
|
32
|
+
[ instance.instance_id, instance.tags.map(&:value).sort.join(','), instance.public_ip_address, health.state, health.reason_code, health.description ]
|
33
|
+
end.tap do |list|
|
34
|
+
print_table list
|
35
|
+
end
|
36
|
+
else
|
37
|
+
instances_by_id.keys.tap { |list| puts list }
|
33
38
|
end
|
34
39
|
end
|
35
40
|
end
|
@@ -93,6 +98,18 @@ module Awful
|
|
93
98
|
elb.deregister_instances_from_load_balancer(load_balancer_name: name, instances: instance_ids.map{ |id| {instance_id: id} })
|
94
99
|
end
|
95
100
|
|
101
|
+
desc 'state [INSTANCE_IDS]', 'show health state for all instances, or listed instance ids'
|
102
|
+
method_option :long, aliases: '-l', default: false, desc: 'Long listing'
|
103
|
+
def state(name, *instance_ids)
|
104
|
+
elb.describe_instance_health(load_balancer_name: name, instances: instance_ids.map { |id| {instance_id: id} }).instance_states.tap do |instances|
|
105
|
+
if options[:long]
|
106
|
+
print_table instances.map { |i| [ i.instance_id, i.state, i.reason_code, i.description ] }
|
107
|
+
else
|
108
|
+
puts instances.map { |i| i.state }
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
96
113
|
end
|
97
114
|
|
98
115
|
end
|
data/lib/awful/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: awful
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ric Lister
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|