rubberband 0.1.4 → 0.1.5
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.
@@ -55,6 +55,10 @@ module ElasticSearch
|
|
55
55
|
execute(:alias_index, alias_ops, options)
|
56
56
|
end
|
57
57
|
|
58
|
+
def get_aliases(index, options={})
|
59
|
+
execute(:get_aliases, index, options)
|
60
|
+
end
|
61
|
+
|
58
62
|
# options: ignore_conflicts
|
59
63
|
def update_mapping(mapping, options={})
|
60
64
|
index, type, options = extract_required_scope(options)
|
@@ -121,6 +121,10 @@ module ElasticSearch
|
|
121
121
|
standard_request(:post, {:op => "_aliases"}, {}, encoder.encode(operations))
|
122
122
|
end
|
123
123
|
|
124
|
+
def get_aliases(index, options={})
|
125
|
+
standard_request(:get, {:index => index, :op => "_aliases"}, options)
|
126
|
+
end
|
127
|
+
|
124
128
|
def update_mapping(index, type, mapping, options)
|
125
129
|
standard_request(:put, {:index => index, :type => type, :op => "_mapping"}, options, encoder.encode(mapping))
|
126
130
|
end
|
data/spec/admin_spec.rb
CHANGED
@@ -22,4 +22,14 @@ describe "basic ops" do
|
|
22
22
|
@client.update_settings("index" => {"refresh_interval" => 30})
|
23
23
|
@client.get_settings(@first_index)[@first_index]["settings"].should include("index.refresh_interval" => "30")
|
24
24
|
end
|
25
|
+
|
26
|
+
it "should get and update aliases" do
|
27
|
+
@client.alias_index(:add => { @first_index => "#{@first_index}-alias" })
|
28
|
+
result = @client.get_aliases(@first_index)
|
29
|
+
result[@first_index]["aliases"].keys.should include("#{@first_index}-alias")
|
30
|
+
@client.alias_index(:add => { @first_index => "#{@first_index}-alias2" }, :remove => { @first_index => "#{@first_index}-alias" })
|
31
|
+
result = @client.get_aliases(@first_index)
|
32
|
+
result[@first_index]["aliases"].keys.should_not include("#{@first_index}-alias")
|
33
|
+
result[@first_index]["aliases"].keys.should include("#{@first_index}-alias2")
|
34
|
+
end
|
25
35
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubberband
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 5
|
10
|
+
version: 0.1.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Grant Rodgers
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-11-04 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: patron
|