elasticsearch-api 8.17.1 → 8.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/elasticsearch-api.gemspec +2 -1
- data/lib/elasticsearch/api/actions/async_search/submit.rb +1 -0
- data/lib/elasticsearch/api/actions/bulk.rb +1 -0
- data/lib/elasticsearch/api/actions/cat/help.rb +1 -3
- data/lib/elasticsearch/api/actions/cat/segments.rb +2 -0
- data/lib/elasticsearch/api/actions/cat/tasks.rb +2 -0
- data/lib/elasticsearch/api/actions/create.rb +1 -0
- data/lib/elasticsearch/api/actions/eql/search.rb +2 -0
- data/lib/elasticsearch/api/actions/esql/async_query_delete.rb +60 -0
- data/lib/elasticsearch/api/actions/esql/async_query_stop.rb +60 -0
- data/lib/elasticsearch/api/actions/index.rb +1 -0
- data/lib/elasticsearch/api/actions/indices/get_data_lifecycle_stats.rb +50 -0
- data/lib/elasticsearch/api/actions/indices/put_template.rb +1 -0
- data/lib/elasticsearch/api/actions/indices/resolve_cluster.rb +11 -8
- data/lib/elasticsearch/api/actions/indices/rollover.rb +0 -1
- data/lib/elasticsearch/api/actions/inference/chat_completion_unified.rb +61 -0
- data/lib/elasticsearch/api/actions/inference/completion.rb +61 -0
- data/lib/elasticsearch/api/actions/inference/delete.rb +0 -4
- data/lib/elasticsearch/api/actions/inference/get.rb +0 -4
- data/lib/elasticsearch/api/actions/inference/inference.rb +0 -4
- data/lib/elasticsearch/api/actions/inference/put.rb +0 -4
- data/lib/elasticsearch/api/actions/inference/put_alibabacloud.rb +69 -0
- data/lib/elasticsearch/api/actions/inference/put_amazonbedrock.rb +69 -0
- data/lib/elasticsearch/api/actions/inference/put_anthropic.rb +69 -0
- data/lib/elasticsearch/api/actions/inference/put_azureaistudio.rb +69 -0
- data/lib/elasticsearch/api/actions/inference/put_azureopenai.rb +69 -0
- data/lib/elasticsearch/api/actions/inference/put_cohere.rb +65 -0
- data/lib/elasticsearch/api/actions/inference/put_elasticsearch.rb +69 -0
- data/lib/elasticsearch/api/actions/inference/put_elser.rb +65 -0
- data/lib/elasticsearch/api/actions/inference/put_googleaistudio.rb +69 -0
- data/lib/elasticsearch/api/actions/inference/put_googlevertexai.rb +69 -0
- data/lib/elasticsearch/api/actions/inference/put_hugging_face.rb +69 -0
- data/lib/elasticsearch/api/actions/inference/put_jinaai.rb +65 -0
- data/lib/elasticsearch/api/actions/inference/put_mistral.rb +69 -0
- data/lib/elasticsearch/api/actions/inference/put_openai.rb +65 -0
- data/lib/elasticsearch/api/actions/inference/put_voyageai.rb +69 -0
- data/lib/elasticsearch/api/actions/inference/put_watsonx.rb +69 -0
- data/lib/elasticsearch/api/actions/inference/rerank.rb +61 -0
- data/lib/elasticsearch/api/actions/inference/sparse_embedding.rb +61 -0
- data/lib/elasticsearch/api/actions/inference/stream_completion.rb +61 -0
- data/lib/elasticsearch/api/actions/inference/text_embedding.rb +61 -0
- data/lib/elasticsearch/api/actions/inference/{stream_inference.rb → update.rb} +8 -12
- data/lib/elasticsearch/api/actions/license/post_start_trial.rb +0 -1
- data/lib/elasticsearch/api/actions/machine_learning/start_trained_model_deployment.rb +2 -1
- data/lib/elasticsearch/api/actions/security/delegate_pki.rb +53 -0
- data/lib/elasticsearch/api/actions/shutdown/delete_node.rb +3 -1
- data/lib/elasticsearch/api/actions/shutdown/put_node.rb +3 -1
- data/lib/elasticsearch/api/actions/snapshot_lifecycle_management/delete_lifecycle.rb +3 -1
- data/lib/elasticsearch/api/actions/snapshot_lifecycle_management/execute_lifecycle.rb +3 -1
- data/lib/elasticsearch/api/actions/snapshot_lifecycle_management/execute_retention.rb +3 -1
- data/lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_lifecycle.rb +3 -1
- data/lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_stats.rb +3 -1
- data/lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_status.rb +3 -1
- data/lib/elasticsearch/api/actions/snapshot_lifecycle_management/put_lifecycle.rb +3 -1
- data/lib/elasticsearch/api/actions/update.rb +1 -0
- data/lib/elasticsearch/api/actions/xpack/info.rb +1 -0
- data/lib/elasticsearch/api/version.rb +1 -1
- data/spec/elasticsearch/api/actions/esql/async_query_delete_spec.rb +35 -0
- data/spec/elasticsearch/api/actions/esql/async_query_stop_spec.rb +35 -0
- data/spec/elasticsearch/api/actions/indices/get_data_lifecycle_stats_spec.rb +35 -0
- data/spec/elasticsearch/api/actions/indices/resolve_cluster_spec.rb +14 -9
- data/spec/elasticsearch/api/actions/inference/chat_completion_unified_spec.rb +36 -0
- data/spec/elasticsearch/api/actions/inference/completion_spec.rb +36 -0
- data/spec/elasticsearch/api/actions/inference/put_alibabacloud_spec.rb +36 -0
- data/spec/elasticsearch/api/actions/inference/put_amazonbedrock_spec.rb +36 -0
- data/spec/elasticsearch/api/actions/inference/put_anthropic_spec.rb +36 -0
- data/spec/elasticsearch/api/actions/inference/put_azureaistudio_spec.rb +36 -0
- data/spec/elasticsearch/api/actions/inference/put_azureopenai_spec.rb +36 -0
- data/spec/elasticsearch/api/actions/inference/put_cohere_spec.rb +36 -0
- data/spec/elasticsearch/api/actions/inference/put_elasticsearch_spec.rb +36 -0
- data/spec/elasticsearch/api/actions/inference/put_elser_spec.rb +36 -0
- data/spec/elasticsearch/api/actions/inference/put_googleaistudio_spec.rb +36 -0
- data/spec/elasticsearch/api/actions/inference/put_googlevertexai_spec.rb +36 -0
- data/spec/elasticsearch/api/actions/inference/put_huggingface_spec.rb +36 -0
- data/spec/elasticsearch/api/actions/inference/put_jinaai_spec.rb +36 -0
- data/spec/elasticsearch/api/actions/inference/put_mistral_spec.rb +36 -0
- data/spec/elasticsearch/api/actions/inference/put_openai_spec.rb +36 -0
- data/spec/elasticsearch/api/actions/inference/put_voyageai_spec.rb +36 -0
- data/spec/elasticsearch/api/actions/inference/put_watsonx_spec.rb +36 -0
- data/spec/elasticsearch/api/actions/inference/rerank_spec.rb +35 -0
- data/spec/elasticsearch/api/actions/inference/{stream_inference_spec.rb → sparse_embedding_spec.rb} +4 -4
- data/spec/elasticsearch/api/actions/inference/stream_completion_spec.rb +35 -0
- data/spec/elasticsearch/api/actions/inference/text_embedding_spec.rb +35 -0
- data/spec/elasticsearch/api/actions/inference/update_spec.rb +36 -0
- data/spec/elasticsearch/api/actions/security/delegate_pki_spec.rb +39 -0
- data/spec/rest_api/skipped_tests_free.yml +15 -0
- data/spec/rest_api/skipped_tests_platinum.yml +13 -0
- data/spec/unit/actions/async_search/delete_spec.rb +35 -0
- data/spec/unit/actions/async_search/get_spec.rb +35 -0
- data/spec/unit/actions/async_search/status_spec.rb +34 -0
- data/spec/unit/actions/async_search/submit_spec.rb +87 -0
- data/spec/yaml-test-runner/run.rb +4 -1
- data/utils/Gemfile +1 -1
- metadata +105 -5
@@ -22,21 +22,17 @@ module Elasticsearch
|
|
22
22
|
module API
|
23
23
|
module Inference
|
24
24
|
module Actions
|
25
|
-
#
|
26
|
-
# This functionality is Experimental and may be changed or removed
|
27
|
-
# completely in a future release. Elastic will take a best effort approach
|
28
|
-
# to fix any issues, but experimental features are not subject to the
|
29
|
-
# support SLA of official GA features.
|
25
|
+
# Update inference
|
30
26
|
#
|
31
27
|
# @option arguments [String] :inference_id The inference Id
|
32
28
|
# @option arguments [String] :task_type The task type
|
33
29
|
# @option arguments [Hash] :headers Custom HTTP headers
|
34
|
-
# @option arguments [Hash] :body The inference
|
30
|
+
# @option arguments [Hash] :body The inference endpoint's task and service settings
|
35
31
|
#
|
36
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.17/
|
32
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.17/update-inference-api.html
|
37
33
|
#
|
38
|
-
def
|
39
|
-
request_opts = { endpoint: arguments[:endpoint] || 'inference.
|
34
|
+
def update(arguments = {})
|
35
|
+
request_opts = { endpoint: arguments[:endpoint] || 'inference.update' }
|
40
36
|
|
41
37
|
defined_params = %i[inference_id task_type].each_with_object({}) do |variable, set_variables|
|
42
38
|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
|
@@ -54,11 +50,11 @@ module Elasticsearch
|
|
54
50
|
|
55
51
|
_task_type = arguments.delete(:task_type)
|
56
52
|
|
57
|
-
method = Elasticsearch::API::
|
53
|
+
method = Elasticsearch::API::HTTP_PUT
|
58
54
|
path = if _task_type && _inference_id
|
59
|
-
"_inference/#{Utils.__listify(_task_type)}/#{Utils.__listify(_inference_id)}/
|
55
|
+
"_inference/#{Utils.__listify(_task_type)}/#{Utils.__listify(_inference_id)}/_update"
|
60
56
|
else
|
61
|
-
"_inference/#{Utils.__listify(_inference_id)}/
|
57
|
+
"_inference/#{Utils.__listify(_inference_id)}/_update"
|
62
58
|
end
|
63
59
|
params = {}
|
64
60
|
|
@@ -27,7 +27,6 @@ module Elasticsearch
|
|
27
27
|
# @option arguments [String] :type The type of trial license to generate (default: "trial")
|
28
28
|
# @option arguments [Boolean] :acknowledge whether the user has acknowledged acknowledge messages (default: false)
|
29
29
|
# @option arguments [Time] :master_timeout Timeout for processing on master node
|
30
|
-
# @option arguments [Time] :timeout Timeout for acknowledgement of update from all nodes in cluster
|
31
30
|
# @option arguments [Hash] :headers Custom HTTP headers
|
32
31
|
#
|
33
32
|
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.17/start-trial.html
|
@@ -34,6 +34,7 @@ module Elasticsearch
|
|
34
34
|
# @option arguments [Time] :timeout Controls the amount of time to wait for the model to deploy.
|
35
35
|
# @option arguments [String] :wait_for The allocation status for which to wait (options: starting, started, fully_allocated)
|
36
36
|
# @option arguments [Hash] :headers Custom HTTP headers
|
37
|
+
# @option arguments [Hash] :body The settings for the trained model deployment
|
37
38
|
#
|
38
39
|
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.17/start-trained-model-deployment.html
|
39
40
|
#
|
@@ -50,7 +51,7 @@ module Elasticsearch
|
|
50
51
|
arguments = arguments.clone
|
51
52
|
headers = arguments.delete(:headers) || {}
|
52
53
|
|
53
|
-
body =
|
54
|
+
body = arguments.delete(:body)
|
54
55
|
|
55
56
|
_model_id = arguments.delete(:model_id)
|
56
57
|
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
#
|
18
|
+
# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80
|
19
|
+
# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec
|
20
|
+
#
|
21
|
+
module Elasticsearch
|
22
|
+
module API
|
23
|
+
module Security
|
24
|
+
module Actions
|
25
|
+
# Delegate PKI authentication.
|
26
|
+
#
|
27
|
+
# @option arguments [Hash] :headers Custom HTTP headers
|
28
|
+
# @option arguments [Hash] :body The X509Certificate chain. (*Required*)
|
29
|
+
#
|
30
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-delegate-pki-authentication.html
|
31
|
+
#
|
32
|
+
def delegate_pki(arguments = {})
|
33
|
+
request_opts = { endpoint: arguments[:endpoint] || 'security.delegate_pki' }
|
34
|
+
|
35
|
+
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
|
36
|
+
|
37
|
+
arguments = arguments.clone
|
38
|
+
headers = arguments.delete(:headers) || {}
|
39
|
+
|
40
|
+
body = arguments.delete(:body)
|
41
|
+
|
42
|
+
method = Elasticsearch::API::HTTP_POST
|
43
|
+
path = '_security/delegate_pki'
|
44
|
+
params = {}
|
45
|
+
|
46
|
+
Elasticsearch::API::Response.new(
|
47
|
+
perform_request(method, path, params, body, headers, request_opts)
|
48
|
+
)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -25,6 +25,8 @@ module Elasticsearch
|
|
25
25
|
# Removes a node from the shutdown list. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported.
|
26
26
|
#
|
27
27
|
# @option arguments [String] :node_id The node id of node to be removed from the shutdown state
|
28
|
+
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
|
29
|
+
# @option arguments [Time] :timeout Explicit operation timeout
|
28
30
|
# @option arguments [Hash] :headers Custom HTTP headers
|
29
31
|
#
|
30
32
|
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current
|
@@ -48,7 +50,7 @@ module Elasticsearch
|
|
48
50
|
|
49
51
|
method = Elasticsearch::API::HTTP_DELETE
|
50
52
|
path = "_nodes/#{Utils.__listify(_node_id)}/shutdown"
|
51
|
-
params =
|
53
|
+
params = Utils.process_params(arguments)
|
52
54
|
|
53
55
|
Elasticsearch::API::Response.new(
|
54
56
|
perform_request(method, path, params, body, headers, request_opts)
|
@@ -25,6 +25,8 @@ module Elasticsearch
|
|
25
25
|
# Adds a node to be shut down. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported.
|
26
26
|
#
|
27
27
|
# @option arguments [String] :node_id The node id of node to be shut down
|
28
|
+
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
|
29
|
+
# @option arguments [Time] :timeout Explicit operation timeout
|
28
30
|
# @option arguments [Hash] :headers Custom HTTP headers
|
29
31
|
# @option arguments [Hash] :body The shutdown type definition to register (*Required*)
|
30
32
|
#
|
@@ -50,7 +52,7 @@ module Elasticsearch
|
|
50
52
|
|
51
53
|
method = Elasticsearch::API::HTTP_PUT
|
52
54
|
path = "_nodes/#{Utils.__listify(_node_id)}/shutdown"
|
53
|
-
params =
|
55
|
+
params = Utils.process_params(arguments)
|
54
56
|
|
55
57
|
Elasticsearch::API::Response.new(
|
56
58
|
perform_request(method, path, params, body, headers, request_opts)
|
@@ -25,6 +25,8 @@ module Elasticsearch
|
|
25
25
|
# Deletes an existing snapshot lifecycle policy.
|
26
26
|
#
|
27
27
|
# @option arguments [String] :policy_id The id of the snapshot lifecycle policy to remove
|
28
|
+
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
|
29
|
+
# @option arguments [Time] :timeout Explicit operation timeout
|
28
30
|
# @option arguments [Hash] :headers Custom HTTP headers
|
29
31
|
#
|
30
32
|
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.17/slm-api-delete-policy.html
|
@@ -48,7 +50,7 @@ module Elasticsearch
|
|
48
50
|
|
49
51
|
method = Elasticsearch::API::HTTP_DELETE
|
50
52
|
path = "_slm/policy/#{Utils.__listify(_policy_id)}"
|
51
|
-
params =
|
53
|
+
params = Utils.process_params(arguments)
|
52
54
|
|
53
55
|
Elasticsearch::API::Response.new(
|
54
56
|
perform_request(method, path, params, body, headers, request_opts)
|
@@ -25,6 +25,8 @@ module Elasticsearch
|
|
25
25
|
# Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time.
|
26
26
|
#
|
27
27
|
# @option arguments [String] :policy_id The id of the snapshot lifecycle policy to be executed
|
28
|
+
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
|
29
|
+
# @option arguments [Time] :timeout Explicit operation timeout
|
28
30
|
# @option arguments [Hash] :headers Custom HTTP headers
|
29
31
|
#
|
30
32
|
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.17/slm-api-execute-lifecycle.html
|
@@ -48,7 +50,7 @@ module Elasticsearch
|
|
48
50
|
|
49
51
|
method = Elasticsearch::API::HTTP_PUT
|
50
52
|
path = "_slm/policy/#{Utils.__listify(_policy_id)}/_execute"
|
51
|
-
params =
|
53
|
+
params = Utils.process_params(arguments)
|
52
54
|
|
53
55
|
Elasticsearch::API::Response.new(
|
54
56
|
perform_request(method, path, params, body, headers, request_opts)
|
@@ -24,6 +24,8 @@ module Elasticsearch
|
|
24
24
|
module Actions
|
25
25
|
# Deletes any snapshots that are expired according to the policy's retention rules.
|
26
26
|
#
|
27
|
+
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
|
28
|
+
# @option arguments [Time] :timeout Explicit operation timeout
|
27
29
|
# @option arguments [Hash] :headers Custom HTTP headers
|
28
30
|
#
|
29
31
|
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.17/slm-api-execute-retention.html
|
@@ -38,7 +40,7 @@ module Elasticsearch
|
|
38
40
|
|
39
41
|
method = Elasticsearch::API::HTTP_POST
|
40
42
|
path = '_slm/_execute_retention'
|
41
|
-
params =
|
43
|
+
params = Utils.process_params(arguments)
|
42
44
|
|
43
45
|
Elasticsearch::API::Response.new(
|
44
46
|
perform_request(method, path, params, body, headers, request_opts)
|
@@ -25,6 +25,8 @@ module Elasticsearch
|
|
25
25
|
# Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts.
|
26
26
|
#
|
27
27
|
# @option arguments [List] :policy_id Comma-separated list of snapshot lifecycle policies to retrieve
|
28
|
+
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
|
29
|
+
# @option arguments [Time] :timeout Explicit operation timeout
|
28
30
|
# @option arguments [Hash] :headers Custom HTTP headers
|
29
31
|
#
|
30
32
|
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.17/slm-api-get-policy.html
|
@@ -50,7 +52,7 @@ module Elasticsearch
|
|
50
52
|
else
|
51
53
|
'_slm/policy'
|
52
54
|
end
|
53
|
-
params =
|
55
|
+
params = Utils.process_params(arguments)
|
54
56
|
|
55
57
|
Elasticsearch::API::Response.new(
|
56
58
|
perform_request(method, path, params, body, headers, request_opts)
|
@@ -24,6 +24,8 @@ module Elasticsearch
|
|
24
24
|
module Actions
|
25
25
|
# Returns global and policy-level statistics about actions taken by snapshot lifecycle management.
|
26
26
|
#
|
27
|
+
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
|
28
|
+
# @option arguments [Time] :timeout Explicit operation timeout
|
27
29
|
# @option arguments [Hash] :headers Custom HTTP headers
|
28
30
|
#
|
29
31
|
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.17/slm-api-get-stats.html
|
@@ -38,7 +40,7 @@ module Elasticsearch
|
|
38
40
|
|
39
41
|
method = Elasticsearch::API::HTTP_GET
|
40
42
|
path = '_slm/stats'
|
41
|
-
params =
|
43
|
+
params = Utils.process_params(arguments)
|
42
44
|
|
43
45
|
Elasticsearch::API::Response.new(
|
44
46
|
perform_request(method, path, params, body, headers, request_opts)
|
@@ -24,6 +24,8 @@ module Elasticsearch
|
|
24
24
|
module Actions
|
25
25
|
# Retrieves the status of snapshot lifecycle management (SLM).
|
26
26
|
#
|
27
|
+
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
|
28
|
+
# @option arguments [Time] :timeout Explicit operation timeout
|
27
29
|
# @option arguments [Hash] :headers Custom HTTP headers
|
28
30
|
#
|
29
31
|
# @see https://www.elastic.co/guide/en/elasticsearch/reference/8.17/slm-api-get-status.html
|
@@ -38,7 +40,7 @@ module Elasticsearch
|
|
38
40
|
|
39
41
|
method = Elasticsearch::API::HTTP_GET
|
40
42
|
path = '_slm/status'
|
41
|
-
params =
|
43
|
+
params = Utils.process_params(arguments)
|
42
44
|
|
43
45
|
Elasticsearch::API::Response.new(
|
44
46
|
perform_request(method, path, params, body, headers, request_opts)
|
@@ -25,6 +25,8 @@ module Elasticsearch
|
|
25
25
|
# Creates or updates a snapshot lifecycle policy.
|
26
26
|
#
|
27
27
|
# @option arguments [String] :policy_id The id of the snapshot lifecycle policy
|
28
|
+
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
|
29
|
+
# @option arguments [Time] :timeout Explicit operation timeout
|
28
30
|
# @option arguments [Hash] :headers Custom HTTP headers
|
29
31
|
# @option arguments [Hash] :body The snapshot lifecycle policy definition to register
|
30
32
|
#
|
@@ -49,7 +51,7 @@ module Elasticsearch
|
|
49
51
|
|
50
52
|
method = Elasticsearch::API::HTTP_PUT
|
51
53
|
path = "_slm/policy/#{Utils.__listify(_policy_id)}"
|
52
|
-
params =
|
54
|
+
params = Utils.process_params(arguments)
|
53
55
|
|
54
56
|
Elasticsearch::API::Response.new(
|
55
57
|
perform_request(method, path, params, body, headers, request_opts)
|
@@ -37,6 +37,7 @@ module Elasticsearch
|
|
37
37
|
# @option arguments [Number] :if_seq_no only perform the update operation if the last operation that has changed the document has the specified sequence number
|
38
38
|
# @option arguments [Number] :if_primary_term only perform the update operation if the last operation that has changed the document has the specified primary term
|
39
39
|
# @option arguments [Boolean] :require_alias When true, requires destination is an alias. Default is false
|
40
|
+
# @option arguments [Boolean] :include_source_on_error True or false if to include the document source in the error message in case of parsing errors. Defaults to true.
|
40
41
|
# @option arguments [Hash] :headers Custom HTTP headers
|
41
42
|
# @option arguments [Hash] :body The request definition requires either `script` or partial `doc` (*Required*)
|
42
43
|
#
|
@@ -24,6 +24,7 @@ module Elasticsearch
|
|
24
24
|
module Actions
|
25
25
|
# Retrieves information about the installed X-Pack features.
|
26
26
|
#
|
27
|
+
# @option arguments [Boolean] :human Defines whether additional human-readable information is included in the response. In particular, it adds descriptions and a tag line. The default value is true.
|
27
28
|
# @option arguments [List] :categories Comma-separated list of info categories. Can be any of: build, license, features
|
28
29
|
# @option arguments [Boolean] :accept_enterprise If this param is used it must be set to true *Deprecated*
|
29
30
|
# @option arguments [Hash] :headers Custom HTTP headers
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
18
|
+
require 'spec_helper'
|
19
|
+
|
20
|
+
describe 'client.esql#async_query_delete' do
|
21
|
+
let(:expected_args) do
|
22
|
+
[
|
23
|
+
'DELETE',
|
24
|
+
'_query/async/foo',
|
25
|
+
{},
|
26
|
+
nil,
|
27
|
+
{},
|
28
|
+
{ defined_params: {id: 'foo' }, endpoint: 'esql.async_query_delete' }
|
29
|
+
]
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'performs the request' do
|
33
|
+
expect(client_double.esql.async_query_delete(id: 'foo')).to be_a Elasticsearch::API::Response
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
18
|
+
require 'spec_helper'
|
19
|
+
|
20
|
+
describe 'client.esql#async_query_stop' do
|
21
|
+
let(:expected_args) do
|
22
|
+
[
|
23
|
+
'POST',
|
24
|
+
'_query/async/foo/stop',
|
25
|
+
{},
|
26
|
+
nil,
|
27
|
+
{},
|
28
|
+
{ endpoint: 'esql.async_query_stop', defined_params: { id: 'foo' } }
|
29
|
+
]
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'performs the request' do
|
33
|
+
expect(client_double.esql.async_query_stop(id: 'foo')).to be_a Elasticsearch::API::Response
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
18
|
+
require 'spec_helper'
|
19
|
+
|
20
|
+
describe 'client.indices#get_data_lifecycle_stats' do
|
21
|
+
let(:expected_args) do
|
22
|
+
[
|
23
|
+
'GET',
|
24
|
+
'_lifecycle/stats',
|
25
|
+
{},
|
26
|
+
nil,
|
27
|
+
{},
|
28
|
+
{ endpoint: 'indices.get_data_lifecycle_stats' }
|
29
|
+
]
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'performs the request' do
|
33
|
+
expect(client_double.indices.get_data_lifecycle_stats).to be_a Elasticsearch::API::Response
|
34
|
+
end
|
35
|
+
end
|
@@ -17,16 +17,15 @@
|
|
17
17
|
|
18
18
|
require 'spec_helper'
|
19
19
|
|
20
|
-
describe 'client.indices#
|
21
|
-
|
20
|
+
describe 'client.indices#resolve_cluster' do
|
22
21
|
let(:expected_args) do
|
23
22
|
[
|
24
23
|
'GET',
|
25
|
-
|
24
|
+
path,
|
26
25
|
{},
|
27
26
|
nil,
|
28
27
|
{},
|
29
|
-
|
28
|
+
otel
|
30
29
|
]
|
31
30
|
end
|
32
31
|
|
@@ -34,16 +33,22 @@ describe 'client.indices#delete_alias' do
|
|
34
33
|
let(:client) do
|
35
34
|
Class.new { include Elasticsearch::API }.new
|
36
35
|
end
|
36
|
+
let(:path) { '_resolve/cluster' }
|
37
|
+
let(:otel) do
|
38
|
+
{ endpoint: 'indices.resolve_cluster' }
|
39
|
+
end
|
37
40
|
|
38
|
-
it '
|
39
|
-
expect
|
40
|
-
client.indices.resolve_cluster
|
41
|
-
}.to raise_exception(ArgumentError)
|
41
|
+
it 'performs the request' do
|
42
|
+
expect(client_double.indices.resolve_cluster).to be_a Elasticsearch::API::Response
|
42
43
|
end
|
43
44
|
end
|
44
45
|
|
45
|
-
|
46
46
|
context 'when name is specified' do
|
47
|
+
let(:path) { '_resolve/cluster/foo' }
|
48
|
+
let(:otel) do
|
49
|
+
{ defined_params: { name: 'foo' }, endpoint: 'indices.resolve_cluster' }
|
50
|
+
end
|
51
|
+
|
47
52
|
it 'performs the request' do
|
48
53
|
expect(client_double.indices.resolve_cluster(name: 'foo')).to be_a Elasticsearch::API::Response
|
49
54
|
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
18
|
+
require 'spec_helper'
|
19
|
+
|
20
|
+
describe 'client#inference.chat_completion_unified' do
|
21
|
+
let(:expected_args) do
|
22
|
+
[
|
23
|
+
'POST',
|
24
|
+
'_inference/chat_completion/bar/_stream',
|
25
|
+
{},
|
26
|
+
nil,
|
27
|
+
{},
|
28
|
+
{ defined_params: { inference_id: 'bar' },
|
29
|
+
endpoint: 'inference.chat_completion_unified' }
|
30
|
+
]
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'performs the request' do
|
34
|
+
expect(client_double.inference.chat_completion_unified(inference_id: 'bar')).to be_a Elasticsearch::API::Response
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
18
|
+
require 'spec_helper'
|
19
|
+
|
20
|
+
describe 'client#inference.completion' do
|
21
|
+
let(:expected_args) do
|
22
|
+
[
|
23
|
+
'POST',
|
24
|
+
'_inference/completion/bar',
|
25
|
+
{},
|
26
|
+
nil,
|
27
|
+
{},
|
28
|
+
{ defined_params: { inference_id: 'bar' },
|
29
|
+
endpoint: 'inference.completion' }
|
30
|
+
]
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'performs the request' do
|
34
|
+
expect(client_double.inference.completion(inference_id: 'bar')).to be_a Elasticsearch::API::Response
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
18
|
+
require 'spec_helper'
|
19
|
+
|
20
|
+
describe 'client#inference.put_alibabacloud' do
|
21
|
+
let(:expected_args) do
|
22
|
+
[
|
23
|
+
'PUT',
|
24
|
+
'_inference/foo/bar',
|
25
|
+
{},
|
26
|
+
nil,
|
27
|
+
{},
|
28
|
+
{ defined_params: { alibabacloud_inference_id: 'bar', task_type: 'foo' },
|
29
|
+
endpoint: 'inference.put_alibabacloud' }
|
30
|
+
]
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'performs the request' do
|
34
|
+
expect(client_double.inference.put_alibabacloud(task_type: 'foo', alibabacloud_inference_id: 'bar')).to be_a Elasticsearch::API::Response
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
18
|
+
require 'spec_helper'
|
19
|
+
|
20
|
+
describe 'client#inference.put_amazonbedrock' do
|
21
|
+
let(:expected_args) do
|
22
|
+
[
|
23
|
+
'PUT',
|
24
|
+
'_inference/foo/bar',
|
25
|
+
{},
|
26
|
+
nil,
|
27
|
+
{},
|
28
|
+
{ defined_params: { amazonbedrock_inference_id: 'bar', task_type: 'foo' },
|
29
|
+
endpoint: 'inference.put_amazonbedrock' }
|
30
|
+
]
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'performs the request' do
|
34
|
+
expect(client_double.inference.put_amazonbedrock(task_type: 'foo', amazonbedrock_inference_id: 'bar')).to be_a Elasticsearch::API::Response
|
35
|
+
end
|
36
|
+
end
|