Skip to content

Commit 407aa9e

Browse files
committed
[X-Pack] Generate code for 7.6
1 parent a669db4 commit 407aa9e

File tree

14 files changed

+265
-26
lines changed

14 files changed

+265
-26
lines changed

elasticsearch-xpack/lib/elasticsearch/xpack/api/actions/license/get.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ module Actions
1111

1212
#
1313
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false)
14+
# @option arguments [Boolean] :accept_enterprise If the active license is an enterprise license, return type as 'enterprise' (default: false)
1415

1516
#
1617
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-license.html
@@ -30,7 +31,8 @@ def get(arguments = {})
3031
#
3132
# @since 6.2.0
3233
ParamsRegistry.register(:get, [
33-
:local
34+
:local,
35+
:accept_enterprise
3436
].freeze)
3537
end
3638
end

elasticsearch-xpack/lib/elasticsearch/xpack/api/actions/machine_learning/delete_data_frame_analytics.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ module Actions
1111

1212
#
1313
# @option arguments [String] :id The ID of the data frame analytics to delete
14+
# @option arguments [Boolean] :force True if the job should be forcefully deleted
1415

1516
#
1617
# @see http://www.elastic.co/guide/en/elasticsearch/reference/current/delete-dfanalytics.html
@@ -24,11 +25,18 @@ def delete_data_frame_analytics(arguments = {})
2425

2526
method = Elasticsearch::API::HTTP_DELETE
2627
path = "_ml/data_frame/analytics/#{Elasticsearch::API::Utils.__listify(_id)}"
27-
params = {}
28+
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
2829

2930
body = nil
3031
perform_request(method, path, params, body).body
3132
end
33+
34+
# Register this action with its valid params when the module is loaded.
35+
#
36+
# @since 6.2.0
37+
ParamsRegistry.register(:delete_data_frame_analytics, [
38+
:force
39+
].freeze)
3240
end
3341
end
3442
end
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Licensed to Elasticsearch B.V under one or more agreements.
2+
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3+
# See the LICENSE file in the project root for more information
4+
5+
module Elasticsearch
6+
module XPack
7+
module API
8+
module MachineLearning
9+
module Actions
10+
# TODO: Description
11+
12+
#
13+
# @option arguments [String] :model_id The ID of the trained model to delete
14+
15+
#
16+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-inference.html
17+
#
18+
def delete_trained_model(arguments = {})
19+
raise ArgumentError, "Required argument 'model_id' missing" unless arguments[:model_id]
20+
21+
arguments = arguments.clone
22+
23+
_model_id = arguments.delete(:model_id)
24+
25+
method = Elasticsearch::API::HTTP_DELETE
26+
path = "_ml/inference/#{Elasticsearch::API::Utils.__listify(_model_id)}"
27+
params = {}
28+
29+
body = nil
30+
perform_request(method, path, params, body).body
31+
end
32+
end
33+
end
34+
end
35+
end
36+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Licensed to Elasticsearch B.V under one or more agreements.
2+
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3+
# See the LICENSE file in the project root for more information
4+
5+
module Elasticsearch
6+
module XPack
7+
module API
8+
module MachineLearning
9+
module Actions
10+
# TODO: Description
11+
12+
#
13+
# @option arguments [String] :id The ID of the data frame analytics to explain
14+
15+
# @option arguments [Hash] :body The data frame analytics config to explain
16+
#
17+
# @see http://www.elastic.co/guide/en/elasticsearch/reference/current/explain-dfanalytics.html
18+
#
19+
def explain_data_frame_analytics(arguments = {})
20+
arguments = arguments.clone
21+
22+
_id = arguments.delete(:id)
23+
24+
method = Elasticsearch::API::HTTP_GET
25+
path = if _id
26+
"_ml/data_frame/analytics/#{Elasticsearch::API::Utils.__listify(_id)}/_explain"
27+
else
28+
"_ml/data_frame/analytics/_explain"
29+
end
30+
params = {}
31+
32+
body = arguments[:body]
33+
perform_request(method, path, params, body).body
34+
end
35+
end
36+
end
37+
end
38+
end
39+
end
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Licensed to Elasticsearch B.V under one or more agreements.
2+
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3+
# See the LICENSE file in the project root for more information
4+
5+
module Elasticsearch
6+
module XPack
7+
module API
8+
module MachineLearning
9+
module Actions
10+
# TODO: Description
11+
12+
#
13+
# @option arguments [String] :model_id The ID of the trained models to fetch
14+
# @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no trained models. (This includes `_all` string or when no trained models have been specified)
15+
# @option arguments [Boolean] :include_model_definition Should the full model definition be included in the results. These definitions can be large. So be cautious when including them. Defaults to false.
16+
# @option arguments [Boolean] :decompress_definition Should the model definition be decompressed into valid JSON or returned in a custom compressed format. Defaults to true.
17+
# @option arguments [Int] :from skips a number of trained models
18+
# @option arguments [Int] :size specifies a max number of trained models to get
19+
20+
#
21+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-inference.html
22+
#
23+
def get_trained_models(arguments = {})
24+
arguments = arguments.clone
25+
26+
_model_id = arguments.delete(:model_id)
27+
28+
method = Elasticsearch::API::HTTP_GET
29+
path = if _model_id
30+
"_ml/inference/#{Elasticsearch::API::Utils.__listify(_model_id)}"
31+
else
32+
"_ml/inference"
33+
end
34+
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
35+
36+
body = nil
37+
perform_request(method, path, params, body).body
38+
end
39+
40+
# Register this action with its valid params when the module is loaded.
41+
#
42+
# @since 6.2.0
43+
ParamsRegistry.register(:get_trained_models, [
44+
:allow_no_match,
45+
:include_model_definition,
46+
:decompress_definition,
47+
:from,
48+
:size
49+
].freeze)
50+
end
51+
end
52+
end
53+
end
54+
end
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Licensed to Elasticsearch B.V under one or more agreements.
2+
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3+
# See the LICENSE file in the project root for more information
4+
5+
module Elasticsearch
6+
module XPack
7+
module API
8+
module MachineLearning
9+
module Actions
10+
# TODO: Description
11+
12+
#
13+
# @option arguments [String] :model_id The ID of the trained models stats to fetch
14+
# @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no trained models. (This includes `_all` string or when no trained models have been specified)
15+
# @option arguments [Int] :from skips a number of trained models
16+
# @option arguments [Int] :size specifies a max number of trained models to get
17+
18+
#
19+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-inference-stats.html
20+
#
21+
def get_trained_models_stats(arguments = {})
22+
arguments = arguments.clone
23+
24+
_model_id = arguments.delete(:model_id)
25+
26+
method = Elasticsearch::API::HTTP_GET
27+
path = if _model_id
28+
"_ml/inference/#{Elasticsearch::API::Utils.__listify(_model_id)}/_stats"
29+
else
30+
"_ml/inference/_stats"
31+
end
32+
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
33+
34+
body = nil
35+
perform_request(method, path, params, body).body
36+
end
37+
38+
# Register this action with its valid params when the module is loaded.
39+
#
40+
# @since 6.2.0
41+
ParamsRegistry.register(:get_trained_models_stats, [
42+
:allow_no_match,
43+
:from,
44+
:size
45+
].freeze)
46+
end
47+
end
48+
end
49+
end
50+
end
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Licensed to Elasticsearch B.V under one or more agreements.
2+
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3+
# See the LICENSE file in the project root for more information
4+
5+
module Elasticsearch
6+
module XPack
7+
module API
8+
module MachineLearning
9+
module Actions
10+
# TODO: Description
11+
12+
#
13+
# @option arguments [String] :model_id The ID of the trained models to store
14+
15+
# @option arguments [Hash] :body The trained model configuration (*Required*)
16+
#
17+
# @see TODO
18+
#
19+
def put_trained_model(arguments = {})
20+
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
21+
raise ArgumentError, "Required argument 'model_id' missing" unless arguments[:model_id]
22+
23+
arguments = arguments.clone
24+
25+
_model_id = arguments.delete(:model_id)
26+
27+
method = Elasticsearch::API::HTTP_PUT
28+
path = "_ml/inference/#{Elasticsearch::API::Utils.__listify(_model_id)}"
29+
params = {}
30+
31+
body = arguments[:body]
32+
perform_request(method, path, params, body).body
33+
end
34+
end
35+
end
36+
end
37+
end
38+
end

elasticsearch-xpack/lib/elasticsearch/xpack/api/actions/monitoring/bulk.rb

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,45 +7,58 @@ module XPack
77
module API
88
module Monitoring
99
module Actions
10+
# TODO: Description
1011

11-
# Insert monitoring data in bulk
1212
#
13-
# @option arguments [String] :type Default document type for items which don't provide one
14-
# @option arguments [Hash] :body The operation definition and data (action-data pairs), separated by newlines (*Required*)
13+
# @option arguments [String] :type Default document type for items which don't provide one *Deprecated*
1514
# @option arguments [String] :system_id Identifier of the monitored system
16-
# @option arguments [String] :system_api_version API version of the monitored system
17-
# @option arguments [String] :system_version Version of the monitored system
15+
# @option arguments [String] :system_api_version API Version of the monitored system
16+
# @option arguments [String] :interval Collection interval (e.g., '10s' or '10000ms') of the payload
17+
18+
# @option arguments [Hash] :body The operation definition and data (action-data pairs), separated by newlines (*Required*)
19+
#
20+
# *Deprecation notice*:
21+
# Specifying types in urls has been deprecated
22+
# Deprecated since version 7.0.0
23+
#
1824
#
19-
# @see http://www.elastic.co/guide/en/monitoring/current/appendix-api-bulk.html
25+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/monitor-elasticsearch-cluster.html
2026
#
21-
def bulk(arguments={})
27+
def bulk(arguments = {})
2228
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
29+
2330
arguments = arguments.clone
24-
type = arguments.delete(:type)
25-
body = arguments.delete(:body)
31+
32+
_type = arguments.delete(:type)
2633

2734
method = Elasticsearch::API::HTTP_POST
28-
path = Elasticsearch::API::Utils.__pathify '_xpack/monitoring', type, '_bulk'
35+
path = if _type
36+
"_monitoring/#{Elasticsearch::API::Utils.__listify(_type)}/bulk"
37+
else
38+
"_monitoring/bulk"
39+
end
2940
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
3041

42+
body = arguments[:body]
3143
if body.is_a? Array
3244
payload = Elasticsearch::API::Utils.__bulkify(body)
3345
else
3446
payload = body
35-
end
47+
end
3648

37-
perform_request(method, path, params, payload).body
49+
perform_request(method, path, params, payload, { "Content-Type" => "application/x-ndjson" }).body
3850
end
3951

4052
# Register this action with its valid params when the module is loaded.
4153
#
42-
# @since 7.4.0
43-
ParamsRegistry.register(:bulk, [ :system_id,
44-
:system_api_version,
45-
:system_version,
46-
:interval ].freeze)
47-
end
54+
# @since 6.2.0
55+
ParamsRegistry.register(:bulk, [
56+
:system_id,
57+
:system_api_version,
58+
:interval
59+
].freeze)
4860
end
4961
end
62+
end
5063
end
5164
end

elasticsearch-xpack/lib/elasticsearch/xpack/api/actions/monitoring/params_registry.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ module API
88
module Monitoring
99
module Actions
1010
module ParamsRegistry
11-
1211
extend self
1312

1413
# A Mapping of all the actions to their list of valid params.

elasticsearch-xpack/lib/elasticsearch/xpack/api/actions/sql/clear_cursor.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def clear_cursor(arguments = {})
2626
perform_request(method, path, params, body).body
2727
end
2828
end
29-
end
29+
end
3030
end
3131
end
3232
end

0 commit comments

Comments
 (0)