Skip to content

Data stream options #2696

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# This code was automatically generated from the Elasticsearch Specification
# See https://github.com/elastic/elasticsearch-specification
# See Elasticsearch::ES_SPECIFICATION_COMMIT for commit hash.
module Elasticsearch
module API
module Indices
module Actions
# Delete data stream options.
# Removes the data stream options from a data stream.
#
# @option arguments [String, Array<String>] :name A comma-separated list of data streams of which the data stream options will be deleted; use `*` to get all data streams (*Required*)
# @option arguments [String, Array<String>] :expand_wildcards Whether wildcard expressions should get expanded to open or closed indices (default: open)
# @option arguments [Time] :master_timeout Specify timeout for connection to master
# @option arguments [Time] :timeout Explicit timestamp for the document
# @option arguments [Boolean] :error_trace When set to `true` Elasticsearch will include the full stack trace of errors
# when they occur.
# @option arguments [String] :filter_path Comma-separated list of filters in dot notation which reduce the response
# returned by Elasticsearch.
# @option arguments [Boolean] :human When set to `true` will return statistics in a format suitable for humans.
# For example `"exists_time": "1h"` for humans and
# `"eixsts_time_in_millis": 3600000` for computers. When disabled the human
# readable values will be omitted. This makes sense for responses being consumed
# only by machines.
# @option arguments [Boolean] :pretty If set to `true` the returned JSON will be "pretty-formatted". Only use
# this option for debugging only.
# @option arguments [Hash] :headers Custom HTTP headers
#
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html
#
def delete_data_stream_options(arguments = {})
request_opts = { endpoint: arguments[:endpoint] || 'indices.delete_data_stream_options' }

defined_params = [:name].each_with_object({}) do |variable, set_variables|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
end
request_opts[:defined_params] = defined_params unless defined_params.empty?

raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

arguments = arguments.clone
headers = arguments.delete(:headers) || {}

body = nil

_name = arguments.delete(:name)

method = Elasticsearch::API::HTTP_DELETE
path = "_data_stream/#{Utils.listify(_name)}/_options"
params = Utils.process_params(arguments)

Elasticsearch::API::Response.new(
perform_request(method, path, params, body, headers, request_opts)
)
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# This code was automatically generated from the Elasticsearch Specification
# See https://github.com/elastic/elasticsearch-specification
# See Elasticsearch::ES_SPECIFICATION_COMMIT for commit hash.
module Elasticsearch
module API
module Indices
module Actions
# Get data stream options.
# Get the data stream options configuration of one or more data streams.
#
# @option arguments [String, Array<String>] :name Comma-separated list of data streams to limit the request.
# Supports wildcards (`*`).
# To target all data streams, omit this parameter or use `*` or `_all`. (*Required*)
# @option arguments [String, Array<String>] :expand_wildcards Type of data stream that wildcard patterns can match.
# Supports comma-separated values, such as `open,hidden`.
# Valid values are: `all`, `open`, `closed`, `hidden`, `none`. Server default: open.
# @option arguments [Time] :master_timeout Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
# @option arguments [Boolean] :error_trace When set to `true` Elasticsearch will include the full stack trace of errors
# when they occur.
# @option arguments [String] :filter_path Comma-separated list of filters in dot notation which reduce the response
# returned by Elasticsearch.
# @option arguments [Boolean] :human When set to `true` will return statistics in a format suitable for humans.
# For example `"exists_time": "1h"` for humans and
# `"eixsts_time_in_millis": 3600000` for computers. When disabled the human
# readable values will be omitted. This makes sense for responses being consumed
# only by machines.
# @option arguments [Boolean] :pretty If set to `true` the returned JSON will be "pretty-formatted". Only use
# this option for debugging only.
# @option arguments [Hash] :headers Custom HTTP headers
#
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html
#
def get_data_stream_options(arguments = {})
request_opts = { endpoint: arguments[:endpoint] || 'indices.get_data_stream_options' }

defined_params = [:name].each_with_object({}) do |variable, set_variables|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
end
request_opts[:defined_params] = defined_params unless defined_params.empty?

raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

arguments = arguments.clone
headers = arguments.delete(:headers) || {}

body = nil

_name = arguments.delete(:name)

method = Elasticsearch::API::HTTP_GET
path = "_data_stream/#{Utils.listify(_name)}/_options"
params = Utils.process_params(arguments)

Elasticsearch::API::Response.new(
perform_request(method, path, params, body, headers, request_opts)
)
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# This code was automatically generated from the Elasticsearch Specification
# See https://github.com/elastic/elasticsearch-specification
# See Elasticsearch::ES_SPECIFICATION_COMMIT for commit hash.
module Elasticsearch
module API
module Indices
module Actions
# Update data stream options.
# Update the data stream options of the specified data streams.
#
# @option arguments [String, Array<String>] :name Comma-separated list of data streams used to limit the request.
# Supports wildcards (`*`).
# To target all data streams use `*` or `_all`. (*Required*)
# @option arguments [String, Array<String>] :expand_wildcards Type of data stream that wildcard patterns can match.
# Supports comma-separated values, such as `open,hidden`.
# Valid values are: `all`, `hidden`, `open`, `closed`, `none`. Server default: open.
# @option arguments [Time] :master_timeout Period to wait for a connection to the master node. If no response is
# received before the timeout expires, the request fails and returns an
# error. Server default: 30s.
# @option arguments [Time] :timeout Period to wait for a response.
# If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
# @option arguments [Boolean] :error_trace When set to `true` Elasticsearch will include the full stack trace of errors
# when they occur.
# @option arguments [String] :filter_path Comma-separated list of filters in dot notation which reduce the response
# returned by Elasticsearch.
# @option arguments [Boolean] :human When set to `true` will return statistics in a format suitable for humans.
# For example `"exists_time": "1h"` for humans and
# `"eixsts_time_in_millis": 3600000` for computers. When disabled the human
# readable values will be omitted. This makes sense for responses being consumed
# only by machines.
# @option arguments [Boolean] :pretty If set to `true` the returned JSON will be "pretty-formatted". Only use
# this option for debugging only.
# @option arguments [Hash] :headers Custom HTTP headers
# @option arguments [Hash] :body request body
#
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html
#
def put_data_stream_options(arguments = {})
request_opts = { endpoint: arguments[:endpoint] || 'indices.put_data_stream_options' }

defined_params = [:name].each_with_object({}) do |variable, set_variables|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
end
request_opts[:defined_params] = defined_params unless defined_params.empty?

raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

arguments = arguments.clone
headers = arguments.delete(:headers) || {}

body = arguments.delete(:body)

_name = arguments.delete(:name)

method = Elasticsearch::API::HTTP_PUT
path = "_data_stream/#{Utils.listify(_name)}/_options"
params = Utils.process_params(arguments)

Elasticsearch::API::Response.new(
perform_request(method, path, params, body, headers, request_opts)
)
end
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,46 @@ module Actions
# Changes dynamic index settings in real time.
# For data streams, index setting changes are applied to all backing indices by default.
# To revert a setting to the default value, use a null value.
# The list of per-index settings that can be updated dynamically on live indices can be found in index module documentation.
# The list of per-index settings that can be updated dynamically on live indices can be found in index settings documentation.
# To preserve existing settings from being updated, set the `preserve_existing` parameter to `true`.
# There are multiple valid ways to represent index settings in the request body. You can specify only the setting, for example:
#
# ```
# {
# "number_of_replicas": 1
# }
# ```
#
# Or you can use an `index` setting object:
#
# ```
# {
# "index": {
# "number_of_replicas": 1
# }
# }
# ```
#
# Or you can use dot annotation:
#
# ```
# {
# "index.number_of_replicas": 1
# }
# ```
#
# Or you can embed any of the aforementioned options in a `settings` object. For example:
#
# ```
# {
# "settings": {
# "index": {
# "number_of_replicas": 1
# }
# }
# }
# ```
#
# NOTE: You can only define new analyzers on closed indices.
# To add an analyzer, you must close the index, define the analyzer, and reopen the index.
# You cannot close the write index of a data stream.
Expand Down
2 changes: 1 addition & 1 deletion elasticsearch-api/lib/elasticsearch/api/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
module Elasticsearch
module API
VERSION = '9.0.0'.freeze
ES_SPECIFICATION_COMMIT = 'f15ccea832ee9dba2b1a31f6d7430940c2a53984'.freeze
ES_SPECIFICATION_COMMIT = '00be10ac5ace4211ff41c0c640eb9b6ecaf10f07'.freeze
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

require 'spec_helper'

describe 'client.indices.delete_data_stream_options' do
let(:expected_args) do
[
'DELETE',
'_data_stream/foo/_options',
{},
nil,
{},
{ endpoint: 'indices.delete_data_stream_options', defined_params: { name: 'foo' } }
]
end

let(:index) { 'foo' }

it 'performs the request' do
expect(client_double.indices.delete_data_stream_options(name: 'foo')).to be_a Elasticsearch::API::Response
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

require 'spec_helper'

describe 'client.indices.get_data_stream_options' do
let(:expected_args) do
[
'GET',
'_data_stream/foo/_options',
{},
nil,
{},
{ endpoint: 'indices.get_data_stream_options', defined_params: { name: 'foo' } }
]
end

let(:index) { 'foo' }

it 'performs the request' do
expect(client_double.indices.get_data_stream_options(name: 'foo')).to be_a Elasticsearch::API::Response
end
end
Loading