Skip to content

Commit c5be393

Browse files
committed
[XPACK] Adds expand_wildcards to get and delete data stream
1 parent 6858b64 commit c5be393

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ module Actions
2323
# Deletes a data stream.
2424
#
2525
# @option arguments [List] :name A comma-separated list of data streams to delete; use `*` to delete all data streams
26+
# @option arguments [String] :expand_wildcards Whether wildcard expressions should get expanded to open or closed indices (default: open) (options: open, closed, hidden, none, all)
2627
# @option arguments [Hash] :headers Custom HTTP headers
2728
#
2829
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.x/data-streams.html
@@ -38,11 +39,18 @@ def delete_data_stream(arguments = {})
3839

3940
method = Elasticsearch::API::HTTP_DELETE
4041
path = "_data_stream/#{Elasticsearch::API::Utils.__listify(_name)}"
41-
params = {}
42+
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
4243

4344
body = nil
4445
perform_request(method, path, params, body, headers).body
4546
end
47+
48+
# Register this action with its valid params when the module is loaded.
49+
#
50+
# @since 6.2.0
51+
ParamsRegistry.register(:delete_data_stream, [
52+
:expand_wildcards
53+
].freeze)
4654
end
4755
end
4856
end

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ module Actions
2323
# Returns data streams.
2424
#
2525
# @option arguments [List] :name A comma-separated list of data streams to get; use `*` to get all data streams
26+
# @option arguments [String] :expand_wildcards Whether wildcard expressions should get expanded to open or closed indices (default: open) (options: open, closed, hidden, none, all)
2627
# @option arguments [Hash] :headers Custom HTTP headers
2728
#
2829
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.x/data-streams.html
@@ -40,11 +41,18 @@ def get_data_stream(arguments = {})
4041
else
4142
"_data_stream"
4243
end
43-
params = {}
44+
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
4445

4546
body = nil
4647
perform_request(method, path, params, body, headers).body
4748
end
49+
50+
# Register this action with its valid params when the module is loaded.
51+
#
52+
# @since 6.2.0
53+
ParamsRegistry.register(:get_data_stream, [
54+
:expand_wildcards
55+
].freeze)
4856
end
4957
end
5058
end

0 commit comments

Comments
 (0)