Skip to content

API generation and updates #2612

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
Apr 1, 2025
Merged
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
@@ -96,7 +96,7 @@ module Actions
# @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.
# It supports comma-separated values, such as +open,hidden+. Server default: open.
# @option arguments [Integer] :from Starting offset (default: 0)
# @option arguments [Integer] :from Skips the specified number of documents. Server default: 0.
# @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index.
# @option arguments [Boolean] :lenient If +true+, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.
# This parameter can be used only when the +q+ query string parameter is specified.
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@ module Actions
# Asynchronously run an ES|QL (Elasticsearch query language) query, monitor its progress, and retrieve results when they become available.
# The API accepts the same parameters and request body as the synchronous query API, along with additional async related properties.
#
# @option arguments [Boolean] :allow_partial_results If +true+, partial results will be returned if there are shard failures, but the query can continue to execute on other clusters and shards.
# @option arguments [String] :delimiter The character to use between values within a CSV row.
# It is valid only for the CSV format.
# @option arguments [Boolean] :drop_null_columns Indicates whether columns that are entirely +null+ will be removed from the +columns+ and +values+ portion of the results.
Original file line number Diff line number Diff line change
@@ -32,6 +32,7 @@ module Actions
# @option arguments [String] :delimiter The character to use between values within a CSV row. Only valid for the CSV format.
# @option arguments [Boolean] :drop_null_columns Should columns that are entirely +null+ be removed from the +columns+ and +values+ portion of the results?
# Defaults to +false+. If +true+ then the response will include an extra section under the name +all_columns+ which has the name of all columns.
# @option arguments [Boolean] :allow_partial_results If +true+, partial results will be returned if there are shard failures, but the query can continue to execute on other clusters and shards.
# @option arguments [Hash] :headers Custom HTTP headers
# @option arguments [Hash] :body request body
#
Original file line number Diff line number Diff line change
@@ -63,7 +63,7 @@ def analyze(arguments = {})
else
'_analyze'
end
params = {}
params = Utils.process_params(arguments)

Elasticsearch::API::Response.new(
perform_request(method, path, params, body, headers, request_opts)
Original file line number Diff line number Diff line change
@@ -26,6 +26,8 @@ module Actions
# Check whether index templates exist.
#
# @option arguments [String] :name Comma-separated list of index template names used to limit the request. Wildcard (*) expressions are supported. (*Required*)
# @option arguments [Boolean] :local If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node.
# @option arguments [Boolean] :flat_settings If true, returns settings in flat format.
# @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 [Hash] :headers Custom HTTP headers
#
Original file line number Diff line number Diff line change
@@ -42,8 +42,6 @@ module Actions
# Supports comma-separated values, such as +open,hidden+.
# @option arguments [Boolean] :ignore_unavailable If +true+, missing or closed indices are not included in the response.
# @option arguments [String, Array<String>] :fields Comma-separated list or wildcard expressions of fields to include in the statistics.
# @option arguments [Integer, String] :wait_for_active_shards The number of shard copies that must be active before proceeding with the operation.
# Set to all or any positive integer up to the total number of shards in the index (+number_of_replicas+1+). Server default: 1.
# @option arguments [Hash] :headers Custom HTTP headers
#
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-field-usage-stats
Original file line number Diff line number Diff line change
@@ -55,6 +55,9 @@ module Actions
# received before the timeout expires, the request fails and returns an
# error. Server default: 30s.
# @option arguments [Boolean] :preserve_existing If +true+, existing index settings remain unchanged.
# @option arguments [Boolean] :reopen Whether to close and reopen the index to apply non-dynamic settings.
# If set to +true+ the indices to which the settings are being applied
# will be closed temporarily and then reopened in order to apply the changes.
# @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 [Hash] :headers Custom HTTP headers
Original file line number Diff line number Diff line change
@@ -45,7 +45,7 @@ module Actions
# @option arguments [Integer] :order Order in which Elasticsearch applies this template if index
# matches multiple templates.Templates with lower 'order' values are merged first. Templates with higher
# 'order' values are merged later, overriding templates with lower values.
# @option arguments [String] :cause [TODO]
# @option arguments [String] :cause User defined reason for creating/updating the index template
# @option arguments [Hash] :headers Custom HTTP headers
# @option arguments [Hash] :body request body
#
Original file line number Diff line number Diff line change
@@ -38,6 +38,7 @@ module Actions
# @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes +_all+ string or when no indices have been specified)
# @option arguments [String, Array<String>] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both.
# @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed)
# @option arguments [String] :resource Changed resource to reload analyzers from if applicable
# @option arguments [Hash] :headers Custom HTTP headers
#
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-reload-search-analyzers
Original file line number Diff line number Diff line change
@@ -60,6 +60,8 @@ module Actions
# If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
# @option arguments [Integer, String] :wait_for_active_shards The number of shard copies that must be active before proceeding with the operation.
# Set to all or any positive integer up to the total number of shards in the index (+number_of_replicas+1+). Server default: 1.
# @option arguments [Boolean] :lazy If set to true, the rollover action will only mark a data stream to signal that it needs to be rolled over at the next write.
# Only allowed on data streams.
# @option arguments [Hash] :headers Custom HTTP headers
# @option arguments [Hash] :body request body
#
Original file line number Diff line number Diff line change
@@ -26,6 +26,8 @@ module Actions
# Get the index configuration that would be applied to the specified index from an existing index template.
#
# @option arguments [String] :name Name of the index to simulate (*Required*)
# @option arguments [Boolean] :create Whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an existing one
# @option arguments [String] :cause User defined reason for dry-run creating the new template for simulation purposes Server default: false.
# @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] :include_defaults If true, returns all relevant default configurations for the index template.
# @option arguments [Hash] :headers Custom HTTP headers
Original file line number Diff line number Diff line change
@@ -28,6 +28,7 @@ module Actions
# @option arguments [String] :name Name of the index template to simulate. To test a template configuration before you add it to the cluster, omit
# this parameter and specify the template configuration in the request body.
# @option arguments [Boolean] :create If true, the template passed in the body is only used if no existing templates match the same index patterns. If false, the simulation uses the template with the highest priority. Note that the template is not permanently added or updated in either case; it is only used for the simulation.
# @option arguments [String] :cause User defined reason for dry-run creating the new template for simulation purposes
# @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] :include_defaults If true, returns all relevant default configurations for the index template.
# @option arguments [Hash] :headers Custom HTTP headers
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ module Actions
# @option arguments [String] :inference_id The inference Id (*Required*)
# @option arguments [Time] :timeout Specifies the amount of time to wait for the inference request to complete. Server default: 30s.
# @option arguments [Hash] :headers Custom HTTP headers
# @option arguments [Hash] :body request body
# @option arguments [Hash] :body chat_completion_request
#
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-unified-inference
#
@@ -39,6 +39,7 @@ def chat_completion_unified(arguments = {})
end
request_opts[:defined_params] = defined_params unless defined_params.empty?

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

arguments = arguments.clone
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# 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.
#
# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80
# @see https://github.com/elastic/elasticsearch-specification
#
module Elasticsearch
module API
module Inference
module Actions
# Perform a chat completion task through the Elastic Inference Service (EIS).
# Perform a chat completion inference task with the +elastic+ service.
#
# @option arguments [String] :eis_inference_id The unique identifier of the inference endpoint. (*Required*)
# @option arguments [Hash] :headers Custom HTTP headers
# @option arguments [Hash] :body chat_completion_request
#
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-post-eis-chat-completion
#
def post_eis_chat_completion(arguments = {})
request_opts = { endpoint: arguments[:endpoint] || 'inference.post_eis_chat_completion' }

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

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

body = arguments.delete(:body)

_eis_inference_id = arguments.delete(:eis_inference_id)

method = Elasticsearch::API::HTTP_POST
path = "_inference/chat_completion/#{Utils.listify(_eis_inference_id)}/_stream"
params = {}

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,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.
#
# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80
# @see https://github.com/elastic/elasticsearch-specification
#
module Elasticsearch
module API
module Inference
module Actions
# Create an AlibabaCloud AI Search inference endpoint.
# Create an inference endpoint to perform an inference task with the +alibabacloud-ai-search+ service.
# When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running.
# After creating the endpoint, wait for the model deployment to complete before using it.
# To verify the deployment status, use the get trained model statistics API.
# Look for +"state": "fully_allocated"+ in the response and ensure that the +"allocation_count"+ matches the +"target_allocation_count"+.
# Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources.
#
# @option arguments [String] :task_type The type of the inference task that the model will perform. (*Required*)
# @option arguments [String] :alibabacloud_inference_id The unique identifier of the inference endpoint. (*Required*)
# @option arguments [Hash] :headers Custom HTTP headers
# @option arguments [Hash] :body request body
#
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-alibabacloud
#
def put_alibabacloud(arguments = {})
request_opts = { endpoint: arguments[:endpoint] || 'inference.put_alibabacloud' }

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

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

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

body = arguments.delete(:body)

_task_type = arguments.delete(:task_type)

_alibabacloud_inference_id = arguments.delete(:alibabacloud_inference_id)

method = Elasticsearch::API::HTTP_PUT
path = "_inference/#{Utils.listify(_task_type)}/#{Utils.listify(_alibabacloud_inference_id)}"
params = {}

Elasticsearch::API::Response.new(
perform_request(method, path, params, body, headers, request_opts)
)
end
end
end
end
end
Loading