seiton 0.1.1 → 0.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 68c2eabf63161a231cb8de12a3836e3dbc0e66e73410978fe0f08600c4f916dd
4
- data.tar.gz: 38e22caf6a46b10b8e5a133015da577b7c619801a8609f7a22ba7f8cdbbd042b
3
+ metadata.gz: 39b7e9ace75ea8a043e1fb37a7e38c932cee67a200da207c6fa436ade1b7fa8a
4
+ data.tar.gz: e013585b389fe0da300039dee1f894082825ce9b01483eb35cf41d9d3f9d2859
5
5
  SHA512:
6
- metadata.gz: b99b0b5a3abe2d580c487c854a4d773f4e4dfa0ca19e01f484d36741a9b79df626dcee82ff17b3847dbee953cc52c8f9ea90e09cf52a2f3f3750e93dd320aa3f
7
- data.tar.gz: 0d156ec83984ad4e0786824beeec9d7ebd5d6e6f56ec9d638af3ee09b6400a327ee3ceba4b4d626ae701a0175efd80c3e3e44d6390617582a325576a4f6caf98
6
+ metadata.gz: 6e68a105ead395cd8e7ecb39c577c67f761548e9ad08882feecdf4fb2a65932ecd2d3a54d1591f4d6c08a5264bd9abd7ffa7d329aa48d8920cdfadbb0778296e
7
+ data.tar.gz: ccb2ab88627ced7be15f1e3bb10a9cbf19e5278db9d9f03303097109e010d81918c8a4fbf8faf1abed743a67947227192fcb5cf7b8f36ff391754b36119f8575
data/README.md CHANGED
@@ -107,7 +107,7 @@ bundle exec seiton ami --before-datetime=2020/01/01 --ignores=xxxx yyyy zzzz
107
107
 
108
108
  ```sh
109
109
  bundle exec rake check:ec2_images # AMI
110
- bundle exec rake check:ec2_snapshots # Snapshot
110
+ bundle exec rake check:ebs_snapshots # Snapshot
111
111
  ```
112
112
 
113
113
  ### Delete EIP
@@ -238,9 +238,9 @@ bundle exec rake check:db_snapshots # RDS Snapshot
238
238
  #### help
239
239
 
240
240
  ```sh
241
- $ bundle exec seiton --help ec2_snapshot
241
+ $ bundle exec seiton --help ebs_snapshot
242
242
  Usage:
243
- seiton ec2_snapshot
243
+ seiton ebs_snapshot
244
244
 
245
245
  Options:
246
246
  -b, [--before-datetime=BEFORE_DATETIME] # Specify the date and time for deletion (delete resources before the specified date and time.)
@@ -253,25 +253,25 @@ Delete the EC2 Snapshot.
253
253
  #### check
254
254
 
255
255
  ```sh
256
- bundle exec seiton ec2_snapshot --before-datetime=2020/01/01 --check
256
+ bundle exec seiton ebs_snapshot --before-datetime=2020/01/01 --check
257
257
  ```
258
258
 
259
259
  #### delete
260
260
 
261
261
  ```sh
262
- bundle exec seiton ec2_snapshot --before-datetime=2020/01/01
262
+ bundle exec seiton ebs_snapshot --before-datetime=2020/01/01
263
263
  ```
264
264
 
265
265
  #### ignore
266
266
 
267
267
  ```sh
268
- bundle exec seiton ec2_snapshot --before-datetime=2020/01/01 --ignores=xxxx yyyy zzzz
268
+ bundle exec seiton ebs_snapshot --before-datetime=2020/01/01 --ignores=xxxx yyyy zzzz
269
269
  ```
270
270
 
271
271
  #### Testing for delete complete
272
272
 
273
273
  ```sh
274
- bundle exec rake check:ec2_snapshots # EC2 Snapshot
274
+ bundle exec rake check:ebs_snapshots # EC2 Snapshot
275
275
  ```
276
276
 
277
277
  ### Delete SQS Queue
@@ -3,12 +3,12 @@ require 'seiton/client'
3
3
  require 'seiton/common'
4
4
  require 'seiton/ext'
5
5
  require 'seiton/checks/ec2'
6
- require 'seiton/ec2'
6
+ require 'seiton/resouces/ec2'
7
7
  require 'seiton/ignores'
8
8
  require 'seiton/checks/rds'
9
- require 'seiton/rds'
9
+ require 'seiton/resouces/rds'
10
10
  require 'seiton/checks/sqs'
11
- require 'seiton/sqs'
11
+ require 'seiton/resouces/sqs'
12
12
  require 'seiton/version'
13
13
 
14
14
  module Seiton
@@ -47,7 +47,7 @@ namespace :check do
47
47
  t.rspec_opts = ["--format documentation"]
48
48
  t.pattern = "spec/\#{target}_spec.rb"
49
49
  t.verbose = true
50
- end if target != 'ec2_snapshot'
50
+ end if target != 'ebs_snapshot'
51
51
  end
52
52
 
53
53
  targets2.each do |target|
@@ -102,7 +102,8 @@ module Seiton
102
102
  end
103
103
  res = ec2_client.describe_images({ owners: ['self'] })
104
104
  delete_images = []
105
- res.images.each do |delete_image|
105
+ _images = res.images.sort_by { |x| x.creation_date }
106
+ _images.each do |delete_image|
106
107
  if datetime_parse(delete_image.creation_date) < datetime_parse(dt)
107
108
  delete_images << delete_image
108
109
  end
@@ -167,7 +168,8 @@ module Seiton
167
168
  end
168
169
  res = ec2_client.describe_snapshots({ owner_ids: ['self'] })
169
170
  delete_snapshots = []
170
- res.snapshots.each do |delete_snapshot|
171
+ _snapshots = res.snapshots.sort_by { |x| x.start_time }
172
+ _snapshots.each do |delete_snapshot|
171
173
  if datetime_parse(delete_snapshot.start_time) < datetime_parse(dt)
172
174
  delete_snapshots << delete_snapshot
173
175
  end
File without changes
File without changes
@@ -1,3 +1,3 @@
1
1
  module Seiton
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seiton
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - inokappa
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-07-16 00:00:00.000000000 Z
11
+ date: 2020-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -131,12 +131,12 @@ files:
131
131
  - lib/seiton/cli.rb
132
132
  - lib/seiton/client.rb
133
133
  - lib/seiton/common.rb
134
- - lib/seiton/ec2.rb
135
134
  - lib/seiton/ext.rb
136
135
  - lib/seiton/ignores.rb
137
136
  - lib/seiton/init.rb
138
- - lib/seiton/rds.rb
139
- - lib/seiton/sqs.rb
137
+ - lib/seiton/resouces/ec2.rb
138
+ - lib/seiton/resouces/rds.rb
139
+ - lib/seiton/resouces/sqs.rb
140
140
  - lib/seiton/version.rb
141
141
  - seiton.gemspec
142
142
  homepage: https://github.com/oreno-tools/seiton