Skip to content

Commit 6dcbd17

Browse files
committed
[X-Pack] Generate X-Pack API code
1 parent e67ca26 commit 6dcbd17

File tree

153 files changed

+911
-630
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+911
-630
lines changed

elasticsearch-xpack/lib/elasticsearch/xpack/api/actions/async_search/delete.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,18 @@ module XPack
77
module API
88
module AsyncSearch
99
module Actions
10-
# TODO: Description
11-
10+
# Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted.
1211
#
1312
# @option arguments [String] :id The async search ID
14-
13+
# @option arguments [Hash] :headers Custom HTTP headers
1514
#
1615
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html
1716
#
1817
def delete(arguments = {})
1918
raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
2019

20+
headers = arguments.delete(:headers) || {}
21+
2122
arguments = arguments.clone
2223

2324
_id = arguments.delete(:id)
@@ -27,7 +28,7 @@ def delete(arguments = {})
2728
params = {}
2829

2930
body = nil
30-
perform_request(method, path, params, body).body
31+
perform_request(method, path, params, body, headers).body
3132
end
3233
end
3334
end

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,21 @@ module XPack
77
module API
88
module AsyncSearch
99
module Actions
10-
# TODO: Description
11-
10+
# Retrieves the results of a previously submitted async search request given its ID.
1211
#
1312
# @option arguments [String] :id The async search ID
1413
# @option arguments [Time] :wait_for_completion_timeout Specify the time that the request should block waiting for the final response
1514
# @option arguments [Time] :keep_alive Specify the time interval in which the results (partial or final) for this search will be available
1615
# @option arguments [Boolean] :typed_keys Specify whether aggregation and suggester names should be prefixed by their respective types in the response
17-
16+
# @option arguments [Hash] :headers Custom HTTP headers
1817
#
1918
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html
2019
#
2120
def get(arguments = {})
2221
raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
2322

23+
headers = arguments.delete(:headers) || {}
24+
2425
arguments = arguments.clone
2526

2627
_id = arguments.delete(:id)
@@ -30,7 +31,7 @@ def get(arguments = {})
3031
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
3132

3233
body = nil
33-
perform_request(method, path, params, body).body
34+
perform_request(method, path, params, body, headers).body
3435
end
3536

3637
# Register this action with its valid params when the module is loaded.

elasticsearch-xpack/lib/elasticsearch/xpack/api/actions/async_search/submit.rb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ module XPack
77
module API
88
module AsyncSearch
99
module Actions
10-
# TODO: Description
11-
10+
# Executes a search request asynchronously.
1211
#
1312
# @option arguments [List] :index A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
1413
# @option arguments [Time] :wait_for_completion_timeout Specify the time that the request should block waiting for the final response
@@ -30,7 +29,7 @@ module Actions
3029
# @option arguments [Boolean] :ignore_throttled Whether specified concrete, expanded or aliased indices should be ignored when throttled
3130
# @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
3231
# @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both.
33-
# (options: open,closed,none,all)
32+
# (options: open,closed,hidden,none,all)
3433

3534
# @option arguments [Boolean] :lenient Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
3635
# @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random)
@@ -60,12 +59,14 @@ module Actions
6059
# @option arguments [Boolean] :version Specify whether to return document version as part of a hit
6160
# @option arguments [Boolean] :seq_no_primary_term Specify whether to return sequence number and primary term of the last modification of each hit
6261
# @option arguments [Number] :max_concurrent_shard_requests The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests
63-
62+
# @option arguments [Hash] :headers Custom HTTP headers
6463
# @option arguments [Hash] :body The search definition using the Query DSL
6564
#
6665
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html
6766
#
6867
def submit(arguments = {})
68+
headers = arguments.delete(:headers) || {}
69+
6970
arguments = arguments.clone
7071

7172
_index = arguments.delete(:index)
@@ -75,11 +76,11 @@ def submit(arguments = {})
7576
"#{Elasticsearch::API::Utils.__listify(_index)}/_async_search"
7677
else
7778
"_async_search"
78-
end
79+
end
7980
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
8081

8182
body = arguments[:body]
82-
perform_request(method, path, params, body).body
83+
perform_request(method, path, params, body, headers).body
8384
end
8485

8586
# Register this action with its valid params when the module is loaded.

elasticsearch-xpack/lib/elasticsearch/xpack/api/actions/cat/ml_data_frame_analytics.rb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ module XPack
77
module API
88
module Cat
99
module Actions
10-
# TODO: Description
11-
10+
# Gets configuration and usage information about data frame analytics jobs.
1211
#
1312
# @option arguments [String] :id The ID of the data frame analytics to fetch
1413
# @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no configs. (This includes `_all` string or when no configs have been specified)
@@ -20,14 +19,16 @@ module Actions
2019
# @option arguments [Boolean] :help Return help information
2120
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
2221
# @option arguments [String] :time The unit in which to display time values
23-
# (options: d (Days),h (Hours),m (Minutes),s (Seconds),ms (Milliseconds),micros (Microseconds),nanos (Nanoseconds))
22+
# (options: d,h,m,s,ms,micros,nanos)
2423

2524
# @option arguments [Boolean] :v Verbose mode. Display column headers
26-
25+
# @option arguments [Hash] :headers Custom HTTP headers
2726
#
2827
# @see http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-dfanalytics.html
2928
#
3029
def ml_data_frame_analytics(arguments = {})
30+
headers = arguments.delete(:headers) || {}
31+
3132
arguments = arguments.clone
3233

3334
_id = arguments.delete(:id)
@@ -37,11 +38,11 @@ def ml_data_frame_analytics(arguments = {})
3738
"_cat/ml/data_frame/analytics/#{Elasticsearch::API::Utils.__listify(_id)}"
3839
else
3940
"_cat/ml/data_frame/analytics"
40-
end
41+
end
4142
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
4243

4344
body = nil
44-
perform_request(method, path, params, body).body
45+
perform_request(method, path, params, body, headers).body
4546
end
4647

4748
# Register this action with its valid params when the module is loaded.

elasticsearch-xpack/lib/elasticsearch/xpack/api/actions/cat/ml_datafeeds.rb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ module XPack
77
module API
88
module Cat
99
module Actions
10-
# TODO: Description
11-
10+
# Gets configuration and usage information about datafeeds.
1211
#
1312
# @option arguments [String] :datafeed_id The ID of the datafeeds stats to fetch
1413
# @option arguments [Boolean] :allow_no_datafeeds Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified)
@@ -17,14 +16,16 @@ module Actions
1716
# @option arguments [Boolean] :help Return help information
1817
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
1918
# @option arguments [String] :time The unit in which to display time values
20-
# (options: d (Days),h (Hours),m (Minutes),s (Seconds),ms (Milliseconds),micros (Microseconds),nanos (Nanoseconds))
19+
# (options: d,h,m,s,ms,micros,nanos)
2120

2221
# @option arguments [Boolean] :v Verbose mode. Display column headers
23-
22+
# @option arguments [Hash] :headers Custom HTTP headers
2423
#
2524
# @see http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-datafeeds.html
2625
#
2726
def ml_datafeeds(arguments = {})
27+
headers = arguments.delete(:headers) || {}
28+
2829
arguments = arguments.clone
2930

3031
_datafeed_id = arguments.delete(:datafeed_id)
@@ -34,11 +35,11 @@ def ml_datafeeds(arguments = {})
3435
"_cat/ml/datafeeds/#{Elasticsearch::API::Utils.__listify(_datafeed_id)}"
3536
else
3637
"_cat/ml/datafeeds"
37-
end
38+
end
3839
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
3940

4041
body = nil
41-
perform_request(method, path, params, body).body
42+
perform_request(method, path, params, body, headers).body
4243
end
4344

4445
# Register this action with its valid params when the module is loaded.

elasticsearch-xpack/lib/elasticsearch/xpack/api/actions/cat/ml_jobs.rb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ module XPack
77
module API
88
module Cat
99
module Actions
10-
# TODO: Description
11-
10+
# Gets configuration and usage information about anomaly detection jobs.
1211
#
1312
# @option arguments [String] :job_id The ID of the jobs stats to fetch
1413
# @option arguments [Boolean] :allow_no_jobs Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified)
@@ -20,14 +19,16 @@ module Actions
2019
# @option arguments [Boolean] :help Return help information
2120
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
2221
# @option arguments [String] :time The unit in which to display time values
23-
# (options: d (Days),h (Hours),m (Minutes),s (Seconds),ms (Milliseconds),micros (Microseconds),nanos (Nanoseconds))
22+
# (options: d,h,m,s,ms,micros,nanos)
2423

2524
# @option arguments [Boolean] :v Verbose mode. Display column headers
26-
25+
# @option arguments [Hash] :headers Custom HTTP headers
2726
#
2827
# @see http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-anomaly-detectors.html
2928
#
3029
def ml_jobs(arguments = {})
30+
headers = arguments.delete(:headers) || {}
31+
3132
arguments = arguments.clone
3233

3334
_job_id = arguments.delete(:job_id)
@@ -37,11 +38,11 @@ def ml_jobs(arguments = {})
3738
"_cat/ml/anomaly_detectors/#{Elasticsearch::API::Utils.__listify(_job_id)}"
3839
else
3940
"_cat/ml/anomaly_detectors"
40-
end
41+
end
4142
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
4243

4344
body = nil
44-
perform_request(method, path, params, body).body
45+
perform_request(method, path, params, body, headers).body
4546
end
4647

4748
# Register this action with its valid params when the module is loaded.

elasticsearch-xpack/lib/elasticsearch/xpack/api/actions/cat/ml_trained_models.rb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ module XPack
77
module API
88
module Cat
99
module Actions
10-
# TODO: Description
11-
10+
# Gets configuration and usage information about inference trained models.
1211
#
1312
# @option arguments [String] :model_id The ID of the trained models stats to fetch
1413
# @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)
@@ -22,14 +21,16 @@ module Actions
2221
# @option arguments [Boolean] :help Return help information
2322
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
2423
# @option arguments [String] :time The unit in which to display time values
25-
# (options: d (Days),h (Hours),m (Minutes),s (Seconds),ms (Milliseconds),micros (Microseconds),nanos (Nanoseconds))
24+
# (options: d,h,m,s,ms,micros,nanos)
2625

2726
# @option arguments [Boolean] :v Verbose mode. Display column headers
28-
27+
# @option arguments [Hash] :headers Custom HTTP headers
2928
#
3029
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-trained-model.html
3130
#
3231
def ml_trained_models(arguments = {})
32+
headers = arguments.delete(:headers) || {}
33+
3334
arguments = arguments.clone
3435

3536
_model_id = arguments.delete(:model_id)
@@ -39,11 +40,11 @@ def ml_trained_models(arguments = {})
3940
"_cat/ml/trained_models/#{Elasticsearch::API::Utils.__listify(_model_id)}"
4041
else
4142
"_cat/ml/trained_models"
42-
end
43+
end
4344
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
4445

4546
body = nil
46-
perform_request(method, path, params, body).body
47+
perform_request(method, path, params, body, headers).body
4748
end
4849

4950
# Register this action with its valid params when the module is loaded.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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 Cat
9+
module Actions
10+
# Gets configuration and usage information about transforms.
11+
#
12+
# @option arguments [String] :transform_id The id of the transform for which to get stats. '_all' or '*' implies all transforms
13+
# @option arguments [Int] :from skips a number of transform configs, defaults to 0
14+
# @option arguments [Int] :size specifies a max number of transforms to get, defaults to 100
15+
# @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified)
16+
# @option arguments [String] :format a short version of the Accept header, e.g. json, yaml
17+
# @option arguments [List] :h Comma-separated list of column names to display
18+
# @option arguments [Boolean] :help Return help information
19+
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
20+
# @option arguments [String] :time The unit in which to display time values
21+
# (options: d,h,m,s,ms,micros,nanos)
22+
23+
# @option arguments [Boolean] :v Verbose mode. Display column headers
24+
# @option arguments [Hash] :headers Custom HTTP headers
25+
#
26+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-transforms.html
27+
#
28+
def transforms(arguments = {})
29+
headers = arguments.delete(:headers) || {}
30+
31+
arguments = arguments.clone
32+
33+
_transform_id = arguments.delete(:transform_id)
34+
35+
method = Elasticsearch::API::HTTP_GET
36+
path = if _transform_id
37+
"_cat/transforms/#{Elasticsearch::API::Utils.__listify(_transform_id)}"
38+
else
39+
"_cat/transforms"
40+
end
41+
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
42+
43+
body = nil
44+
perform_request(method, path, params, body, headers).body
45+
end
46+
47+
# Register this action with its valid params when the module is loaded.
48+
#
49+
# @since 6.2.0
50+
ParamsRegistry.register(:transforms, [
51+
:from,
52+
:size,
53+
:allow_no_match,
54+
:format,
55+
:h,
56+
:help,
57+
:s,
58+
:time,
59+
:v
60+
].freeze)
61+
end
62+
end
63+
end
64+
end
65+
end

elasticsearch-xpack/lib/elasticsearch/xpack/api/actions/data_frame_transform_deprecated/delete_transform.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ module XPack
77
module API
88
module DataFrameTransformDeprecated
99
module Actions
10-
# TODO: Description
11-
10+
# Deletes an existing transform.
1211
#
1312
# @option arguments [String] :transform_id The id of the transform to delete
1413
# @option arguments [Boolean] :force When `true`, the transform is deleted regardless of its current state. The default value is `false`, meaning that the transform must be `stopped` before it can be deleted.
15-
14+
# @option arguments [Hash] :headers Custom HTTP headers
1615
#
1716
# *Deprecation notice*:
1817
# [_data_frame/transforms/] is deprecated, use [_transform/] in the future.
@@ -24,6 +23,8 @@ module Actions
2423
def delete_transform(arguments = {})
2524
raise ArgumentError, "Required argument 'transform_id' missing" unless arguments[:transform_id]
2625

26+
headers = arguments.delete(:headers) || {}
27+
2728
arguments = arguments.clone
2829

2930
_transform_id = arguments.delete(:transform_id)
@@ -33,7 +34,7 @@ def delete_transform(arguments = {})
3334
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
3435

3536
body = nil
36-
perform_request(method, path, params, body).body
37+
perform_request(method, path, params, body, headers).body
3738
end
3839

3940
# Register this action with its valid params when the module is loaded.

0 commit comments

Comments
 (0)