elasticsearch-api 1.0.11 → 1.0.12
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/lib/elasticsearch/api/actions/delete.rb +3 -1
- data/lib/elasticsearch/api/actions/get.rb +3 -1
- data/lib/elasticsearch/api/actions/get_template.rb +3 -1
- data/lib/elasticsearch/api/actions/indices/delete.rb +3 -1
- data/lib/elasticsearch/api/actions/indices/delete_template.rb +3 -1
- data/lib/elasticsearch/api/actions/update.rb +3 -1
- data/lib/elasticsearch/api/version.rb +1 -1
- data/test/unit/delete_document_test.rb +9 -1
- data/test/unit/get_document_test.rb +8 -0
- data/test/unit/get_template_test.rb +15 -0
- data/test/unit/indices/delete_template_test.rb +10 -2
- data/test/unit/indices/delete_test.rb +8 -0
- data/test/unit/update_document_test.rb +9 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62247808bb72f7ae656b190ea047eeb8a93160f2
|
4
|
+
data.tar.gz: 0ab2745690ffc9e0e5243b050ade10dea4fec177
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04845dd1ec5918fdd884ced7eed2772f15e3e73b56462d8e4859964e55a099af166dd9cf7df5715141aa69a286fbdb91bbe7360f4133d60b9f38953e86e0c1b5
|
7
|
+
data.tar.gz: 4e0f8f9f1e1d4853d48acc0f583af99b8d84693af566e18eb8f775fc0e3b0b1e731964a54bf40391d9d5b24f784a093f25efc5be593bfb637a70722530893130
|
@@ -51,7 +51,9 @@ module Elasticsearch
|
|
51
51
|
params = Utils.__validate_and_extract_params arguments, valid_params
|
52
52
|
body = nil
|
53
53
|
|
54
|
-
|
54
|
+
if Array(arguments[:ignore]).include?(404)
|
55
|
+
Utils.__rescue_from_not_found { perform_request(method, path, params, body).body }
|
56
|
+
else
|
55
57
|
perform_request(method, path, params, body).body
|
56
58
|
end
|
57
59
|
end
|
@@ -61,7 +61,9 @@ module Elasticsearch
|
|
61
61
|
|
62
62
|
params[:fields] = Utils.__listify(params[:fields]) if params[:fields]
|
63
63
|
|
64
|
-
|
64
|
+
if Array(arguments[:ignore]).include?(404)
|
65
|
+
Utils.__rescue_from_not_found { perform_request(method, path, params, body).body }
|
66
|
+
else
|
65
67
|
perform_request(method, path, params, body).body
|
66
68
|
end
|
67
69
|
end
|
@@ -16,7 +16,9 @@ module Elasticsearch
|
|
16
16
|
params = {}
|
17
17
|
body = arguments[:body]
|
18
18
|
|
19
|
-
|
19
|
+
if Array(arguments[:ignore]).include?(404)
|
20
|
+
Utils.__rescue_from_not_found { perform_request(method, path, params, body).body }
|
21
|
+
else
|
20
22
|
perform_request(method, path, params, body).body
|
21
23
|
end
|
22
24
|
end
|
@@ -38,7 +38,9 @@ module Elasticsearch
|
|
38
38
|
params = Utils.__validate_and_extract_params arguments, valid_params
|
39
39
|
body = nil
|
40
40
|
|
41
|
-
|
41
|
+
if Array(arguments[:ignore]).include?(404)
|
42
|
+
Utils.__rescue_from_not_found { perform_request(method, path, params, body).body }
|
43
|
+
else
|
42
44
|
perform_request(method, path, params, body).body
|
43
45
|
end
|
44
46
|
end
|
@@ -28,7 +28,9 @@ module Elasticsearch
|
|
28
28
|
params = Utils.__validate_and_extract_params arguments, valid_params
|
29
29
|
body = nil
|
30
30
|
|
31
|
-
|
31
|
+
if Array(arguments[:ignore]).include?(404)
|
32
|
+
Utils.__rescue_from_not_found { perform_request(method, path, params, body).body }
|
33
|
+
else
|
32
34
|
perform_request(method, path, params, body).body
|
33
35
|
end
|
34
36
|
end
|
@@ -94,7 +94,9 @@ module Elasticsearch
|
|
94
94
|
|
95
95
|
params[:fields] = Utils.__listify(params[:fields]) if params[:fields]
|
96
96
|
|
97
|
-
|
97
|
+
if Array(arguments[:ignore]).include?(404)
|
98
|
+
Utils.__rescue_from_not_found { perform_request(method, path, params, body).body }
|
99
|
+
else
|
98
100
|
perform_request(method, path, params, body).body
|
99
101
|
end
|
100
102
|
end
|
@@ -62,11 +62,19 @@ module Elasticsearch
|
|
62
62
|
subject.delete :index => 'foo^bar', :type => 'bar/bam', :id => 1
|
63
63
|
end
|
64
64
|
|
65
|
+
should "raise a NotFound exception" do
|
66
|
+
subject.expects(:perform_request).raises(NotFound)
|
67
|
+
|
68
|
+
assert_raise NotFound do
|
69
|
+
subject.delete :index => 'foo', :type => 'bar', :id => 'XXX'
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
65
73
|
should "catch a NotFound exception with the ignore parameter" do
|
66
74
|
subject.expects(:perform_request).raises(NotFound)
|
67
75
|
|
68
76
|
assert_nothing_raised do
|
69
|
-
subject.
|
77
|
+
subject.delete :index => 'foo', :type => 'bar', :id => 'XXX', :ignore => 404
|
70
78
|
end
|
71
79
|
end
|
72
80
|
|
@@ -62,6 +62,14 @@ module Elasticsearch
|
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
65
|
+
should "raise a NotFound exception" do
|
66
|
+
subject.expects(:perform_request).raises(NotFound)
|
67
|
+
|
68
|
+
assert_raise NotFound do
|
69
|
+
subject.get :index => 'foo', :type => 'bar', :id => 'XXX'
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
65
73
|
should "catch a NotFound exception with the ignore parameter" do
|
66
74
|
subject.expects(:perform_request).raises(NotFound)
|
67
75
|
|
@@ -19,6 +19,21 @@ module Elasticsearch
|
|
19
19
|
subject.get_template :id => "foo"
|
20
20
|
end
|
21
21
|
|
22
|
+
should "raise a NotFound exception" do
|
23
|
+
subject.expects(:perform_request).raises(NotFound)
|
24
|
+
|
25
|
+
assert_raise NotFound do
|
26
|
+
subject.get_template :id => "foo"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
should "catch a NotFound exception with the ignore parameter" do
|
31
|
+
subject.expects(:perform_request).raises(NotFound)
|
32
|
+
|
33
|
+
assert_nothing_raised do
|
34
|
+
subject.get_template :id => "foo", :ignore => 404
|
35
|
+
end
|
36
|
+
end
|
22
37
|
end
|
23
38
|
|
24
39
|
end
|
@@ -28,11 +28,19 @@ module Elasticsearch
|
|
28
28
|
subject.indices.delete_template :name => 'foo^bar'
|
29
29
|
end
|
30
30
|
|
31
|
-
should "
|
31
|
+
should "raise a NotFound exception" do
|
32
|
+
subject.expects(:perform_request).raises(NotFound)
|
33
|
+
|
34
|
+
assert_raise NotFound do
|
35
|
+
assert ! subject.indices.delete_template(:name => 'foo')
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
should "catch a NotFound exception with the ignore parameter" do
|
32
40
|
subject.expects(:perform_request).raises(NotFound)
|
33
41
|
|
34
42
|
assert_nothing_raised do
|
35
|
-
assert ! subject.indices.delete_template(:name => 'foo
|
43
|
+
assert ! subject.indices.delete_template(:name => 'foo', :ignore => 404)
|
36
44
|
end
|
37
45
|
end
|
38
46
|
|
@@ -47,6 +47,14 @@ module Elasticsearch
|
|
47
47
|
subject.indices.delete :index => 'foo^bar'
|
48
48
|
end
|
49
49
|
|
50
|
+
should "raise a NotFound exception" do
|
51
|
+
subject.expects(:perform_request).raises(NotFound)
|
52
|
+
|
53
|
+
assert_raise NotFound do
|
54
|
+
subject.indices.delete :index => 'foo'
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
50
58
|
should "catch a NotFound exception with the ignore parameter" do
|
51
59
|
subject.expects(:perform_request).raises(NotFound)
|
52
60
|
|
@@ -62,11 +62,19 @@ module Elasticsearch
|
|
62
62
|
subject.update :index => 'foo^bar', :type => 'bar/bam', :id => '1', :body => {}
|
63
63
|
end
|
64
64
|
|
65
|
+
should "raise a NotFound exception" do
|
66
|
+
subject.expects(:perform_request).raises(NotFound)
|
67
|
+
|
68
|
+
assert_raise NotFound do
|
69
|
+
subject.update :index => 'foo', :type => 'bar', :id => 'XXX'
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
65
73
|
should "catch a NotFound exception with the ignore parameter" do
|
66
74
|
subject.expects(:perform_request).raises(NotFound)
|
67
75
|
|
68
76
|
assert_nothing_raised do
|
69
|
-
subject.
|
77
|
+
subject.update :index => 'foo', :type => 'bar', :id => 'XXX', :ignore => 404
|
70
78
|
end
|
71
79
|
end
|
72
80
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elasticsearch-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Karel Minarik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|