Skip to content

Commit ae8e362

Browse files
committed
[API] Removes xpack endpoints and reorganizes tests
Open and Close point in time moved from elasticsearch-xpack to elasticsearch-api. Freeze and unfreeze indices are in XPack.
1 parent 4775775 commit ae8e362

File tree

9 files changed

+12
-370
lines changed

9 files changed

+12
-370
lines changed

elasticsearch-api/lib/elasticsearch/api/actions/indices/freeze.rb

-66
This file was deleted.

elasticsearch-api/lib/elasticsearch/api/actions/indices/unfreeze.rb

-66
This file was deleted.

elasticsearch-xpack/lib/elasticsearch/xpack.rb

-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ class Client
5050
# E.g.: client.xpack.usage => client.usage
5151
# Excluding `info` since OSS and XPACK both have info endpoints.
5252
TOP_LEVEL_METHODS = [
53-
:open_point_in_time,
54-
:close_point_in_time,
5553
:usage
5654
].freeze
5755

elasticsearch-xpack/lib/elasticsearch/xpack/api/actions/close_point_in_time.rb

-44
This file was deleted.

elasticsearch-xpack/lib/elasticsearch/xpack/api/actions/open_point_in_time.rb

-66
This file was deleted.

elasticsearch-api/spec/elasticsearch/api/actions/indices/freeze_spec.rb elasticsearch-xpack/spec/xpack/freeze_spec.rb

+6-11
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,13 @@
1818
require 'spec_helper'
1919

2020
describe 'client.indices#freeze' do
21-
2221
let(:expected_args) do
2322
[
24-
'POST',
25-
url,
26-
params,
27-
nil,
28-
{}
23+
'POST',
24+
url,
25+
params,
26+
nil,
27+
{}
2928
]
3029
end
3130

@@ -34,9 +33,8 @@
3433
end
3534

3635
context 'when there is no index specified' do
37-
3836
let(:client) do
39-
Class.new { include Elasticsearch::API }.new
37+
Class.new { include Elasticsearch::XPack::API }.new
4038
end
4139

4240
it 'raises an exception' do
@@ -47,7 +45,6 @@
4745
end
4846

4947
context 'when an index is specified' do
50-
5148
let(:url) do
5249
'foo/_freeze'
5350
end
@@ -58,7 +55,6 @@
5855
end
5956

6057
context 'when params are specified' do
61-
6258
let(:params) do
6359
{ timeout: '1s' }
6460
end
@@ -73,7 +69,6 @@
7369
end
7470

7571
context 'when the path must be URL-escaped' do
76-
7772
let(:url) do
7873
'foo%5Ebar/_freeze'
7974
end

elasticsearch-api/spec/elasticsearch/api/actions/indices/unfreeze_spec.rb elasticsearch-xpack/spec/xpack/unfreeze_spec.rb

+6-11
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,13 @@
1818
require 'spec_helper'
1919

2020
describe 'client.indices#unfreeze' do
21-
2221
let(:expected_args) do
2322
[
24-
'POST',
25-
url,
26-
params,
27-
nil,
28-
{}
23+
'POST',
24+
url,
25+
params,
26+
nil,
27+
{}
2928
]
3029
end
3130

@@ -34,9 +33,8 @@
3433
end
3534

3635
context 'when there is no index specified' do
37-
3836
let(:client) do
39-
Class.new { include Elasticsearch::API }.new
37+
Class.new { include Elasticsearch::XPack::API }.new
4038
end
4139

4240
it 'raises an exception' do
@@ -47,7 +45,6 @@
4745
end
4846

4947
context 'when an index is specified' do
50-
5148
let(:url) do
5249
'foo/_unfreeze'
5350
end
@@ -58,7 +55,6 @@
5855
end
5956

6057
context 'when params are specified' do
61-
6258
let(:params) do
6359
{ timeout: '1s' }
6460
end
@@ -73,7 +69,6 @@
7369
end
7470

7571
context 'when the path must be URL-escaped' do
76-
7772
let(:url) do
7873
'foo%5Ebar/_unfreeze'
7974
end

0 commit comments

Comments
 (0)