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.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/elasticsearch-api.gemspec +2 -1
  3. data/lib/elasticsearch/api/actions/async_search/submit.rb +1 -0
  4. data/lib/elasticsearch/api/actions/bulk.rb +1 -0
  5. data/lib/elasticsearch/api/actions/cat/help.rb +1 -3
  6. data/lib/elasticsearch/api/actions/cat/segments.rb +2 -0
  7. data/lib/elasticsearch/api/actions/cat/tasks.rb +2 -0
  8. data/lib/elasticsearch/api/actions/create.rb +1 -0
  9. data/lib/elasticsearch/api/actions/eql/search.rb +2 -0
  10. data/lib/elasticsearch/api/actions/esql/async_query_delete.rb +60 -0
  11. data/lib/elasticsearch/api/actions/esql/async_query_stop.rb +60 -0
  12. data/lib/elasticsearch/api/actions/index.rb +1 -0
  13. data/lib/elasticsearch/api/actions/indices/get_data_lifecycle_stats.rb +50 -0
  14. data/lib/elasticsearch/api/actions/indices/put_template.rb +1 -0
  15. data/lib/elasticsearch/api/actions/indices/resolve_cluster.rb +11 -8
  16. data/lib/elasticsearch/api/actions/indices/rollover.rb +0 -1
  17. data/lib/elasticsearch/api/actions/inference/chat_completion_unified.rb +61 -0
  18. data/lib/elasticsearch/api/actions/inference/completion.rb +61 -0
  19. data/lib/elasticsearch/api/actions/inference/delete.rb +0 -4
  20. data/lib/elasticsearch/api/actions/inference/get.rb +0 -4
  21. data/lib/elasticsearch/api/actions/inference/inference.rb +0 -4
  22. data/lib/elasticsearch/api/actions/inference/put.rb +0 -4
  23. data/lib/elasticsearch/api/actions/inference/put_alibabacloud.rb +69 -0
  24. data/lib/elasticsearch/api/actions/inference/put_amazonbedrock.rb +69 -0
  25. data/lib/elasticsearch/api/actions/inference/put_anthropic.rb +69 -0
  26. data/lib/elasticsearch/api/actions/inference/put_azureaistudio.rb +69 -0
  27. data/lib/elasticsearch/api/actions/inference/put_azureopenai.rb +69 -0
  28. data/lib/elasticsearch/api/actions/inference/put_cohere.rb +65 -0
  29. data/lib/elasticsearch/api/actions/inference/put_elasticsearch.rb +69 -0
  30. data/lib/elasticsearch/api/actions/inference/put_elser.rb +65 -0
  31. data/lib/elasticsearch/api/actions/inference/put_googleaistudio.rb +69 -0
  32. data/lib/elasticsearch/api/actions/inference/put_googlevertexai.rb +69 -0
  33. data/lib/elasticsearch/api/actions/inference/put_hugging_face.rb +69 -0
  34. data/lib/elasticsearch/api/actions/inference/put_jinaai.rb +65 -0
  35. data/lib/elasticsearch/api/actions/inference/put_mistral.rb +69 -0
  36. data/lib/elasticsearch/api/actions/inference/put_openai.rb +65 -0
  37. data/lib/elasticsearch/api/actions/inference/put_voyageai.rb +69 -0
  38. data/lib/elasticsearch/api/actions/inference/put_watsonx.rb +69 -0
  39. data/lib/elasticsearch/api/actions/inference/rerank.rb +61 -0
  40. data/lib/elasticsearch/api/actions/inference/sparse_embedding.rb +61 -0
  41. data/lib/elasticsearch/api/actions/inference/stream_completion.rb +61 -0
  42. data/lib/elasticsearch/api/actions/inference/text_embedding.rb +61 -0
  43. data/lib/elasticsearch/api/actions/inference/{stream_inference.rb → update.rb} +8 -12
  44. data/lib/elasticsearch/api/actions/license/post_start_trial.rb +0 -1
  45. data/lib/elasticsearch/api/actions/machine_learning/start_trained_model_deployment.rb +2 -1
  46. data/lib/elasticsearch/api/actions/security/delegate_pki.rb +53 -0
  47. data/lib/elasticsearch/api/actions/shutdown/delete_node.rb +3 -1
  48. data/lib/elasticsearch/api/actions/shutdown/put_node.rb +3 -1
  49. data/lib/elasticsearch/api/actions/snapshot_lifecycle_management/delete_lifecycle.rb +3 -1
  50. data/lib/elasticsearch/api/actions/snapshot_lifecycle_management/execute_lifecycle.rb +3 -1
  51. data/lib/elasticsearch/api/actions/snapshot_lifecycle_management/execute_retention.rb +3 -1
  52. data/lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_lifecycle.rb +3 -1
  53. data/lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_stats.rb +3 -1
  54. data/lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_status.rb +3 -1
  55. data/lib/elasticsearch/api/actions/snapshot_lifecycle_management/put_lifecycle.rb +3 -1
  56. data/lib/elasticsearch/api/actions/update.rb +1 -0
  57. data/lib/elasticsearch/api/actions/xpack/info.rb +1 -0
  58. data/lib/elasticsearch/api/version.rb +1 -1
  59. data/spec/elasticsearch/api/actions/esql/async_query_delete_spec.rb +35 -0
  60. data/spec/elasticsearch/api/actions/esql/async_query_stop_spec.rb +35 -0
  61. data/spec/elasticsearch/api/actions/indices/get_data_lifecycle_stats_spec.rb +35 -0
  62. data/spec/elasticsearch/api/actions/indices/resolve_cluster_spec.rb +14 -9
  63. data/spec/elasticsearch/api/actions/inference/chat_completion_unified_spec.rb +36 -0
  64. data/spec/elasticsearch/api/actions/inference/completion_spec.rb +36 -0
  65. data/spec/elasticsearch/api/actions/inference/put_alibabacloud_spec.rb +36 -0
  66. data/spec/elasticsearch/api/actions/inference/put_amazonbedrock_spec.rb +36 -0
  67. data/spec/elasticsearch/api/actions/inference/put_anthropic_spec.rb +36 -0
  68. data/spec/elasticsearch/api/actions/inference/put_azureaistudio_spec.rb +36 -0
  69. data/spec/elasticsearch/api/actions/inference/put_azureopenai_spec.rb +36 -0
  70. data/spec/elasticsearch/api/actions/inference/put_cohere_spec.rb +36 -0
  71. data/spec/elasticsearch/api/actions/inference/put_elasticsearch_spec.rb +36 -0
  72. data/spec/elasticsearch/api/actions/inference/put_elser_spec.rb +36 -0
  73. data/spec/elasticsearch/api/actions/inference/put_googleaistudio_spec.rb +36 -0
  74. data/spec/elasticsearch/api/actions/inference/put_googlevertexai_spec.rb +36 -0
  75. data/spec/elasticsearch/api/actions/inference/put_huggingface_spec.rb +36 -0
  76. data/spec/elasticsearch/api/actions/inference/put_jinaai_spec.rb +36 -0
  77. data/spec/elasticsearch/api/actions/inference/put_mistral_spec.rb +36 -0
  78. data/spec/elasticsearch/api/actions/inference/put_openai_spec.rb +36 -0
  79. data/spec/elasticsearch/api/actions/inference/put_voyageai_spec.rb +36 -0
  80. data/spec/elasticsearch/api/actions/inference/put_watsonx_spec.rb +36 -0
  81. data/spec/elasticsearch/api/actions/inference/rerank_spec.rb +35 -0
  82. data/spec/elasticsearch/api/actions/inference/{stream_inference_spec.rb → sparse_embedding_spec.rb} +4 -4
  83. data/spec/elasticsearch/api/actions/inference/stream_completion_spec.rb +35 -0
  84. data/spec/elasticsearch/api/actions/inference/text_embedding_spec.rb +35 -0
  85. data/spec/elasticsearch/api/actions/inference/update_spec.rb +36 -0
  86. data/spec/elasticsearch/api/actions/security/delegate_pki_spec.rb +39 -0
  87. data/spec/rest_api/skipped_tests_free.yml +15 -0
  88. data/spec/rest_api/skipped_tests_platinum.yml +13 -0
  89. data/spec/unit/actions/async_search/delete_spec.rb +35 -0
  90. data/spec/unit/actions/async_search/get_spec.rb +35 -0
  91. data/spec/unit/actions/async_search/status_spec.rb +34 -0
  92. data/spec/unit/actions/async_search/submit_spec.rb +87 -0
  93. data/spec/yaml-test-runner/run.rb +4 -1
  94. data/utils/Gemfile +1 -1
  95. metadata +105 -5
@@ -0,0 +1,69 @@
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 Inference
24
+ module Actions
25
+ # Configure an Amazon Bedrock inference endpoint
26
+ #
27
+ # @option arguments [String] :task_type The task type
28
+ # @option arguments [String] :amazonbedrock_inference_id The inference Id
29
+ # @option arguments [Hash] :headers Custom HTTP headers
30
+ # @option arguments [Hash] :body The inference endpoint's task and service settings
31
+ #
32
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.17/infer-service-amazon-bedrock.html
33
+ #
34
+ def put_amazonbedrock(arguments = {})
35
+ request_opts = { endpoint: arguments[:endpoint] || 'inference.put_amazonbedrock' }
36
+
37
+ defined_params = %i[task_type amazonbedrock_inference_id].each_with_object({}) do |variable, set_variables|
38
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
39
+ end
40
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
41
+
42
+ raise ArgumentError, "Required argument 'task_type' missing" unless arguments[:task_type]
43
+
44
+ unless arguments[:amazonbedrock_inference_id]
45
+ raise ArgumentError,
46
+ "Required argument 'amazonbedrock_inference_id' missing"
47
+ end
48
+
49
+ arguments = arguments.clone
50
+ headers = arguments.delete(:headers) || {}
51
+
52
+ body = arguments.delete(:body)
53
+
54
+ _task_type = arguments.delete(:task_type)
55
+
56
+ _amazonbedrock_inference_id = arguments.delete(:amazonbedrock_inference_id)
57
+
58
+ method = Elasticsearch::API::HTTP_PUT
59
+ path = "_inference/#{Utils.__listify(_task_type)}/#{Utils.__listify(_amazonbedrock_inference_id)}"
60
+ params = {}
61
+
62
+ Elasticsearch::API::Response.new(
63
+ perform_request(method, path, params, body, headers, request_opts)
64
+ )
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,69 @@
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 Inference
24
+ module Actions
25
+ # Configure an Anthropic inference endpoint
26
+ #
27
+ # @option arguments [String] :task_type The task type
28
+ # @option arguments [String] :anthropic_inference_id The inference Id
29
+ # @option arguments [Hash] :headers Custom HTTP headers
30
+ # @option arguments [Hash] :body The inference endpoint's task and service settings
31
+ #
32
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.17/infer-service-anthropic.html
33
+ #
34
+ def put_anthropic(arguments = {})
35
+ request_opts = { endpoint: arguments[:endpoint] || 'inference.put_anthropic' }
36
+
37
+ defined_params = %i[task_type anthropic_inference_id].each_with_object({}) do |variable, set_variables|
38
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
39
+ end
40
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
41
+
42
+ raise ArgumentError, "Required argument 'task_type' missing" unless arguments[:task_type]
43
+
44
+ unless arguments[:anthropic_inference_id]
45
+ raise ArgumentError,
46
+ "Required argument 'anthropic_inference_id' missing"
47
+ end
48
+
49
+ arguments = arguments.clone
50
+ headers = arguments.delete(:headers) || {}
51
+
52
+ body = arguments.delete(:body)
53
+
54
+ _task_type = arguments.delete(:task_type)
55
+
56
+ _anthropic_inference_id = arguments.delete(:anthropic_inference_id)
57
+
58
+ method = Elasticsearch::API::HTTP_PUT
59
+ path = "_inference/#{Utils.__listify(_task_type)}/#{Utils.__listify(_anthropic_inference_id)}"
60
+ params = {}
61
+
62
+ Elasticsearch::API::Response.new(
63
+ perform_request(method, path, params, body, headers, request_opts)
64
+ )
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,69 @@
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 Inference
24
+ module Actions
25
+ # Configure an Azure AI Studio inference endpoint
26
+ #
27
+ # @option arguments [String] :task_type The task type
28
+ # @option arguments [String] :azureaistudio_inference_id The inference Id
29
+ # @option arguments [Hash] :headers Custom HTTP headers
30
+ # @option arguments [Hash] :body The inference endpoint's task and service settings
31
+ #
32
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.17/infer-service-azure-ai-studio.html
33
+ #
34
+ def put_azureaistudio(arguments = {})
35
+ request_opts = { endpoint: arguments[:endpoint] || 'inference.put_azureaistudio' }
36
+
37
+ defined_params = %i[task_type azureaistudio_inference_id].each_with_object({}) do |variable, set_variables|
38
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
39
+ end
40
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
41
+
42
+ raise ArgumentError, "Required argument 'task_type' missing" unless arguments[:task_type]
43
+
44
+ unless arguments[:azureaistudio_inference_id]
45
+ raise ArgumentError,
46
+ "Required argument 'azureaistudio_inference_id' missing"
47
+ end
48
+
49
+ arguments = arguments.clone
50
+ headers = arguments.delete(:headers) || {}
51
+
52
+ body = arguments.delete(:body)
53
+
54
+ _task_type = arguments.delete(:task_type)
55
+
56
+ _azureaistudio_inference_id = arguments.delete(:azureaistudio_inference_id)
57
+
58
+ method = Elasticsearch::API::HTTP_PUT
59
+ path = "_inference/#{Utils.__listify(_task_type)}/#{Utils.__listify(_azureaistudio_inference_id)}"
60
+ params = {}
61
+
62
+ Elasticsearch::API::Response.new(
63
+ perform_request(method, path, params, body, headers, request_opts)
64
+ )
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,69 @@
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 Inference
24
+ module Actions
25
+ # Configure an Azure OpenAI inference endpoint
26
+ #
27
+ # @option arguments [String] :task_type The task type
28
+ # @option arguments [String] :azureopenai_inference_id The inference Id
29
+ # @option arguments [Hash] :headers Custom HTTP headers
30
+ # @option arguments [Hash] :body The inference endpoint's task and service settings
31
+ #
32
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.17/infer-service-azure-openai.html
33
+ #
34
+ def put_azureopenai(arguments = {})
35
+ request_opts = { endpoint: arguments[:endpoint] || 'inference.put_azureopenai' }
36
+
37
+ defined_params = %i[task_type azureopenai_inference_id].each_with_object({}) do |variable, set_variables|
38
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
39
+ end
40
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
41
+
42
+ raise ArgumentError, "Required argument 'task_type' missing" unless arguments[:task_type]
43
+
44
+ unless arguments[:azureopenai_inference_id]
45
+ raise ArgumentError,
46
+ "Required argument 'azureopenai_inference_id' missing"
47
+ end
48
+
49
+ arguments = arguments.clone
50
+ headers = arguments.delete(:headers) || {}
51
+
52
+ body = arguments.delete(:body)
53
+
54
+ _task_type = arguments.delete(:task_type)
55
+
56
+ _azureopenai_inference_id = arguments.delete(:azureopenai_inference_id)
57
+
58
+ method = Elasticsearch::API::HTTP_PUT
59
+ path = "_inference/#{Utils.__listify(_task_type)}/#{Utils.__listify(_azureopenai_inference_id)}"
60
+ params = {}
61
+
62
+ Elasticsearch::API::Response.new(
63
+ perform_request(method, path, params, body, headers, request_opts)
64
+ )
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,65 @@
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 Inference
24
+ module Actions
25
+ # Configure a Cohere inference endpoint
26
+ #
27
+ # @option arguments [String] :task_type The task type
28
+ # @option arguments [String] :cohere_inference_id The inference Id
29
+ # @option arguments [Hash] :headers Custom HTTP headers
30
+ # @option arguments [Hash] :body The inference endpoint's task and service settings
31
+ #
32
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.17/infer-service-cohere.html
33
+ #
34
+ def put_cohere(arguments = {})
35
+ request_opts = { endpoint: arguments[:endpoint] || 'inference.put_cohere' }
36
+
37
+ defined_params = %i[task_type cohere_inference_id].each_with_object({}) do |variable, set_variables|
38
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
39
+ end
40
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
41
+
42
+ raise ArgumentError, "Required argument 'task_type' missing" unless arguments[:task_type]
43
+ raise ArgumentError, "Required argument 'cohere_inference_id' missing" unless arguments[:cohere_inference_id]
44
+
45
+ arguments = arguments.clone
46
+ headers = arguments.delete(:headers) || {}
47
+
48
+ body = arguments.delete(:body)
49
+
50
+ _task_type = arguments.delete(:task_type)
51
+
52
+ _cohere_inference_id = arguments.delete(:cohere_inference_id)
53
+
54
+ method = Elasticsearch::API::HTTP_PUT
55
+ path = "_inference/#{Utils.__listify(_task_type)}/#{Utils.__listify(_cohere_inference_id)}"
56
+ params = {}
57
+
58
+ Elasticsearch::API::Response.new(
59
+ perform_request(method, path, params, body, headers, request_opts)
60
+ )
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,69 @@
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 Inference
24
+ module Actions
25
+ # Configure an Elasticsearch inference endpoint
26
+ #
27
+ # @option arguments [String] :task_type The task type
28
+ # @option arguments [String] :elasticsearch_inference_id The inference Id
29
+ # @option arguments [Hash] :headers Custom HTTP headers
30
+ # @option arguments [Hash] :body The inference endpoint's task and service settings
31
+ #
32
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.17/infer-service-elasticsearch.html
33
+ #
34
+ def put_elasticsearch(arguments = {})
35
+ request_opts = { endpoint: arguments[:endpoint] || 'inference.put_elasticsearch' }
36
+
37
+ defined_params = %i[task_type elasticsearch_inference_id].each_with_object({}) do |variable, set_variables|
38
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
39
+ end
40
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
41
+
42
+ raise ArgumentError, "Required argument 'task_type' missing" unless arguments[:task_type]
43
+
44
+ unless arguments[:elasticsearch_inference_id]
45
+ raise ArgumentError,
46
+ "Required argument 'elasticsearch_inference_id' missing"
47
+ end
48
+
49
+ arguments = arguments.clone
50
+ headers = arguments.delete(:headers) || {}
51
+
52
+ body = arguments.delete(:body)
53
+
54
+ _task_type = arguments.delete(:task_type)
55
+
56
+ _elasticsearch_inference_id = arguments.delete(:elasticsearch_inference_id)
57
+
58
+ method = Elasticsearch::API::HTTP_PUT
59
+ path = "_inference/#{Utils.__listify(_task_type)}/#{Utils.__listify(_elasticsearch_inference_id)}"
60
+ params = {}
61
+
62
+ Elasticsearch::API::Response.new(
63
+ perform_request(method, path, params, body, headers, request_opts)
64
+ )
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,65 @@
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 Inference
24
+ module Actions
25
+ # Configure an ELSER inference endpoint
26
+ #
27
+ # @option arguments [String] :task_type The task type
28
+ # @option arguments [String] :elser_inference_id The inference Id
29
+ # @option arguments [Hash] :headers Custom HTTP headers
30
+ # @option arguments [Hash] :body The inference endpoint's task and service settings
31
+ #
32
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.17/infer-service-elser.html
33
+ #
34
+ def put_elser(arguments = {})
35
+ request_opts = { endpoint: arguments[:endpoint] || 'inference.put_elser' }
36
+
37
+ defined_params = %i[task_type elser_inference_id].each_with_object({}) do |variable, set_variables|
38
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
39
+ end
40
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
41
+
42
+ raise ArgumentError, "Required argument 'task_type' missing" unless arguments[:task_type]
43
+ raise ArgumentError, "Required argument 'elser_inference_id' missing" unless arguments[:elser_inference_id]
44
+
45
+ arguments = arguments.clone
46
+ headers = arguments.delete(:headers) || {}
47
+
48
+ body = arguments.delete(:body)
49
+
50
+ _task_type = arguments.delete(:task_type)
51
+
52
+ _elser_inference_id = arguments.delete(:elser_inference_id)
53
+
54
+ method = Elasticsearch::API::HTTP_PUT
55
+ path = "_inference/#{Utils.__listify(_task_type)}/#{Utils.__listify(_elser_inference_id)}"
56
+ params = {}
57
+
58
+ Elasticsearch::API::Response.new(
59
+ perform_request(method, path, params, body, headers, request_opts)
60
+ )
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,69 @@
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 Inference
24
+ module Actions
25
+ # Configure a Google AI Studio inference endpoint
26
+ #
27
+ # @option arguments [String] :task_type The task type
28
+ # @option arguments [String] :googleaistudio_inference_id The inference Id
29
+ # @option arguments [Hash] :headers Custom HTTP headers
30
+ # @option arguments [Hash] :body The inference endpoint's task and service settings
31
+ #
32
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.17/infer-service-google-ai-studio.html
33
+ #
34
+ def put_googleaistudio(arguments = {})
35
+ request_opts = { endpoint: arguments[:endpoint] || 'inference.put_googleaistudio' }
36
+
37
+ defined_params = %i[task_type googleaistudio_inference_id].each_with_object({}) do |variable, set_variables|
38
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
39
+ end
40
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
41
+
42
+ raise ArgumentError, "Required argument 'task_type' missing" unless arguments[:task_type]
43
+
44
+ unless arguments[:googleaistudio_inference_id]
45
+ raise ArgumentError,
46
+ "Required argument 'googleaistudio_inference_id' missing"
47
+ end
48
+
49
+ arguments = arguments.clone
50
+ headers = arguments.delete(:headers) || {}
51
+
52
+ body = arguments.delete(:body)
53
+
54
+ _task_type = arguments.delete(:task_type)
55
+
56
+ _googleaistudio_inference_id = arguments.delete(:googleaistudio_inference_id)
57
+
58
+ method = Elasticsearch::API::HTTP_PUT
59
+ path = "_inference/#{Utils.__listify(_task_type)}/#{Utils.__listify(_googleaistudio_inference_id)}"
60
+ params = {}
61
+
62
+ Elasticsearch::API::Response.new(
63
+ perform_request(method, path, params, body, headers, request_opts)
64
+ )
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,69 @@
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 Inference
24
+ module Actions
25
+ # Configure a Google Vertex AI inference endpoint
26
+ #
27
+ # @option arguments [String] :task_type The task type
28
+ # @option arguments [String] :googlevertexai_inference_id The inference Id
29
+ # @option arguments [Hash] :headers Custom HTTP headers
30
+ # @option arguments [Hash] :body The inference endpoint's task and service settings
31
+ #
32
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.17/infer-service-google-vertex-ai.html
33
+ #
34
+ def put_googlevertexai(arguments = {})
35
+ request_opts = { endpoint: arguments[:endpoint] || 'inference.put_googlevertexai' }
36
+
37
+ defined_params = %i[task_type googlevertexai_inference_id].each_with_object({}) do |variable, set_variables|
38
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
39
+ end
40
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
41
+
42
+ raise ArgumentError, "Required argument 'task_type' missing" unless arguments[:task_type]
43
+
44
+ unless arguments[:googlevertexai_inference_id]
45
+ raise ArgumentError,
46
+ "Required argument 'googlevertexai_inference_id' missing"
47
+ end
48
+
49
+ arguments = arguments.clone
50
+ headers = arguments.delete(:headers) || {}
51
+
52
+ body = arguments.delete(:body)
53
+
54
+ _task_type = arguments.delete(:task_type)
55
+
56
+ _googlevertexai_inference_id = arguments.delete(:googlevertexai_inference_id)
57
+
58
+ method = Elasticsearch::API::HTTP_PUT
59
+ path = "_inference/#{Utils.__listify(_task_type)}/#{Utils.__listify(_googlevertexai_inference_id)}"
60
+ params = {}
61
+
62
+ Elasticsearch::API::Response.new(
63
+ perform_request(method, path, params, body, headers, request_opts)
64
+ )
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end