awful 0.0.99 → 0.0.100
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/elasticache +7 -0
- data/lib/awful/elasticache.rb +74 -0
- data/lib/awful/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50d02ca7f4785757f6395f57adfb6abc67ebe910
|
4
|
+
data.tar.gz: 94e397b20a81d50055b58fa59ed89b514df689a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 628f75c481ce62633bc10f651859938930529d68fcf98e81bc636a52b70eabd918a6f6458553f93e4d320d44460c634ad218495a1f3138ae369c99a52b812310
|
7
|
+
data.tar.gz: 5914cbd75df8144b5428772b83716a4b2192718bb48720fdca68f48335315f1d152721979984ab9ffcccb345c1f78a812607a168dc738bef1beb66ab2314441e
|
data/bin/elasticache
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
|
3
|
+
module Awful
|
4
|
+
module Short
|
5
|
+
def elasticache(*args)
|
6
|
+
Awful::ElastiCache.new.invoke(*args)
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
class ElastiCache < Cli
|
11
|
+
COLORS = {
|
12
|
+
available: :green,
|
13
|
+
deleted: :red
|
14
|
+
}
|
15
|
+
|
16
|
+
no_commands do
|
17
|
+
def elasticache
|
18
|
+
@elasticache ||= Aws::ElastiCache::Client.new
|
19
|
+
end
|
20
|
+
|
21
|
+
def color(string)
|
22
|
+
set_color(string, COLORS.fetch(string.to_sym, :yellow))
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
desc 'ls [ID]', 'list clusters'
|
27
|
+
method_option :long, aliases: '-l', default: false, desc: 'Long listing'
|
28
|
+
def ls(id = nil)
|
29
|
+
elasticache.describe_cache_clusters(cache_cluster_id: id).cache_clusters.tap do |clusters|
|
30
|
+
if options[:long]
|
31
|
+
print_table clusters.map { |c|
|
32
|
+
[
|
33
|
+
c.cache_cluster_id,
|
34
|
+
c.engine,
|
35
|
+
c.engine_version,
|
36
|
+
c.num_cache_nodes,
|
37
|
+
c.cache_node_type,
|
38
|
+
c.preferred_availability_zone,
|
39
|
+
color(c.cache_cluster_status),
|
40
|
+
c.cache_cluster_create_time
|
41
|
+
]
|
42
|
+
}
|
43
|
+
else
|
44
|
+
puts clusters.map(&:cache_cluster_id)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
desc 'dump [ID]', 'get all details for given cluster'
|
50
|
+
method_option :nodes, aliases: '-n', type: :boolean, default: false, desc: 'show node info'
|
51
|
+
def dump(id = nil)
|
52
|
+
elasticache.describe_cache_clusters(
|
53
|
+
cache_cluster_id: id,
|
54
|
+
show_cache_node_info: options[:nodes]
|
55
|
+
).cache_clusters.tap do |clusters|
|
56
|
+
clusters.each do |cluster|
|
57
|
+
puts YAML.dump(stringify_keys(cluster.to_hash))
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
## as documented in this abomination:
|
63
|
+
## https://s3.amazonaws.com/cloudformation-templates-us-east-1/ElastiCache_Redis.template
|
64
|
+
desc 'endpoint ID', 'get endpoint for given cluster'
|
65
|
+
def endpoint(id)
|
66
|
+
elasticache.describe_cache_clusters(
|
67
|
+
cache_cluster_id: id,
|
68
|
+
show_cache_node_info: true
|
69
|
+
).cache_clusters.first.cache_nodes.first.endpoint.tap do |ep|
|
70
|
+
puts ep.address + ':' + ep.port.to_s
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
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.100
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ric Lister
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -93,6 +93,7 @@ executables:
|
|
93
93
|
- ec2
|
94
94
|
- ecr
|
95
95
|
- ecs
|
96
|
+
- elasticache
|
96
97
|
- elb
|
97
98
|
- iam
|
98
99
|
- lambda
|
@@ -126,6 +127,7 @@ files:
|
|
126
127
|
- bin/ec2
|
127
128
|
- bin/ecr
|
128
129
|
- bin/ecs
|
130
|
+
- bin/elasticache
|
129
131
|
- bin/elb
|
130
132
|
- bin/iam
|
131
133
|
- bin/lambda
|
@@ -152,6 +154,7 @@ files:
|
|
152
154
|
- lib/awful/ec2.rb
|
153
155
|
- lib/awful/ecr.rb
|
154
156
|
- lib/awful/ecs.rb
|
157
|
+
- lib/awful/elasticache.rb
|
155
158
|
- lib/awful/elb.rb
|
156
159
|
- lib/awful/iam.rb
|
157
160
|
- lib/awful/lambda.rb
|