Skip to content

Commit fc880b3

Browse files
committed
[API] Update latest 7.x API
1 parent 9f53707 commit fc880b3

File tree

5 files changed

+95
-2
lines changed

5 files changed

+95
-2
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ module Actions
2626
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
2727
# @option arguments [List] :h Comma-separated list of column names to display
2828
# @option arguments [Boolean] :help Return help information
29+
# @option arguments [Boolean] :include_bootstrap Include bootstrap plugins in the response
2930
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
3031
# @option arguments [Boolean] :v Verbose mode. Display column headers
3132
# @option arguments [Hash] :headers Custom HTTP headers
@@ -54,6 +55,7 @@ def plugins(arguments = {})
5455
:master_timeout,
5556
:h,
5657
:help,
58+
:include_bootstrap,
5759
:s,
5860
:v
5961
].freeze)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module Actions
2727
# @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed)
2828
# @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
2929
# @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
30-
# @option arguments [String] :wait_for_active_shards Sets the number of active shards to wait for before the operation returns.
30+
# @option arguments [String] :wait_for_active_shards Sets the number of active shards to wait for before the operation returns. Set to `index-setting` to wait according to the index setting `index.write.wait_for_active_shards`, or `all` to wait for all shards, or an integer. Defaults to `0`.
3131
# @option arguments [Hash] :headers Custom HTTP headers
3232
#
3333
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-open-close.html

elasticsearch-api/lib/elasticsearch/api/actions/search.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ module Actions
6464
# @option arguments [Number] :max_concurrent_shard_requests The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests
6565
# @option arguments [Number] :pre_filter_shard_size A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.
6666
# @option arguments [Boolean] :rest_total_hits_as_int Indicates whether hits.total should be rendered as an integer or an object in the rest search response
67+
# @option arguments [String] :min_compatible_shard_node The minimum compatible version that all shards involved in search should have for this request to be successful
6768
# @option arguments [Hash] :headers Custom HTTP headers
6869
# @option arguments [Hash] :body The search definition using the Query DSL
6970
#
@@ -148,7 +149,8 @@ def search(arguments = {})
148149
:batched_reduce_size,
149150
:max_concurrent_shard_requests,
150151
:pre_filter_shard_size,
151-
:rest_total_hits_as_int
152+
:rest_total_hits_as_int,
153+
:min_compatible_shard_node
152154
].freeze)
153155
end
154156
end
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Licensed to Elasticsearch B.V. under one or more contributor
2+
# license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright
4+
# ownership. Elasticsearch B.V. licenses this file to you under
5+
# the Apache License, Version 2.0 (the "License"); you may
6+
# not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
module Elasticsearch
19+
module API
20+
module Snapshot
21+
module Actions
22+
# Returns a list of features which can be snapshotted in this cluster.
23+
#
24+
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
25+
# @option arguments [Hash] :headers Custom HTTP headers
26+
#
27+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html
28+
#
29+
def get_features(arguments = {})
30+
headers = arguments.delete(:headers) || {}
31+
32+
arguments = arguments.clone
33+
34+
method = Elasticsearch::API::HTTP_GET
35+
path = "_snapshottable_features"
36+
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
37+
38+
body = nil
39+
perform_request(method, path, params, body, headers).body
40+
end
41+
42+
# Register this action with its valid params when the module is loaded.
43+
#
44+
# @since 6.2.0
45+
ParamsRegistry.register(:get_features, [
46+
:master_timeout
47+
].freeze)
48+
end
49+
end
50+
end
51+
end
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Licensed to Elasticsearch B.V. under one or more contributor
2+
# license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright
4+
# ownership. Elasticsearch B.V. licenses this file to you under
5+
# the Apache License, Version 2.0 (the "License"); you may
6+
# not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
require 'spec_helper'
19+
20+
describe 'client.snapshot#get' do
21+
let(:expected_args) do
22+
[
23+
'GET',
24+
'_snapshottable_features',
25+
{},
26+
nil,
27+
{}
28+
]
29+
end
30+
31+
let(:client) do
32+
Class.new { include Elasticsearch::API }.new
33+
end
34+
35+
it 'performs the request' do
36+
expect(client_double.snapshot.get_features).to eq({})
37+
end
38+
end

0 commit comments

Comments
 (0)