Skip to content
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 @@ -51,9 +51,10 @@ module Actions
# @option arguments [Boolean] :lenient Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
# @option arguments [Integer] :max_concurrent_shard_requests The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests
# @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random)
# @option arguments [String] :project_routing Specifies a subset of projects to target for a search using project metadata
# tags in a subset Lucene syntax. Allowed Lucene queries: the _alias tag
# and a single value (possible wildcarded). Examples:
# @option arguments [String] :project_routing Specifies a subset of projects to target for the search using project
# metadata tags in a subset of Lucene query syntax.
# Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded).
# Examples:
# _alias:my-project
# _alias:_origin
# _alias:*pr*
Expand Down
8 changes: 8 additions & 0 deletions elasticsearch-api/lib/elasticsearch/api/actions/cat/count.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ module Actions
# It supports wildcards (`*`).
# To target all data streams and indices, omit this parameter or use `*` or `_all`.
# @option arguments [String, Array<String>] :h A comma-separated list of columns names to display. It supports simple wildcards.
# @option arguments [String] :project_routing Specifies a subset of projects to target for the search using project
# metadata tags in a subset of Lucene query syntax.
# Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded).
# Examples:
# _alias:my-project
# _alias:_origin
# _alias:*pr*
# Supported in serverless only.
# @option arguments [String, Array<String>] :s List of columns that determine how the table should be sorted.
# Sorting defaults to ascending and can be changed by setting `:asc`
# or `:desc` as a suffix to the column name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module Actions
# Get information about the nodes in a cluster.
# IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API.
#
# @option arguments [Boolean, String] :full_id If `true`, return the full node ID. If `false`, return the shortened node ID. Server default: false.
# @option arguments [Boolean] :full_id If `true`, return the full node ID. If `false`, return the shortened node ID.
# @option arguments [Boolean] :include_unloaded_segments If true, the response includes information from segments that are not loaded into memory.
# @option arguments [String, Array<String>] :h A comma-separated list of columns names to display.
# It supports simple wildcards. Server default: ip,hp,rp,r,m,n,cpu,l.
Expand Down
8 changes: 8 additions & 0 deletions elasticsearch-api/lib/elasticsearch/api/actions/count.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ module Actions
# @option arguments [Float] :min_score The minimum `_score` value that documents must have to be included in the result.
# @option arguments [String] :preference The node or shard the operation should be performed on.
# By default, it is random.
# @option arguments [String] :project_routing Specifies a subset of projects to target for the search using project
# metadata tags in a subset of Lucene query syntax.
# Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded).
# Examples:
# _alias:my-project
# _alias:_origin
# _alias:*pr*
# Supported in serverless only.
# @option arguments [String] :routing A custom value used to route operations to a specific shard.
# @option arguments [Integer] :terminate_after The maximum number of documents to collect for each shard.
# If a query reaches this limit, Elasticsearch terminates the query early.
Expand Down
8 changes: 8 additions & 0 deletions elasticsearch-api/lib/elasticsearch/api/actions/eql/search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ module Actions
# @option arguments [Boolean] :ignore_unavailable If true, missing or closed indices are not included in the response. Server default: true.
# @option arguments [Time] :keep_alive Period for which the search and its results are stored on the cluster. Server default: 5d.
# @option arguments [Boolean] :keep_on_completion If true, the search and its results are stored on the cluster.
# @option arguments [String] :project_routing Specifies a subset of projects to target for the search using project
# metadata tags in a subset of Lucene query syntax.
# Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded).
# Examples:
# _alias:my-project
# _alias:_origin
# _alias:*pr*
# Supported in serverless only.
# @option arguments [Time] :wait_for_completion_timeout Timeout duration to wait for the request to finish. Defaults to no timeout, meaning the request waits for complete search results.
# @option arguments [Boolean] :error_trace When set to `true` Elasticsearch will include the full stack trace of errors
# when they occur.
Expand Down
8 changes: 8 additions & 0 deletions elasticsearch-api/lib/elasticsearch/api/actions/field_caps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ module Actions
# Any fields that do not match one of these types will be excluded from the results.
# It defaults to empty, meaning that all field types are returned.
# @option arguments [Boolean] :include_empty_fields If false, empty fields are not included in the response. Server default: true.
# @option arguments [String] :project_routing Specifies a subset of projects to target for the field-caps query using project
# metadata tags in a subset of Lucene query syntax.
# Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded).
# Examples:
# _alias:my-project
# _alias:_origin
# _alias:*pr*
# Supported in serverless only.
# @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 @@ -27,6 +27,7 @@ module Actions
# For data streams, the API runs the refresh operation on the stream’s backing indices.
# By default, Elasticsearch periodically refreshes indices every second, but only on indices that have received one search request or more in the last 30 seconds.
# You can change this default interval with the `index.refresh_interval` setting.
# In Elastic Cloud Serverless, the default refresh interval is 5 seconds across all indices.
# Refresh requests are synchronous and do not return a response until the refresh operation completes.
# Refreshes are resource-intensive.
# To ensure good cluster performance, it's recommended to wait for Elasticsearch's periodic refresh rather than performing an explicit refresh when possible.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ module Actions
# This behavior applies even if the request targets other open indices.
# For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. Server default: true.
# @option arguments [String, Array<String>] :mode Filter indices by index mode - standard, lookup, time_series, etc. Comma-separated list of IndexMode. Empty means no filter.
# @option arguments [String] :project_routing Specifies a subset of projects to target using project
# metadata tags in a subset of Lucene query syntax.
# Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded).
# Examples:
# _alias:my-project
# _alias:_origin
# _alias:*pr*
# Supported in serverless only.
# @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 @@ -59,7 +59,7 @@ module Actions
# the optional `bucket_span` parameter.
# @option arguments [String, Time] :end Returns overall buckets with timestamps earlier than this time.
# @option arguments [Boolean] :exclude_interim If `true`, the output excludes interim results.
# @option arguments [Float, String] :overall_score Returns overall buckets with overall scores greater than or equal to this
# @option arguments [Float] :overall_score Returns overall buckets with overall scores greater than or equal to this
# value.
# @option arguments [String, Time] :start Returns overall buckets with timestamps after this time.
# @option arguments [Integer] :top_n The number of top anomaly detection job bucket scores to be used in the
Expand Down
7 changes: 7 additions & 0 deletions elasticsearch-api/lib/elasticsearch/api/actions/msearch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ module Actions
# Defaults to `max(1, (# of data nodes * min(search thread pool size, 10)))`.
# @option arguments [Integer] :max_concurrent_shard_requests Maximum number of concurrent shard requests that each sub-search request executes per node. Server default: 5.
# @option arguments [Integer] :pre_filter_shard_size Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint.
# @option arguments [String] :project_routing Specifies a subset of projects to target for a search using project metadata
# tags in a subset Lucene syntax. Allowed Lucene queries: the _alias tag
# and a single value (possible wildcarded). Examples:
# _alias:my-project
# _alias:_origin
# _alias:*pr*
# Supported in serverless only.
# @option arguments [Boolean] :rest_total_hits_as_int If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object.
# @option arguments [String] :routing Custom routing value used to route search operations to a specific shard.
# @option arguments [String] :search_type Indicates whether global term and document frequencies should be used when scoring returned documents.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ module Actions
# To search all data streams and indices, omit this parameter or use `*`.
# @option arguments [Boolean] :ccs_minimize_roundtrips If `true`, network round-trips are minimized for cross-cluster search requests. Server default: true.
# @option arguments [Integer] :max_concurrent_searches The maximum number of concurrent searches the API can run.
# @option arguments [String] :project_routing Specifies a subset of projects to target for the search using project
# metadata tags in a subset of Lucene query syntax.
# Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded).
# Examples:
# _alias:my-project
# _alias:_origin
# _alias:*pr*
# Supported in serverless only.
# @option arguments [String] :search_type The type of the search operation.
# @option arguments [Boolean] :rest_total_hits_as_int If `true`, the response returns `hits.total` as an integer.
# If `false`, it returns `hits.total` as an object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ module Actions
# @option arguments [Boolean] :ignore_unavailable If `false`, the request returns an error if it targets a missing or closed index.
# @option arguments [String] :preference The node or shard the operation should be performed on.
# By default, it is random.
# @option arguments [String] :project_routing Specifies a subset of projects to target for the PIT request using project
# metadata tags in a subset of Lucene query syntax.
# Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded).
# Examples:
# _alias:my-project
# _alias:_origin
# _alias:*pr*
# Supported in serverless only.
# @option arguments [String] :routing A custom value that is used to route operations to a specific shard.
# @option arguments [String, Array<String>] :expand_wildcards The type of index that wildcard patterns can match.
# If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.
Expand Down
7 changes: 4 additions & 3 deletions elasticsearch-api/lib/elasticsearch/api/actions/search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,10 @@ module Actions
# - The request targets more than 128 shards.
# - The request targets one or more read-only index.
# - The primary sort of the query targets an indexed field.
# @option arguments [String] :project_routing Specifies a subset of projects to target for a search using project metadata
# tags in a subset Lucene syntax. Allowed Lucene queries: the _alias tag
# and a single value (possible wildcarded). Examples:
# @option arguments [String] :project_routing Specifies a subset of projects to target for the search using project
# metadata tags in a subset of Lucene query syntax.
# Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded).
# Examples:
# _alias:my-project
# _alias:_origin
# _alias:*pr*
Expand Down
8 changes: 8 additions & 0 deletions elasticsearch-api/lib/elasticsearch/api/actions/search_mvt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,14 @@ module Actions
# each feature represents a geotile_grid cell. If 'grid' each feature is a Polygon
# of the cells bounding box. If 'point' each feature is a Point that is the centroid
# of the cell. Server default: grid.
# @option arguments [String] :project_routing Specifies a subset of projects to target for the search using project
# metadata tags in a subset of Lucene query syntax.
# Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded).
# Examples:
# _alias:my-project
# _alias:_origin
# _alias:*pr*
# Supported in serverless only.
# @option arguments [Integer] :size Maximum number of features to return in the hits layer. Accepts 0-10000.
# If 0, results don't include the hits layer. Server default: 10000.
# @option arguments [Boolean, Integer] :track_total_hits The number of hits matching the query to count accurately.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ module Actions
# @option arguments [String] :preference The node or shard the operation should be performed on.
# It is random by default.
# @option arguments [Boolean] :profile If `true`, the query execution is profiled.
# @option arguments [String] :project_routing Specifies a subset of projects to target for the search using project
# metadata tags in a subset of Lucene query syntax.
# Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded).
# Examples:
# _alias:my-project
# _alias:_origin
# _alias:*pr*
# Supported in serverless only.
# @option arguments [String] :routing A custom value used to route operations to a specific shard.
# @option arguments [Time] :scroll Specifies how long a consistent view of the index
# should be maintained for scrolled search.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# 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 Security
module Actions
# Get security statistics for all nodes
#
# @option arguments [Hash] :headers Custom HTTP headers
#
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-stats
#
def get_stats(arguments = {})
request_opts = { endpoint: arguments[:endpoint] || 'security.get_stats' }

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

body = nil

method = Elasticsearch::API::HTTP_GET
path = '_security/stats'
params = {}

Elasticsearch::API::Response.new(
perform_request(method, path, params, body, headers, request_opts)
)
end
end
end
end
end
8 changes: 8 additions & 0 deletions elasticsearch-api/lib/elasticsearch/api/actions/sql/query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ module Actions
# @option arguments [String] :format The format for the response.
# You can also specify a format using the `Accept` HTTP header.
# If you specify both this parameter and the `Accept` HTTP header, this parameter takes precedence.
# @option arguments [String] :project_routing Specifies a subset of projects to target for the search using project
# metadata tags in a subset of Lucene query syntax.
# Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded).
# Examples:
# _alias:my-project
# _alias:_origin
# _alias:*pr*
# Supported in serverless only.
# @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
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.2.0'.freeze
ES_SPECIFICATION_COMMIT = '06148858372b097641efbe3b712259eee63b8e11'.freeze
ES_SPECIFICATION_COMMIT = '1aa68abf07e4d0f9cbc162eef64d0ae508e65366'.freeze
end
end
35 changes: 35 additions & 0 deletions elasticsearch-api/spec/unit/actions/security/get_stats_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 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#security#get_stats' do
let(:expected_args) do
[
'GET',
'_security/stats',
{},
nil,
{},
{ endpoint: 'security.get_stats' }
]
end

it 'performs the request' do
expect(client_double.security.get_stats).to be_a Elasticsearch::API::Response
end
end