automan 2.1.2 → 2.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +0 -5
- data/lib/automan/cli/snapper.rb +21 -0
- data/lib/automan/rds/snapshot.rb +18 -5
- data/lib/automan/version.rb +1 -1
- metadata +3 -5
- data/.rvmrc +0 -1
- data/.travis.yml +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ff89fd6445234583d2dde7e5fa84d345cfdc736
|
4
|
+
data.tar.gz: bf206d9978acd7cb472388df2bc8073b23af6443
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce434b18f4b4dd0a597a075719088fa4258bd2196baeca16668e3218099c5b232397f22a136001d0514e41dcf19b0a6e7e0e538c373e463d744d3aaa4c35af46
|
7
|
+
data.tar.gz: 85a6e482d61a528271e3736b9c425b5976174986410992532a84b34e602d0690c393216dadf6b91f12e3e448bdaab7c48147b6f67bad3431206f1e72863ff96b
|
data/Rakefile
CHANGED
data/lib/automan/cli/snapper.rb
CHANGED
@@ -74,5 +74,26 @@ module Automan::Cli
|
|
74
74
|
Automan::RDS::Snapshot.new(options).latest
|
75
75
|
end
|
76
76
|
|
77
|
+
desc "count", "return the number of snapshots"
|
78
|
+
|
79
|
+
option :environment,
|
80
|
+
aliases: "-e",
|
81
|
+
desc: "environment of database to snapshot"
|
82
|
+
|
83
|
+
option :database,
|
84
|
+
aliases: "-d",
|
85
|
+
desc: "name of the database to snapshot"
|
86
|
+
|
87
|
+
def count
|
88
|
+
|
89
|
+
if options[:database].nil? && options[:environment].nil?
|
90
|
+
puts "Must specify either database or environment"
|
91
|
+
help "count"
|
92
|
+
exit 1
|
93
|
+
end
|
94
|
+
|
95
|
+
Automan::RDS::Snapshot.new(options).count_snapshots
|
96
|
+
end
|
97
|
+
|
77
98
|
end
|
78
99
|
end
|
data/lib/automan/rds/snapshot.rb
CHANGED
@@ -63,7 +63,7 @@ module Automan::RDS
|
|
63
63
|
end
|
64
64
|
|
65
65
|
def snapshot_count
|
66
|
-
rds.db_instances[
|
66
|
+
rds.db_instances[find_db.id].snapshots.count
|
67
67
|
end
|
68
68
|
|
69
69
|
def create
|
@@ -204,12 +204,14 @@ module Automan::RDS
|
|
204
204
|
end
|
205
205
|
|
206
206
|
def get_all_snapshots
|
207
|
-
rds.
|
207
|
+
rds.db_instances[find_db.id].snapshots
|
208
208
|
end
|
209
209
|
|
210
210
|
def prunable_snapshots
|
211
|
-
|
212
|
-
|
211
|
+
AWS.memoize do
|
212
|
+
snapshots = get_all_snapshots
|
213
|
+
snapshots.select { |s| can_prune?(s) }
|
214
|
+
end
|
213
215
|
end
|
214
216
|
|
215
217
|
def oldest_prunable_snapshot
|
@@ -233,6 +235,17 @@ module Automan::RDS
|
|
233
235
|
end
|
234
236
|
end
|
235
237
|
|
238
|
+
def count_snapshots
|
239
|
+
log_options
|
240
|
+
db = find_db
|
241
|
+
if db.nil?
|
242
|
+
logger.info "Database not found"
|
243
|
+
else
|
244
|
+
logger.info "Number of snapshots for database #{db.id} is #{snapshot_count}"
|
245
|
+
logger.info "Number of prunable snapshots for database #{db.id} is #{prunable_snapshots.count}"
|
246
|
+
end
|
247
|
+
end
|
248
|
+
|
236
249
|
def latest
|
237
250
|
log_options
|
238
251
|
db = find_db
|
@@ -241,4 +254,4 @@ module Automan::RDS
|
|
241
254
|
logger.info "Most recent snapshot is #{s.id}"
|
242
255
|
end
|
243
256
|
end
|
244
|
-
end
|
257
|
+
end
|
data/lib/automan/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: automan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Chalfant
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-10-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -166,8 +166,6 @@ extensions: []
|
|
166
166
|
extra_rdoc_files: []
|
167
167
|
files:
|
168
168
|
- ".gitignore"
|
169
|
-
- ".rvmrc"
|
170
|
-
- ".travis.yml"
|
171
169
|
- Gemfile
|
172
170
|
- LICENSE.txt
|
173
171
|
- README.md
|
@@ -252,7 +250,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
252
250
|
version: '0'
|
253
251
|
requirements: []
|
254
252
|
rubyforge_project:
|
255
|
-
rubygems_version: 2.
|
253
|
+
rubygems_version: 2.4.8
|
256
254
|
signing_key:
|
257
255
|
specification_version: 4
|
258
256
|
summary: Automates common AWS ops
|
data/.rvmrc
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
rvm --create use ruby-2.1.2@automan
|