Skip to content

Commit c623cac

Browse files
committed
[API] Update OSS generated endpoints
1 parent b35538b commit c623cac

File tree

7 files changed

+141
-5
lines changed

7 files changed

+141
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module Actions
3232

3333
# @option arguments [Hash] :headers Custom HTTP headers
3434
#
35-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-blocks.html
35+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-blocks.html
3636
#
3737
def add_block(arguments = {})
3838
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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 Indices
21+
module Actions
22+
# Provides statistics on operations happening in a data stream.
23+
#
24+
# @option arguments [List] :name A comma-separated list of data stream names; use `_all` or empty string to perform the operation on all data streams
25+
# @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both.
26+
# (options: open,closed,hidden,none,all)
27+
28+
# @option arguments [Boolean] :forbid_closed_indices If set to false stats will also collected from closed indices if explicitly specified or if expand_wildcards expands to closed indices
29+
# @option arguments [Hash] :headers Custom HTTP headers
30+
#
31+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.x/data-streams.html
32+
#
33+
def data_streams_stats(arguments = {})
34+
headers = arguments.delete(:headers) || {}
35+
36+
arguments = arguments.clone
37+
38+
_name = arguments.delete(:name)
39+
40+
method = Elasticsearch::API::HTTP_GET
41+
path = if _name
42+
"_data_stream/#{Utils.__listify(_name)}/_stats"
43+
else
44+
"_data_stream/_stats"
45+
end
46+
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
47+
48+
body = nil
49+
perform_request(method, path, params, body, headers).body
50+
end
51+
52+
# Register this action with its valid params when the module is loaded.
53+
#
54+
# @since 6.2.0
55+
ParamsRegistry.register(:data_streams_stats, [
56+
:expand_wildcards,
57+
:forbid_closed_indices
58+
].freeze)
59+
end
60+
end
61+
end
62+
end

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module Indices
2121
module Actions
2222
# Deletes a data stream.
2323
#
24-
# @option arguments [String] :name The name of the data stream
24+
# @option arguments [List] :name A comma-separated list of data streams to delete; use `*` to delete all data streams
2525
# @option arguments [Hash] :headers Custom HTTP headers
2626
#
2727
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.x/data-streams.html

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module Indices
2121
module Actions
2222
# Returns data streams.
2323
#
24-
# @option arguments [String] :name The name or wildcard expression of the requested data streams
24+
# @option arguments [List] :name A comma-separated list of data streams to get; use `*` to get all data streams
2525
# @option arguments [Hash] :headers Custom HTTP headers
2626
#
2727
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.x/data-streams.html

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ module Actions
3131
# @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both.
3232
# (options: open,closed,hidden,none,all)
3333

34+
# @option arguments [Boolean] :write_index_only When true, applies mappings only to the write index of an alias or data stream
3435
# @option arguments [Hash] :headers Custom HTTP headers
3536
# @option arguments [Hash] :body The mapping definition (*Required*)
3637
#
@@ -75,7 +76,8 @@ def put_mapping(arguments = {})
7576
:master_timeout,
7677
:ignore_unavailable,
7778
:allow_no_indices,
78-
:expand_wildcards
79+
:expand_wildcards,
80+
:write_index_only
7981
].freeze)
8082
end
8183
end

elasticsearch-api/lib/elasticsearch/api/actions/nodes/stats.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module Actions
2323
#
2424
# @option arguments [List] :node_id A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes
2525
# @option arguments [List] :metric Limit the information returned to the specified metrics
26-
# (options: _all,breaker,fs,http,indices,jvm,os,process,thread_pool,transport,discovery)
26+
# (options: _all,breaker,fs,http,indices,jvm,os,process,thread_pool,transport,discovery,indexing_pressure)
2727

2828
# @option arguments [List] :index_metric Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified.
2929
# (options: _all,completion,docs,fielddata,query_cache,flush,get,indexing,merge,request_cache,refresh,search,segments,store,warmer,suggest)
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
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.indices#data_streams_stats' do
21+
let(:expected_args) do
22+
[
23+
'GET',
24+
url,
25+
params,
26+
nil,
27+
{}
28+
]
29+
end
30+
31+
let(:params) do
32+
{}
33+
end
34+
35+
context 'when there is no name specified' do
36+
let(:url) do
37+
'_data_stream/_stats'
38+
end
39+
40+
let(:client) do
41+
Class.new { include Elasticsearch::API }.new
42+
end
43+
44+
it 'performs the request' do
45+
expect(client_double.indices.data_streams_stats).to eq({})
46+
end
47+
end
48+
49+
context 'when name is specified' do
50+
let(:url) do
51+
'_data_stream/foo/_stats'
52+
end
53+
54+
it 'performs the request' do
55+
expect(client_double.indices.data_streams_stats(name: 'foo')).to eq({})
56+
end
57+
end
58+
59+
context 'when params are specified' do
60+
let(:params) do
61+
{ expand_wildcards: '*' }
62+
end
63+
64+
let(:url) do
65+
'_data_stream/foo/_stats'
66+
end
67+
68+
it 'performs the request' do
69+
expect(client_double.indices.data_streams_stats(name: 'foo', expand_wildcards: '*')).to eq({})
70+
end
71+
end
72+
end

0 commit comments

Comments
 (0)