elastic_manager 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e6b6ecff33c33dfd85656361295f382bb7066d32f243caa7f82e17899d227c59
4
- data.tar.gz: dbd77f28e53ec7b0de9ebfcb9459a310f2109a471251e5eeccf6813c29a23efc
3
+ metadata.gz: e928c0ce49a3b4d9afd1bc6aabb4eadd6aeee5820488454f603292c33aa34e4a
4
+ data.tar.gz: 5edb38e1697dde5693ec7d82d8cf1b05d213e43b0100008ab705baf6d0bf108e
5
5
  SHA512:
6
- metadata.gz: ab3c79bfef6496c12d58ad9328ab9d7ac77fc376f5eb31c15e01419521a46cf8eca853acb889975418c9dab01786a3521bfac6c2e53ccb555a902e152fc131b2
7
- data.tar.gz: 7d3c319620d24c89404ee99735bebca5ba291edab925fc85471d2192015ad5a74d97b7dc953d8c640250906f14edfacbffdd8055bdeb7afd4f9fb8dc786f8244
6
+ metadata.gz: 4223191db7bd7ae0e0c06c20c67927a97289f4618ac4a8ba2e2c2afe8e9a334a2bd99552259f70e36c3e600142c9255cf0d8ef4a72aa6bb419a86be1d83d215a
7
+ data.tar.gz: 40233f8a8a54b785459d627724637431861bd07d09a0dd34c00da38d2dc7a4e174e39ea83059cda6550e5a9d753dc0ded1b7126a184afca1b428a9a7bbb9394a
data/README.md CHANGED
@@ -23,4 +23,5 @@ Progress:
23
23
  - [x] Snapshot indices
24
24
  - [x] Delete snapshots
25
25
  - [x] Override daysago for concrete index
26
- - [x] Skip any task for specific index
26
+ - [x] Skip any task for specific index
27
+ - [ ] Skip index deleting when snapshot if configured
@@ -3,7 +3,7 @@
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'elastic_manager'
5
5
  s.executables = ['elastic_manager']
6
- s.version = '0.2.3'
6
+ s.version = '0.2.4'
7
7
  s.date = '2018-10-15'
8
8
  s.summary = 'Because qurator sucks'
9
9
  s.description = 'Manager for logstash indices in elastic'
@@ -350,6 +350,7 @@ module Request
350
350
  if state == 'SUCCESS'
351
351
  snapshot_ok = true
352
352
  elsif %w[FAILED PARTIAL INCOMPATIBLE].include?(state)
353
+ # TODO: (anton.ryabov) add slack notify due failed snapshot
353
354
  log.fatal "can't snapshot #{snapshot} in #{repo}: #{response.code} - #{response}"
354
355
  exit 1
355
356
  end
@@ -366,18 +367,19 @@ module Request
366
367
  snapshot_repo = find_snapshot_repo
367
368
 
368
369
  body = {
369
- 'indices' => index,
370
+ 'indices' => CGI.unescape(index),
370
371
  'ignore_unavailable' => false,
371
372
  'include_global_state' => false,
372
373
  'partial' => false
373
374
  }
374
375
 
375
- response = request(:put, "/_snapshot/#{snapshot_repo}/#{snapshot_name}/", body)
376
+ response = request(:put, "/_snapshot/#{snapshot_repo}/#{index}/", body)
376
377
 
377
378
  if response.code == 200
378
379
  sleep 5
379
380
  wait_snapshot(snapshot_name, snapshot_repo)
380
381
  else
382
+ # TODO: (anton.ryabov) add slack notify due failed snapshot
381
383
  log.error "can't snapshot #{index}, response was: #{response.code} - #{response}"
382
384
  false
383
385
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elastic_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Antony Ryabov