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
4 changes: 2 additions & 2 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ steps:
key: run-serverless-tests
depends_on:
- step: create-serverless
soft_fail:
- exit_status: 1
# soft_fail:
# - exit_status: 1
agents:
provider: "gcp"
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,29 @@
# specific language governing permissions and limitations
# under the License.
#
# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80
# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec
# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80
# @see https://github.com/elastic/elasticsearch-specification
#
module Elasticsearch
module API
module Indices
module Actions
# Simulate matching the given index name against the index templates in the system
# Simulate an index.
# Get the index configuration that would be applied to the specified index from an existing index template.
#
# @option arguments [String] :name The name of the index (it must be a concrete index name)
# @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
# @option arguments [Time] :master_timeout Specify timeout for connection to master
# @option arguments [Boolean] :include_defaults Return all relevant default configurations for this index template simulation (default: false)
# @option arguments [String] :name Name of the index to simulate (*Required*)
# @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
# @option arguments [Hash] :body New index template definition, which will be included in the simulation, as if it already exists in the system
#
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-simulate-index.html
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-simulate-index-template
#
def simulate_index_template(arguments = {})
request_opts = { endpoint: arguments[:endpoint] || 'indices.simulate_index_template' }

defined_params = [:name].each_with_object({}) do |variable, set_variables|
defined_params = [:name].inject({}) do |set_variables, variable|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
set_variables
end
request_opts[:defined_params] = defined_params unless defined_params.empty?

Expand All @@ -47,7 +46,7 @@ def simulate_index_template(arguments = {})
arguments = arguments.clone
headers = arguments.delete(:headers) || {}

body = arguments.delete(:body)
body = nil

_name = arguments.delete(:name)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
# specific language governing permissions and limitations
# under the License.
#
# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80
# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec
# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80
# @see https://github.com/elastic/elasticsearch-specification
#
module Elasticsearch
module API
Expand All @@ -25,22 +25,23 @@ module Actions
# Evaluate a trained model.
#
# @option arguments [String] :model_id The unique identifier of the trained model. (*Required*)
# @option arguments [Time] :timeout Controls the amount of time to wait for inference results.
# @option arguments [Time] :timeout Controls the amount of time to wait for inference results. Server default: 10s.
# @option arguments [Hash] :headers Custom HTTP headers
# @option arguments [Hash] :body The docs to apply inference on and inference configuration overrides (*Required*)
# @option arguments [Hash] :body request body
#
# *Deprecation notice*:
# /_ml/trained_models/{model_id}/deployment/_infer is deprecated. Use /_ml/trained_models/{model_id}/_infer instead
# Deprecated since version 8.3.0
#
#
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-trained-model.html
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-infer-trained-model
#
def infer_trained_model(arguments = {})
request_opts = { endpoint: arguments[:endpoint] || 'ml.infer_trained_model' }

defined_params = [:model_id].each_with_object({}) do |variable, set_variables|
defined_params = [:model_id].inject({}) do |set_variables, variable|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
set_variables
end
request_opts[:defined_params] = defined_params unless defined_params.empty?

Expand All @@ -55,7 +56,7 @@ def infer_trained_model(arguments = {})
_model_id = arguments.delete(:model_id)

method = Elasticsearch::API::HTTP_POST
path = ("_ml/trained_models/#{Utils.__listify(_model_id)}/deployment/_infer" if _model_id)
path = "_ml/trained_models/#{Utils.__listify(_model_id)}/_infer"
params = Utils.process_params(arguments)

Elasticsearch::API::Response.new(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
let(:expected_args) do
[
'POST',
'_ml/trained_models/foo/deployment/_infer',
'_ml/trained_models/foo/_infer',
{},
{},
{},
Expand Down