elastic_manager 0.1.8 → 0.1.9
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/elastic_manager.gemspec +1 -1
- data/lib/elastic_manager/chill.rb +2 -2
- data/lib/elastic_manager/close.rb +2 -2
- data/lib/elastic_manager/delete.rb +2 -2
- data/lib/elastic_manager/open.rb +4 -4
- data/lib/elastic_manager/request.rb +10 -9
- data/lib/elastic_manager/snapdelete.rb +2 -2
- data/lib/elastic_manager/snapshot.rb +2 -2
- data/lib/elastic_manager/utils.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 148e67ba5bd9356c710f18b2ffb120b98bcc8c44d7f2e604ab4c88c593b17909
|
4
|
+
data.tar.gz: 69f86a4c5b4459edba65c181338d13017502c649ec41066ce3912dc0f45f7d1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8c53506b2b2d32261db8f38b6eeb955bd471617a006de6724bc4256754a6d5551826b5554bcd8ac24b992386e688351949f783a77d435a240d84f2049e785d6
|
7
|
+
data.tar.gz: 4d39477d8cba63dbdb51097032ba2121b5b5310f0c0b07c7232c0b34e258f586d0e4357415e15357d7359c29ac9add5404a9058f05246cfdc26c035b3e48b8a1
|
data/elastic_manager.gemspec
CHANGED
@@ -10,10 +10,10 @@ module Chill
|
|
10
10
|
result = []
|
11
11
|
|
12
12
|
if indices.length == 1 && indices.first == '_all'
|
13
|
-
result = @elastic.all_indices(date_from, date_to, daysago, 'open', @config['settings']['box_types']['ingest'], @config
|
13
|
+
result = @elastic.all_indices(date_from, date_to, daysago, 'open', @config['settings']['box_types']['ingest'], @config)
|
14
14
|
else
|
15
15
|
if date_from.nil?
|
16
|
-
result = @elastic.all_indices(date_from, date_to, daysago, 'open', @config['settings']['box_types']['ingest'], @config
|
16
|
+
result = @elastic.all_indices(date_from, date_to, daysago, 'open', @config['settings']['box_types']['ingest'], @config).select { |r| r.start_with?(*indices) }
|
17
17
|
else
|
18
18
|
date_from.upto(date_to) do |date|
|
19
19
|
indices.each do |index|
|
@@ -10,10 +10,10 @@ module Close
|
|
10
10
|
result = []
|
11
11
|
|
12
12
|
if indices.length == 1 && indices.first == '_all'
|
13
|
-
result = @elastic.all_indices(date_from, date_to, daysago, 'open', nil, @config
|
13
|
+
result = @elastic.all_indices(date_from, date_to, daysago, 'open', nil, @config)
|
14
14
|
else
|
15
15
|
if date_from.nil?
|
16
|
-
result = @elastic.all_indices(date_from, date_to, daysago, 'open', nil, @config
|
16
|
+
result = @elastic.all_indices(date_from, date_to, daysago, 'open', nil, @config).select { |r| r.start_with?(*indices) }
|
17
17
|
else
|
18
18
|
date_from.upto(date_to) do |date|
|
19
19
|
indices.each do |index|
|
@@ -10,10 +10,10 @@ module Delete
|
|
10
10
|
result = []
|
11
11
|
|
12
12
|
if indices.length == 1 && indices.first == '_all'
|
13
|
-
result = @elastic.all_indices(date_from, date_to, daysago, nil, nil, @config
|
13
|
+
result = @elastic.all_indices(date_from, date_to, daysago, nil, nil, @config)
|
14
14
|
else
|
15
15
|
if date_from.nil?
|
16
|
-
result = @elastic.all_indices(date_from, date_to, daysago, nil, nil, @config
|
16
|
+
result = @elastic.all_indices(date_from, date_to, daysago, nil, nil, @config).select { |r| r.start_with?(*indices) }
|
17
17
|
else
|
18
18
|
date_from.upto(date_to) do |date|
|
19
19
|
indices.each do |index|
|
data/lib/elastic_manager/open.rb
CHANGED
@@ -10,14 +10,14 @@ module Open
|
|
10
10
|
result = []
|
11
11
|
|
12
12
|
if indices.length == 1 && indices.first == '_all'
|
13
|
-
result = @elastic.all_indices(date_from, date_to, daysago, 'close', nil, @config
|
14
|
-
result += @elastic.all_indices_in_snapshots(date_from, date_to, daysago, @config
|
13
|
+
result = @elastic.all_indices(date_from, date_to, daysago, 'close', nil, @config)
|
14
|
+
result += @elastic.all_indices_in_snapshots(date_from, date_to, daysago, @config)
|
15
15
|
return result
|
16
16
|
end
|
17
17
|
|
18
18
|
if date_from.nil?
|
19
|
-
result = @elastic.all_indices(date_from, date_to, daysago, 'close', nil, @config
|
20
|
-
result += @elastic.all_indices_in_snapshots(date_from, date_to, daysago, @config
|
19
|
+
result = @elastic.all_indices(date_from, date_to, daysago, 'close', nil, @config)
|
20
|
+
result += @elastic.all_indices_in_snapshots(date_from, date_to, daysago, @config)
|
21
21
|
return result.select { |r| r.start_with?(*indices) }
|
22
22
|
else
|
23
23
|
date_from.upto(date_to) do |date|
|
@@ -70,17 +70,18 @@ module Request
|
|
70
70
|
false
|
71
71
|
end
|
72
72
|
|
73
|
-
def override_daysago(index_name,
|
74
|
-
if
|
75
|
-
|
76
|
-
|
77
|
-
|
73
|
+
def override_daysago(index_name, config, daysago)
|
74
|
+
if config[index_name] &&
|
75
|
+
config[index_name]['daysago'] &&
|
76
|
+
config[index_name]['daysago'][config['task']] &&
|
77
|
+
!config[index_name]['daysago'][config['task']].to_s.empty?
|
78
|
+
config[index_name]['daysago']
|
78
79
|
else
|
79
80
|
daysago
|
80
81
|
end
|
81
82
|
end
|
82
83
|
|
83
|
-
def all_indices_in_snapshots(from=nil, to=nil, daysago=nil,
|
84
|
+
def all_indices_in_snapshots(from=nil, to=nil, daysago=nil, config)
|
84
85
|
all_snapshots = get_all_snapshots
|
85
86
|
all_snapshots.select! { |snap| snap['status'] == 'SUCCESS' }
|
86
87
|
|
@@ -94,7 +95,7 @@ module Request
|
|
94
95
|
end
|
95
96
|
|
96
97
|
index = snap['id'].gsub('snapshot_', '')
|
97
|
-
daysago_local = override_daysago(make_index_name(index),
|
98
|
+
daysago_local = override_daysago(make_index_name(index), config, daysago)
|
98
99
|
|
99
100
|
if from.nil? && snap_date < (Date.today - daysago_local)
|
100
101
|
result << CGI.escape(index)
|
@@ -118,7 +119,7 @@ module Request
|
|
118
119
|
end
|
119
120
|
end
|
120
121
|
|
121
|
-
def all_indices(from=nil, to=nil, daysago=nil, state=nil, type=nil,
|
122
|
+
def all_indices(from=nil, to=nil, daysago=nil, state=nil, type=nil, config)
|
122
123
|
indices = get_all_indices
|
123
124
|
|
124
125
|
# TODO: (anton.ryabov) next line just for debug purpose, need better handling
|
@@ -136,7 +137,7 @@ module Request
|
|
136
137
|
next
|
137
138
|
end
|
138
139
|
|
139
|
-
daysago_local = override_daysago(make_index_name(index),
|
140
|
+
daysago_local = override_daysago(make_index_name(index), config, daysago)
|
140
141
|
|
141
142
|
if from.nil? && index_date < (Date.today - daysago_local)
|
142
143
|
result << CGI.escape(index)
|
@@ -10,10 +10,10 @@ module SnapDelete
|
|
10
10
|
result = []
|
11
11
|
|
12
12
|
if indices.length == 1 && indices.first == '_all'
|
13
|
-
result = @elastic.all_indices_in_snapshots(date_from, date_to, daysago, @config
|
13
|
+
result = @elastic.all_indices_in_snapshots(date_from, date_to, daysago, @config)
|
14
14
|
else
|
15
15
|
if date_from.nil?
|
16
|
-
result = @elastic.all_indices_in_snapshots(date_from, date_to, daysago, @config
|
16
|
+
result = @elastic.all_indices_in_snapshots(date_from, date_to, daysago, @config).select { |r| r.start_with?(*indices) }
|
17
17
|
else
|
18
18
|
date_from.upto(date_to) do |date|
|
19
19
|
indices.each do |index|
|
@@ -10,10 +10,10 @@ module Snapshot
|
|
10
10
|
result = []
|
11
11
|
|
12
12
|
if indices.length == 1 && indices.first == '_all'
|
13
|
-
result = @elastic.all_indices(date_from, date_to, daysago, nil, @config['settings']['box_types']['store'], @config
|
13
|
+
result = @elastic.all_indices(date_from, date_to, daysago, nil, @config['settings']['box_types']['store'], @config)
|
14
14
|
else
|
15
15
|
if date_from.nil?
|
16
|
-
result = @elastic.all_indices(date_from, date_to, daysago, nil, @config['settings']['box_types']['store'], @config
|
16
|
+
result = @elastic.all_indices(date_from, date_to, daysago, nil, @config['settings']['box_types']['store'], @config).select { |r| r.start_with?(*indices) }
|
17
17
|
else
|
18
18
|
date_from.upto(date_to) do |date|
|
19
19
|
indices.each do |index|
|