Skip to content

Commit 2b70eb7

Browse files
committed
[API] Renames inference delete, get and put, removes 'model'
1 parent 0288fb5 commit 2b70eb7

File tree

7 files changed

+21
-21
lines changed

7 files changed

+21
-21
lines changed

elasticsearch-api/lib/elasticsearch/api/actions/inference/delete_model.rb renamed to elasticsearch-api/lib/elasticsearch/api/actions/inference/delete.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@ module Elasticsearch
2222
module API
2323
module Inference
2424
module Actions
25-
# Delete model in the Inference API
25+
# Delete an inference endpoint
2626
# This functionality is Experimental and may be changed or removed
2727
# completely in a future release. Elastic will take a best effort approach
2828
# to fix any issues, but experimental features are not subject to the
2929
# support SLA of official GA features.
3030
#
31-
# @option arguments [String] :inference_id The model Id
31+
# @option arguments [String] :inference_id The inference Id
3232
# @option arguments [String] :task_type The task type
3333
# @option arguments [Hash] :headers Custom HTTP headers
3434
#
3535
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-inference-api.html
3636
#
37-
def delete_model(arguments = {})
38-
request_opts = { endpoint: arguments[:endpoint] || 'inference.delete_model' }
37+
def delete(arguments = {})
38+
request_opts = { endpoint: arguments[:endpoint] || 'inference.delete' }
3939

4040
defined_params = %i[inference_id task_type].each_with_object({}) do |variable, set_variables|
4141
set_variables[variable] = arguments[variable] if arguments.key?(variable)

elasticsearch-api/lib/elasticsearch/api/actions/inference/get_model.rb renamed to elasticsearch-api/lib/elasticsearch/api/actions/inference/get.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module Elasticsearch
2222
module API
2323
module Inference
2424
module Actions
25-
# Get a model in the Inference API
25+
# Get an inference endpoint
2626
# This functionality is Experimental and may be changed or removed
2727
# completely in a future release. Elastic will take a best effort approach
2828
# to fix any issues, but experimental features are not subject to the
@@ -34,8 +34,8 @@ module Actions
3434
#
3535
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-inference-api.html
3636
#
37-
def get_model(arguments = {})
38-
request_opts = { endpoint: arguments[:endpoint] || 'inference.get_model' }
37+
def get(arguments = {})
38+
request_opts = { endpoint: arguments[:endpoint] || 'inference.get' }
3939

4040
defined_params = %i[inference_id task_type].each_with_object({}) do |variable, set_variables|
4141
set_variables[variable] = arguments[variable] if arguments.key?(variable)

elasticsearch-api/lib/elasticsearch/api/actions/inference/inference.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module Elasticsearch
2222
module API
2323
module Inference
2424
module Actions
25-
# Perform inference on a model
25+
# Perform inference
2626
# This functionality is Experimental and may be changed or removed
2727
# completely in a future release. Elastic will take a best effort approach
2828
# to fix any issues, but experimental features are not subject to the

elasticsearch-api/lib/elasticsearch/api/actions/inference/put_model.rb renamed to elasticsearch-api/lib/elasticsearch/api/actions/inference/put.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module Elasticsearch
2222
module API
2323
module Inference
2424
module Actions
25-
# Configure a model for use in the Inference API
25+
# Configure an inference endpoint for use in the Inference API
2626
# This functionality is Experimental and may be changed or removed
2727
# completely in a future release. Elastic will take a best effort approach
2828
# to fix any issues, but experimental features are not subject to the
@@ -31,12 +31,12 @@ module Actions
3131
# @option arguments [String] :inference_id The inference Id
3232
# @option arguments [String] :task_type The task type
3333
# @option arguments [Hash] :headers Custom HTTP headers
34-
# @option arguments [Hash] :body The model's task and service settings
34+
# @option arguments [Hash] :body The inference endpoint's task and service settings
3535
#
3636
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-inference-api.html
3737
#
38-
def put_model(arguments = {})
39-
request_opts = { endpoint: arguments[:endpoint] || 'inference.put_model' }
38+
def put(arguments = {})
39+
request_opts = { endpoint: arguments[:endpoint] || 'inference.put' }
4040

4141
defined_params = %i[inference_id task_type].each_with_object({}) do |variable, set_variables|
4242
set_variables[variable] = arguments[variable] if arguments.key?(variable)

elasticsearch-api/spec/elasticsearch/api/actions/inference/delete_model_spec.rb renamed to elasticsearch-api/spec/elasticsearch/api/actions/inference/delete_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
require 'spec_helper'
1919

20-
describe 'client#inference.delete_model' do
20+
describe 'client#inference.delete' do
2121
let(:expected_args) do
2222
[
2323
'DELETE',
@@ -26,11 +26,11 @@
2626
nil,
2727
{},
2828
{ defined_params: { inference_id: 'bar', task_type: 'foo' },
29-
endpoint: 'inference.delete_model' }
29+
endpoint: 'inference.delete' }
3030
]
3131
end
3232

3333
it 'performs the request' do
34-
expect(client_double.inference.delete_model(task_type: 'foo', inference_id: 'bar')).to be_a Elasticsearch::API::Response
34+
expect(client_double.inference.delete(task_type: 'foo', inference_id: 'bar')).to be_a Elasticsearch::API::Response
3535
end
3636
end

elasticsearch-api/spec/elasticsearch/api/actions/inference/get_model_spec.rb renamed to elasticsearch-api/spec/elasticsearch/api/actions/inference/get_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
require 'spec_helper'
1919

20-
describe 'client#inference.get_model' do
20+
describe 'client#inference.get' do
2121
let(:expected_args) do
2222
[
2323
'GET',
@@ -26,11 +26,11 @@
2626
nil,
2727
{},
2828
{ defined_params: { inference_id: 'bar', task_type: 'foo' },
29-
endpoint: 'inference.get_model' }
29+
endpoint: 'inference.get' }
3030
]
3131
end
3232

3333
it 'performs the request' do
34-
expect(client_double.inference.get_model(task_type: 'foo', inference_id: 'bar')).to be_a Elasticsearch::API::Response
34+
expect(client_double.inference.get(task_type: 'foo', inference_id: 'bar')).to be_a Elasticsearch::API::Response
3535
end
3636
end

elasticsearch-api/spec/elasticsearch/api/actions/inference/put_model_spec.rb renamed to elasticsearch-api/spec/elasticsearch/api/actions/inference/put_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
require 'spec_helper'
1919

20-
describe 'client#inference.put_model' do
20+
describe 'client#inference.put' do
2121
let(:expected_args) do
2222
[
2323
'PUT',
@@ -26,11 +26,11 @@
2626
nil,
2727
{},
2828
{ defined_params: { inference_id: 'bar', task_type: 'foo' },
29-
endpoint: 'inference.put_model' }
29+
endpoint: 'inference.put' }
3030
]
3131
end
3232

3333
it 'performs the request' do
34-
expect(client_double.inference.put_model(task_type: 'foo', inference_id: 'bar')).to be_a Elasticsearch::API::Response
34+
expect(client_double.inference.put(task_type: 'foo', inference_id: 'bar')).to be_a Elasticsearch::API::Response
3535
end
3636
end

0 commit comments

Comments
 (0)