Skip to content

Data stream mappings #2719

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
Jul 9, 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
6 changes: 3 additions & 3 deletions elasticsearch-api/lib/elasticsearch/api/actions/cat/shards.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ module Actions
# To target all data streams and indices, omit this parameter or use `*` or `_all`.
# @option arguments [String] :bytes The unit used to display byte values.
# @option arguments [String, Array<String>] :h List of columns to appear in the response. Supports simple wildcards.
# @option arguments [String, Array<String>] :s List of columns that determine how the table should be sorted.
# @option arguments [String, Array<String>] :s A comma-separated list of column names or aliases that determines the sort order.
# Sorting defaults to ascending and can be changed by setting `:asc`
# or `:desc` as a suffix to the column name.
# @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s.
# @option arguments [String] :time Unit used to display time values.
# @option arguments [Time] :master_timeout The period to wait for a connection to the master node. Server default: 30s.
# @option arguments [String] :time The unit used to display time values.
# @option arguments [String] :format Specifies the format to return the columnar data in, can be set to
# `text`, `json`, `cbor`, `yaml`, or `smile`. Server default: text.
# @option arguments [Boolean] :help When set to `true` will output available columns. This option
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ module Actions
# @option arguments [String, Array<String>] :thread_pool_patterns A comma-separated list of thread pool names used to limit the request.
# Accepts wildcard expressions.
# @option arguments [String, Array<String>] :h List of columns to appear in the response. Supports simple wildcards.
# @option arguments [String, Array<String>] :s List of columns that determine how the table should be sorted.
# @option arguments [String, Array<String>] :s A comma-separated list of column names or aliases that determines the sort order.
# Sorting defaults to ascending and can be changed by setting `:asc`
# or `:desc` as a suffix to the column name.
# @option arguments [String] :time The unit used to display time values.
# @option arguments [Boolean] :local If `true`, the request computes the list of selected nodes from the
# local cluster state. If `false` the list of selected nodes are computed
# from the cluster state of the master node. In both cases the coordinating
# node will send requests for further information to each selected node.
# @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s.
# @option arguments [Time] :master_timeout The period to wait for a connection to the master node. Server default: 30s.
# @option arguments [String] :format Specifies the format to return the columnar data in, can be set to
# `text`, `json`, `cbor`, `yaml`, or `smile`. Server default: text.
# @option arguments [Boolean] :help When set to `true` will output available columns. This option
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ module Actions
# @option arguments [String] :name Comma-separated list of component template names used to limit the request.
# Wildcard (`*`) expressions are supported.
# @option arguments [Boolean] :flat_settings If `true`, returns settings in flat format.
# @option arguments [String, Array<String>] :settings_filter Filter out results, for example to filter out sensitive information. Supports wildcards or full settings keys
# @option arguments [Boolean] :include_defaults Return all default configurations for the component template (default: false)
# @option arguments [Boolean] :local If `true`, the request retrieves information from the local node only.
# If `false`, information is retrieved from the master node.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ module Actions
# If you use Elastic Agent and want to overwrite one of these templates, set the `version` for your replacement template higher than the current version.
# If you don’t use Elastic Agent and want to disable all built-in component and index templates, set `stack.templates.enabled` to `false` using the cluster update settings API. (*Required*)
# @option arguments [Boolean] :create If `true`, this request cannot replace or update existing component templates.
# @option arguments [String] :cause User defined reason for create the component template. Server default: api.
# @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
Expand Down
1 change: 1 addition & 0 deletions elasticsearch-api/lib/elasticsearch/api/actions/get.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ module Actions
# @option arguments [String, Array<String>] :_source_excludes A comma-separated list of source fields to exclude from the response.
# You can also use this parameter to exclude fields from the subset specified in `_source_includes` query parameter.
# If the `_source` parameter is `false`, this parameter is ignored.
# @option arguments [Boolean] :_source_exclude_vectors Whether vectors should be excluded from _source
# @option arguments [String, Array<String>] :_source_includes A comma-separated list of source fields to include in the response.
# If this parameter is specified, only these source fields are returned.
# You can exclude fields from this subset using the `_source_excludes` query parameter.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ module Actions
# @option arguments [Boolean, String, Array<String>] :_source Indicates whether to return the `_source` field (`true` or `false`) or lists the fields to return.
# @option arguments [String, Array<String>] :_source_excludes A comma-separated list of source fields to exclude in the response.
# @option arguments [String, Array<String>] :_source_includes A comma-separated list of source fields to include in the response.
# @option arguments [String, Array<String>] :stored_fields A comma-separated list of stored fields to return as part of a hit.
# @option arguments [Integer] :version The version number for concurrency control.
# It must match the current version of the document for the request to succeed.
# @option arguments [String] :version_type The version type.
Expand Down
1 change: 1 addition & 0 deletions elasticsearch-api/lib/elasticsearch/api/actions/index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ module Actions
# You can set it to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`).
# The default value of `1` means it waits for each primary shard to be active. Server default: 1.
# @option arguments [Boolean] :require_alias If `true`, the destination must be an index alias.
# @option arguments [Boolean] :require_data_stream If `true`, the request's actions must target a data stream (existing or to be created).
# @option arguments [Boolean] :error_trace When set to `true` Elasticsearch will include the full stack trace of errors
# when they occur.
# @option arguments [String, Array<String>] :filter_path Comma-separated list of filters in dot notation which reduce the response
Expand Down
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
# Get data stream mappings.
# Get mapping information for one or more data streams.
#
# @option arguments [String, Array] :name A comma-separated list of data streams or data stream patterns. Supports wildcards (`*`). (*Required*)
# @option arguments [Time] :master_timeout The 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, Array<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
# `"exists_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/docs/api/doc/elasticsearch/operation/operation-indices-get-data-stream-mappings
#
def get_data_stream_mappings(arguments = {})
request_opts = { endpoint: arguments[:endpoint] || 'indices.get_data_stream_mappings' }

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)}/_mappings"
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,84 @@
# 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 mappings.
# This API can be used to override mappings on specific data streams. These overrides will take precedence over what
# is specified in the template that the data stream matches. The mapping change is only applied to new write indices
# that are created during rollover after this API is called. No indices are changed by this API.
#
# @option arguments [String, Array] :name A comma-separated list of data streams or data stream patterns. (*Required*)
# @option arguments [Boolean] :dry_run If `true`, the request does not actually change the mappings on any data streams. Instead, it
# simulates changing the settings and reports back to the user what would have happened had these settings
# actually been applied.
# @option arguments [Time] :master_timeout The 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 The 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, Array<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
# `"exists_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 mappings
#
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-data-stream-mappings
#
def put_data_stream_mappings(arguments = {})
request_opts = { endpoint: arguments[:endpoint] || 'indices.put_data_stream_mappings' }

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 'body' missing" unless arguments[:body]
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)}/_mappings"
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 @@ -22,7 +22,7 @@ module Elasticsearch
module API
module Inference
module Actions
# Perform rereanking inference on the service
# Perform reranking inference on the service
#
# @option arguments [String] :inference_id The unique identifier for the inference endpoint. (*Required*)
# @option arguments [Time] :timeout The amount of time to wait for the inference request to complete. Server default: 30s.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ module Actions
# @option arguments [String, Array] :id Comma-separated list of database configuration IDs to retrieve.
# Wildcard (`*`) expressions are supported.
# To get all database configurations, omit this parameter or use `*`.
# @option arguments [Time] :master_timeout The 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.
# A value of `-1` indicates that the request should never time out. 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, Array<String>] :filter_path Comma-separated list of filters in dot notation which reduce the response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module Actions
# To check the status of your trial, use the get trial status API.
#
# @option arguments [Boolean] :acknowledge whether the user has acknowledged acknowledge messages (default: false)
# @option arguments [String] :type_query_string [TODO]
# @option arguments [String] :type The type of trial license to generate (default: "trial")
# @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s.
# @option arguments [Boolean] :error_trace When set to `true` Elasticsearch will include the full stack trace of errors
# when they occur.
Expand Down
1 change: 1 addition & 0 deletions elasticsearch-api/lib/elasticsearch/api/actions/search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ module Actions
# @option arguments [String, Array<String>] :_source_excludes A comma-separated list of source fields to exclude from the response.
# You can also use this parameter to exclude fields from the subset specified in `_source_includes` query parameter.
# If the `_source` parameter is `false`, this parameter is ignored.
# @option arguments [Boolean] :_source_exclude_vectors Whether vectors should be excluded from _source
# @option arguments [String, Array<String>] :_source_includes A comma-separated list of source fields to include in the response.
# If this parameter is specified, only these source fields are returned.
# You can exclude fields from this subset using the `_source_excludes` query parameter.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module Actions
# If you need to manage more synonym rules, you can create multiple synonym sets.
# When an existing synonyms set is updated, the search analyzers that use the synonyms set are reloaded automatically for all indices.
# This is equivalent to invoking the reload search analyzers API for all indices that use the synonyms set.
# For practical examples of how to create or update a synonyms set, refer to the External documentation.
#
# @option arguments [String] :id The ID of the synonyms set to be created or updated. (*Required*)
# @option arguments [Boolean] :refresh If `true`, the request will refresh the analyzers with the new synonyms set and wait for the new synonyms to be available before returning.
Expand Down
1 change: 1 addition & 0 deletions elasticsearch-api/lib/elasticsearch/api/actions/update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ module Actions
# The document must still be reindexed, but using this API removes some network roundtrips and reduces chances of version conflicts between the GET and the index operation.
# The `_source` field must be enabled to use this API.
# In addition to `_source`, you can access the following variables through the `ctx` map: `_index`, `_type`, `_id`, `_version`, `_routing`, and `_now` (the current timestamp).
# For usage examples such as partial updates, upserts, and scripted updates, see the External documentation.
#
# @option arguments [String] :id A unique identifier for the document to be updated. (*Required*)
# @option arguments [String] :index The name of the target index.
Expand Down
Loading