Skip to content

API update #2691

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 2 commits into from
May 30, 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
Expand Up @@ -23,6 +23,7 @@ module API
module Indices
module Actions
# Delete a legacy index template.
# IMPORTANT: This documentation is about legacy index templates, which are deprecated and will be replaced by the composable templates introduced in Elasticsearch 7.8.
#
# @option arguments [String] :name The name of the legacy index template to delete.
# Wildcard (`*`) expressions are supported. (*Required*)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module Elasticsearch
module API
module Indices
module Actions
# Get index templates.
# Get legacy index templates.
# Get information about one or more index templates.
# IMPORTANT: This documentation is about legacy index templates, which are deprecated and will be replaced by the composable templates introduced in Elasticsearch 7.8.
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module Elasticsearch
module API
module Indices
module Actions
# Create or update an index template.
# Create or update a legacy index template.
# Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
# Elasticsearch applies templates to new indices based on an index pattern that matches the index name.
# IMPORTANT: This documentation is about legacy index templates, which are deprecated and will be replaced by the composable templates introduced in Elasticsearch 7.8.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,27 @@ module API
module Snapshot
module Actions
# Analyze a snapshot repository.
# Analyze the performance characteristics and any incorrect behaviour found in a repository.
# The response exposes implementation details of the analysis which may change from version to version.
# The response body format is therefore not considered stable and may be different in newer versions.
# Performs operations on a snapshot repository in order to check for incorrect behaviour.
# There are a large number of third-party storage systems available, not all of which are suitable for use as a snapshot repository by Elasticsearch.
# Some storage systems behave incorrectly, or perform poorly, especially when accessed concurrently by multiple clients as the nodes of an Elasticsearch cluster do. This API performs a collection of read and write operations on your repository which are designed to detect incorrect behaviour and to measure the performance characteristics of your storage system.
# Some storage systems behave incorrectly, or perform poorly, especially when accessed concurrently by multiple clients as the nodes of an Elasticsearch cluster do.
# This API performs a collection of read and write operations on your repository which are designed to detect incorrect behaviour and to measure the performance characteristics of your storage system.
# The default values for the parameters are deliberately low to reduce the impact of running an analysis inadvertently and to provide a sensible starting point for your investigations.
# Run your first analysis with the default parameter values to check for simple problems.
# If successful, run a sequence of increasingly large analyses until you encounter a failure or you reach a `blob_count` of at least `2000`, a `max_blob_size` of at least `2gb`, a `max_total_data_size` of at least `1tb`, and a `register_operation_count` of at least `100`.
# Some repositories may behave correctly when lightly loaded but incorrectly under production-like workloads.
# If the first analysis is successful, run a sequence of increasingly large analyses until you encounter a failure or you reach a `blob_count` of at least `2000`, a `max_blob_size` of at least `2gb`, a `max_total_data_size` of at least `1tb`, and a `register_operation_count` of at least `100`.
# Always specify a generous timeout, possibly `1h` or longer, to allow time for each analysis to run to completion.
# Some repositories may behave correctly when accessed by a small number of Elasticsearch nodes but incorrectly when accessed concurrently by a production-scale cluster.
# Perform the analyses using a multi-node cluster of a similar size to your production cluster so that it can detect any problems that only arise when the repository is accessed by many nodes at once.
# If the analysis fails, Elasticsearch detected that your repository behaved unexpectedly.
# This usually means you are using a third-party storage system with an incorrect or incompatible implementation of the API it claims to support.
# If so, this storage system is not suitable for use as a snapshot repository.
# Repository analysis triggers conditions that occur only rarely when taking snapshots in a production system.
# Snapshotting to unsuitable storage may appear to work correctly most of the time despite repository analysis failures.
# However your snapshot data is at risk if you store it in a snapshot repository that does not reliably pass repository analysis.
# You can demonstrate that the analysis failure is due to an incompatible storage implementation by verifying that Elasticsearch does not detect the same problem when analysing the reference implementation of the storage protocol you are using.
# For instance, if you are using storage that offers an API which the supplier claims to be compatible with AWS S3, verify that repositories in AWS S3 do not fail repository analysis.
# This allows you to demonstrate to your storage supplier that a repository analysis failure must only be caused by an incompatibility with AWS S3 and cannot be attributed to a problem in Elasticsearch.
# Please do not report Elasticsearch issues involving third-party storage systems unless you can demonstrate that the same issue exists when analysing a repository that uses the reference implementation of the same storage protocol.
# You will need to work with the supplier of your storage system to address the incompatibilities that Elasticsearch detects.
# If the analysis is successful, the API returns details of the testing process, optionally including how long each operation took.
# You can use this information to determine the performance of your storage system.
Expand All @@ -61,14 +69,17 @@ module Actions
# This consumes bandwidth on the network between the cluster and the repository, and storage space and I/O bandwidth on the repository itself.
# You must ensure this load does not affect other users of these systems.
# Analyses respect the repository settings `max_snapshot_bytes_per_sec` and `max_restore_bytes_per_sec` if available and the cluster setting `indices.recovery.max_bytes_per_sec` which you can use to limit the bandwidth they consume.
# NOTE: This API is intended for exploratory use by humans. You should expect the request parameters and the response format to vary in future versions.
# NOTE: This API is intended for exploratory use by humans.
# You should expect the request parameters and the response format to vary in future versions.
# The response exposes immplementation details of the analysis which may change from version to version.
# NOTE: Different versions of Elasticsearch may perform different checks for repository compatibility, with newer versions typically being stricter than older ones.
# A storage system that passes repository analysis with one version of Elasticsearch may fail with a different version.
# This indicates it behaves incorrectly in ways that the former version did not detect.
# You must work with the supplier of your storage system to address the incompatibilities detected by the repository analysis API in any version of Elasticsearch.
# NOTE: This API may not work correctly in a mixed-version cluster.
# *Implementation details*
# NOTE: This section of documentation describes how the repository analysis API works in this version of Elasticsearch, but you should expect the implementation to vary between versions. The request parameters and response format depend on details of the implementation so may also be different in newer versions.
# NOTE: This section of documentation describes how the repository analysis API works in this version of Elasticsearch, but you should expect the implementation to vary between versions.
# The request parameters and response format depend on details of the implementation so may also be different in newer versions.
# The analysis comprises a number of blob-level tasks, as set by the `blob_count` parameter and a number of compare-and-exchange operations on linearizable registers, as set by the `register_operation_count` parameter.
# These tasks are distributed over the data and master-eligible nodes in the cluster for execution.
# For most blob-level tasks, the executing node first writes a blob to the repository and then instructs some of the other nodes in the cluster to attempt to read the data it just wrote.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# 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 Snapshot
module Actions
# Verify the repository integrity.
# Verify the integrity of the contents of a snapshot repository.
# This API enables you to perform a comprehensive check of the contents of a repository, looking for any anomalies in its data or metadata which might prevent you from restoring snapshots from the repository or which might cause future snapshot create or delete operations to fail.
# If you suspect the integrity of the contents of one of your snapshot repositories, cease all write activity to this repository immediately, set its `read_only` option to `true`, and use this API to verify its integrity.
# Until you do so:
# * It may not be possible to restore some snapshots from this repository.
# * Searchable snapshots may report errors when searched or may have unassigned shards.
# * Taking snapshots into this repository may fail or may appear to succeed but have created a snapshot which cannot be restored.
# * Deleting snapshots from this repository may fail or may appear to succeed but leave the underlying data on disk.
# * Continuing to write to the repository while it is in an invalid state may causing additional damage to its contents.
# If the API finds any problems with the integrity of the contents of your repository, Elasticsearch will not be able to repair the damage.
# The only way to bring the repository back into a fully working state after its contents have been damaged is by restoring its contents from a repository backup which was taken before the damage occurred.
# You must also identify what caused the damage and take action to prevent it from happening again.
# If you cannot restore a repository backup, register a new repository and use this for all future snapshot operations.
# In some cases it may be possible to recover some of the contents of a damaged repository, either by restoring as many of its snapshots as needed and taking new snapshots of the restored data, or by using the reindex API to copy data from any searchable snapshots mounted from the damaged repository.
# Avoid all operations which write to the repository while the verify repository integrity API is running.
# If something changes the repository contents while an integrity verification is running then Elasticsearch may incorrectly report having detected some anomalies in its contents due to the concurrent writes.
# It may also incorrectly fail to report some anomalies that the concurrent writes prevented it from detecting.
# NOTE: This API is intended for exploratory use by humans. You should expect the request parameters and the response format to vary in future versions.
# NOTE: This API may not work correctly in a mixed-version cluster.
# The default values for the parameters of this API are designed to limit the impact of the integrity verification on other activities in your cluster.
# For instance, by default it will only use at most half of the `snapshot_meta` threads to verify the integrity of each snapshot, allowing other snapshot operations to use the other half of this thread pool.
# If you modify these parameters to speed up the verification process, you risk disrupting other snapshot-related operations in your cluster.
# For large repositories, consider setting up a separate single-node Elasticsearch cluster just for running the integrity verification API.
# The response exposes implementation details of the analysis which may change from version to version.
# The response body format is therefore not considered stable and may be different in newer versions.
# This functionality is Experimental and may be changed or removed
# completely in a future release. Elastic will take a best effort approach
# to fix any issues, but experimental features are not subject to the
# support SLA of official GA features.
#
# @option arguments [String, Array<String>] :repository The name of the snapshot repository. (*Required*)
# @option arguments [Integer] :blob_thread_pool_concurrency If `verify_blob_contents` is `true`, this parameter specifies how many blobs to verify at once. Server default: 1.
# @option arguments [Integer] :index_snapshot_verification_concurrency The maximum number of index snapshots to verify concurrently within each index verification. Server default: 1.
# @option arguments [Integer] :index_verification_concurrency The number of indices to verify concurrently.
# The default behavior is to use the entire `snapshot_meta` thread pool. Server default: 0.
# @option arguments [String] :max_bytes_per_sec If `verify_blob_contents` is `true`, this parameter specifies the maximum amount of data that Elasticsearch will read from the repository every second. Server default: 10mb.
# @option arguments [Integer] :max_failed_shard_snapshots The number of shard snapshot failures to track during integrity verification, in order to avoid excessive resource usage.
# If your repository contains more than this number of shard snapshot failures, the verification will fail. Server default: 10000.
# @option arguments [Integer] :meta_thread_pool_concurrency The maximum number of snapshot metadata operations to run concurrently.
# The default behavior is to use at most half of the `snapshot_meta` thread pool at once. Server default: 0.
# @option arguments [Integer] :snapshot_verification_concurrency The number of snapshots to verify concurrently.
# The default behavior is to use at most half of the `snapshot_meta` thread pool at once. Server default: 0.
# @option arguments [Boolean] :verify_blob_contents Indicates whether to verify the checksum of every data blob in the repository.
# If this feature is enabled, Elasticsearch will read the entire repository contents, which may be extremely slow and expensive.
# @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/docs/api/doc/elasticsearch/operation/operation-snapshot-repository-verify-integrity
#
def repository_verify_integrity(arguments = {})
request_opts = { endpoint: arguments[:endpoint] || 'snapshot.repository_verify_integrity' }

defined_params = [:repository].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 'repository' missing" unless arguments[:repository]

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

body = nil

_repository = arguments.delete(:repository)

method = Elasticsearch::API::HTTP_POST
path = "_snapshot/#{Utils.listify(_repository)}/_verify_integrity"
params = Utils.process_params(arguments)

Elasticsearch::API::Response.new(
perform_request(method, path, params, body, headers, request_opts)
)
end
end
end
end
end
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 = '7a7e2a257032dcadda0f1aeec9344598a2e12913'.freeze
ES_SPECIFICATION_COMMIT = 'f15ccea832ee9dba2b1a31f6d7430940c2a53984'.freeze
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# 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.snapshot#repository_verify_integrity' do
let(:expected_args) do
[
'POST',
'_snapshot/foo/_verify_integrity',
{},
nil,
{},
{ defined_params: { repository: 'foo' },
endpoint: 'snapshot.repository_verify_integrity' }
]
end

it 'performs the request' do
expect(client_double.snapshot.repository_verify_integrity(repository: 'foo')).to be_a Elasticsearch::API::Response
end
end