Skip to content

Commit f7bf832

Browse files
committed
[API] Ensure that the :index param is supported for cat.segments
1 parent f26d9e5 commit f7bf832

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

elasticsearch-api/lib/elasticsearch/api/actions/cat/segments.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def segments(arguments={})
4848
#
4949
# @since 6.1.1
5050
ParamsRegistry.register(:segments, [
51+
:index,
5152
:format,
5253
:bytes,
5354
:h,

elasticsearch-api/spec/elasticsearch/api/actions/cat/segments_spec.rb

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,29 @@
2323
[
2424
'GET',
2525
'_cat/segments',
26-
{},
26+
params,
2727
nil,
2828
nil
2929
]
3030
end
3131

32+
let(:params) do
33+
{}
34+
end
35+
3236
it 'performs the request' do
3337
expect(client_double.cat.segments).to eq({})
3438
end
39+
40+
context 'when index is specified' do
41+
42+
43+
let(:params) do
44+
{ index: 'foo' }
45+
end
46+
47+
it 'performs the request' do
48+
expect(client_double.cat.segments(index: 'foo')).to eq({})
49+
end
50+
end
3551
end

0 commit comments

Comments
 (0)