elasticsearch-xpack 7.6.0 → 7.7.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/elasticsearch/xpack.rb +12 -0
- data/lib/elasticsearch/xpack/api/actions/async_search/delete.rb +37 -0
- data/lib/elasticsearch/xpack/api/actions/async_search/get.rb +49 -0
- data/lib/elasticsearch/xpack/api/actions/async_search/params_registry.rb +49 -0
- data/lib/elasticsearch/xpack/api/actions/async_search/submit.rb +136 -0
- data/lib/elasticsearch/xpack/api/actions/cat/ml_data_frame_analytics.rb +65 -0
- data/lib/elasticsearch/xpack/api/actions/cat/ml_datafeeds.rb +61 -0
- data/lib/elasticsearch/xpack/api/actions/cat/ml_jobs.rb +65 -0
- data/lib/elasticsearch/xpack/api/actions/cat/ml_trained_models.rb +69 -0
- data/lib/elasticsearch/xpack/api/actions/cat/params_registry.rb +49 -0
- data/lib/elasticsearch/xpack/api/actions/cat/transform.rb +64 -0
- data/lib/elasticsearch/xpack/api/actions/cat/transforms.rb +65 -0
- data/lib/elasticsearch/xpack/api/actions/data_frame_transform_deprecated/delete_transform.rb +5 -4
- data/lib/elasticsearch/xpack/api/actions/data_frame_transform_deprecated/get_transform.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/data_frame_transform_deprecated/get_transform_stats.rb +5 -4
- data/lib/elasticsearch/xpack/api/actions/data_frame_transform_deprecated/preview_transform.rb +6 -3
- data/lib/elasticsearch/xpack/api/actions/data_frame_transform_deprecated/put_transform.rb +5 -4
- data/lib/elasticsearch/xpack/api/actions/data_frame_transform_deprecated/start_transform.rb +5 -4
- data/lib/elasticsearch/xpack/api/actions/data_frame_transform_deprecated/stop_transform.rb +5 -4
- data/lib/elasticsearch/xpack/api/actions/data_frame_transform_deprecated/update_transform.rb +5 -4
- data/lib/elasticsearch/xpack/api/actions/graph/explore.rb +5 -4
- data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/delete_lifecycle.rb +5 -4
- data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/explain_lifecycle.rb +5 -4
- data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/get_lifecycle.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/get_status.rb +6 -3
- data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/move_to_step.rb +5 -4
- data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/put_lifecycle.rb +5 -4
- data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/remove_policy.rb +5 -4
- data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/retry.rb +5 -4
- data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/start.rb +6 -3
- data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/stop.rb +6 -3
- data/lib/elasticsearch/xpack/api/actions/info.rb +5 -4
- data/lib/elasticsearch/xpack/api/actions/license/delete.rb +6 -3
- data/lib/elasticsearch/xpack/api/actions/license/get.rb +5 -4
- data/lib/elasticsearch/xpack/api/actions/license/get_basic_status.rb +6 -3
- data/lib/elasticsearch/xpack/api/actions/license/get_trial_status.rb +6 -3
- data/lib/elasticsearch/xpack/api/actions/license/post.rb +5 -4
- data/lib/elasticsearch/xpack/api/actions/license/post_start_basic.rb +5 -4
- data/lib/elasticsearch/xpack/api/actions/license/post_start_trial.rb +5 -4
- data/lib/elasticsearch/xpack/api/actions/machine_learning/close_job.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/delete_calendar.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/delete_calendar_event.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/delete_calendar_job.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/delete_data_frame_analytics.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/delete_datafeed.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/delete_expired_data.rb +7 -4
- data/lib/elasticsearch/xpack/api/actions/machine_learning/delete_filter.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/delete_forecast.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/delete_job.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/delete_model_snapshot.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/delete_trained_model.rb +5 -4
- data/lib/elasticsearch/xpack/api/actions/machine_learning/estimate_model_memory.rb +35 -0
- data/lib/elasticsearch/xpack/api/actions/machine_learning/evaluate_data_frame.rb +7 -4
- data/lib/elasticsearch/xpack/api/actions/machine_learning/explain_data_frame_analytics.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/find_file_structure.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/flush_job.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/forecast.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/get_buckets.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/get_calendar_events.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/get_calendars.rb +7 -6
- data/lib/elasticsearch/xpack/api/actions/machine_learning/get_categories.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/get_data_frame_analytics.rb +7 -6
- data/lib/elasticsearch/xpack/api/actions/machine_learning/get_data_frame_analytics_stats.rb +7 -6
- data/lib/elasticsearch/xpack/api/actions/machine_learning/get_datafeed_stats.rb +7 -6
- data/lib/elasticsearch/xpack/api/actions/machine_learning/get_datafeeds.rb +7 -6
- data/lib/elasticsearch/xpack/api/actions/machine_learning/get_filters.rb +7 -6
- data/lib/elasticsearch/xpack/api/actions/machine_learning/get_influencers.rb +7 -6
- data/lib/elasticsearch/xpack/api/actions/machine_learning/get_job_stats.rb +7 -6
- data/lib/elasticsearch/xpack/api/actions/machine_learning/get_jobs.rb +7 -6
- data/lib/elasticsearch/xpack/api/actions/machine_learning/get_model_snapshots.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/get_overall_buckets.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/get_records.rb +8 -7
- data/lib/elasticsearch/xpack/api/actions/machine_learning/get_trained_models.rb +9 -6
- data/lib/elasticsearch/xpack/api/actions/machine_learning/get_trained_models_stats.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/info.rb +7 -4
- data/lib/elasticsearch/xpack/api/actions/machine_learning/open_job.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/post_calendar_events.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/post_data.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/preview_datafeed.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/put_calendar.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/put_calendar_job.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/put_data_frame_analytics.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/put_datafeed.rb +22 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/put_filter.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/put_job.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/put_trained_model.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/revert_model_snapshot.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/set_upgrade_mode.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/start_data_frame_analytics.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/start_datafeed.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/stop_data_frame_analytics.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/stop_datafeed.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/update_datafeed.rb +22 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/update_filter.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/update_job.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/update_model_snapshot.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/validate.rb +6 -3
- data/lib/elasticsearch/xpack/api/actions/machine_learning/validate_detector.rb +6 -3
- data/lib/elasticsearch/xpack/api/actions/migration/deprecations.rb +7 -6
- data/lib/elasticsearch/xpack/api/actions/monitoring/bulk.rb +6 -4
- data/lib/elasticsearch/xpack/api/actions/rollup/delete_job.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/rollup/get_jobs.rb +7 -6
- data/lib/elasticsearch/xpack/api/actions/rollup/get_rollup_caps.rb +7 -6
- data/lib/elasticsearch/xpack/api/actions/rollup/get_rollup_index_caps.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/rollup/put_job.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/rollup/rollup_search.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/rollup/start_job.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/rollup/stop_job.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/security/authenticate.rb +6 -3
- data/lib/elasticsearch/xpack/api/actions/security/change_password.rb +5 -3
- data/lib/elasticsearch/xpack/api/actions/security/clear_cached_realms.rb +5 -4
- data/lib/elasticsearch/xpack/api/actions/security/clear_cached_roles.rb +5 -4
- data/lib/elasticsearch/xpack/api/actions/security/create_api_key.rb +5 -3
- data/lib/elasticsearch/xpack/api/actions/security/delete_privileges.rb +6 -4
- data/lib/elasticsearch/xpack/api/actions/security/delete_role.rb +5 -3
- data/lib/elasticsearch/xpack/api/actions/security/delete_role_mapping.rb +5 -3
- data/lib/elasticsearch/xpack/api/actions/security/delete_user.rb +5 -3
- data/lib/elasticsearch/xpack/api/actions/security/disable_user.rb +5 -3
- data/lib/elasticsearch/xpack/api/actions/security/enable_user.rb +5 -3
- data/lib/elasticsearch/xpack/api/actions/security/get_api_key.rb +5 -4
- data/lib/elasticsearch/xpack/api/actions/security/get_builtin_privileges.rb +6 -3
- data/lib/elasticsearch/xpack/api/actions/security/get_privileges.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/security/get_role.rb +7 -6
- data/lib/elasticsearch/xpack/api/actions/security/get_role_mapping.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/security/get_token.rb +6 -3
- data/lib/elasticsearch/xpack/api/actions/security/get_user.rb +7 -6
- data/lib/elasticsearch/xpack/api/actions/security/get_user_privileges.rb +6 -3
- data/lib/elasticsearch/xpack/api/actions/security/has_privileges.rb +5 -4
- data/lib/elasticsearch/xpack/api/actions/security/invalidate_api_key.rb +6 -3
- data/lib/elasticsearch/xpack/api/actions/security/invalidate_token.rb +6 -3
- data/lib/elasticsearch/xpack/api/actions/security/put_privileges.rb +6 -4
- data/lib/elasticsearch/xpack/api/actions/security/put_role.rb +5 -3
- data/lib/elasticsearch/xpack/api/actions/security/put_role_mapping.rb +5 -3
- data/lib/elasticsearch/xpack/api/actions/security/put_user.rb +5 -3
- data/lib/elasticsearch/xpack/api/actions/sql/clear_cursor.rb +7 -4
- data/lib/elasticsearch/xpack/api/actions/sql/query.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/sql/translate.rb +7 -4
- data/lib/elasticsearch/xpack/api/actions/ssl/certificates.rb +6 -3
- data/lib/elasticsearch/xpack/api/actions/transform/delete_transform.rb +45 -0
- data/lib/elasticsearch/xpack/api/actions/transform/get_transform.rb +51 -0
- data/lib/elasticsearch/xpack/api/actions/transform/get_transform_stats.rb +49 -0
- data/lib/elasticsearch/xpack/api/actions/transform/params_registry.rb +49 -0
- data/lib/elasticsearch/xpack/api/actions/transform/preview_transform.rb +35 -0
- data/lib/elasticsearch/xpack/api/actions/transform/put_transform.rb +47 -0
- data/lib/elasticsearch/xpack/api/actions/transform/start_transform.rb +45 -0
- data/lib/elasticsearch/xpack/api/actions/transform/stop_transform.rb +53 -0
- data/lib/elasticsearch/xpack/api/actions/transform/update_transform.rb +47 -0
- data/lib/elasticsearch/xpack/api/actions/usage.rb +5 -4
- data/lib/elasticsearch/xpack/api/actions/watcher/ack_watch.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/watcher/activate_watch.rb +5 -4
- data/lib/elasticsearch/xpack/api/actions/watcher/deactivate_watch.rb +5 -4
- data/lib/elasticsearch/xpack/api/actions/watcher/delete_watch.rb +7 -6
- data/lib/elasticsearch/xpack/api/actions/watcher/execute_watch.rb +7 -6
- data/lib/elasticsearch/xpack/api/actions/watcher/get_watch.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/watcher/put_watch.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/watcher/start.rb +7 -4
- data/lib/elasticsearch/xpack/api/actions/watcher/stats.rb +7 -6
- data/lib/elasticsearch/xpack/api/actions/watcher/stop.rb +7 -4
- data/lib/elasticsearch/xpack/api/namespace/async_search.rb +22 -0
- data/lib/elasticsearch/xpack/api/namespace/cat.rb +21 -0
- data/lib/elasticsearch/xpack/api/namespace/transform.rb +22 -0
- data/lib/elasticsearch/xpack/version.rb +1 -1
- metadata +28 -4
@@ -0,0 +1,49 @@
|
|
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 Transform
|
9
|
+
module Actions
|
10
|
+
module ParamsRegistry
|
11
|
+
extend self
|
12
|
+
|
13
|
+
# A Mapping of all the actions to their list of valid params.
|
14
|
+
#
|
15
|
+
# @since 7.4.0
|
16
|
+
PARAMS = {}
|
17
|
+
|
18
|
+
# Register an action with its list of valid params.
|
19
|
+
#
|
20
|
+
# @example Register the action.
|
21
|
+
# ParamsRegistry.register(:benchmark, [ :verbose ])
|
22
|
+
#
|
23
|
+
# @param [ Symbol ] action The action to register.
|
24
|
+
# @param [ Array[Symbol] ] valid_params The list of valid params.
|
25
|
+
#
|
26
|
+
# @since 7.4.0
|
27
|
+
def register(action, valid_params)
|
28
|
+
PARAMS[action.to_sym] = valid_params
|
29
|
+
end
|
30
|
+
|
31
|
+
# Get the list of valid params for a given action.
|
32
|
+
#
|
33
|
+
# @example Get the list of valid params.
|
34
|
+
# ParamsRegistry.get(:benchmark)
|
35
|
+
#
|
36
|
+
# @param [ Symbol ] action The action.
|
37
|
+
#
|
38
|
+
# @return [ Array<Symbol> ] The list of valid params for the action.
|
39
|
+
#
|
40
|
+
# @since 7.4.0
|
41
|
+
def get(action)
|
42
|
+
PARAMS.fetch(action, [])
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,35 @@
|
|
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 Transform
|
9
|
+
module Actions
|
10
|
+
# Previews a transform.
|
11
|
+
#
|
12
|
+
# @option arguments [Hash] :headers Custom HTTP headers
|
13
|
+
# @option arguments [Hash] :body The definition for the transform to preview (*Required*)
|
14
|
+
#
|
15
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-transform.html
|
16
|
+
#
|
17
|
+
def preview_transform(arguments = {})
|
18
|
+
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
|
19
|
+
|
20
|
+
headers = arguments.delete(:headers) || {}
|
21
|
+
|
22
|
+
arguments = arguments.clone
|
23
|
+
|
24
|
+
method = Elasticsearch::API::HTTP_POST
|
25
|
+
path = "_transform/_preview"
|
26
|
+
params = {}
|
27
|
+
|
28
|
+
body = arguments[:body]
|
29
|
+
perform_request(method, path, params, body, headers).body
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,47 @@
|
|
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 Transform
|
9
|
+
module Actions
|
10
|
+
# Instantiates a transform.
|
11
|
+
#
|
12
|
+
# @option arguments [String] :transform_id The id of the new transform.
|
13
|
+
# @option arguments [Boolean] :defer_validation If validations should be deferred until transform starts, defaults to false.
|
14
|
+
# @option arguments [Hash] :headers Custom HTTP headers
|
15
|
+
# @option arguments [Hash] :body The transform definition (*Required*)
|
16
|
+
#
|
17
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html
|
18
|
+
#
|
19
|
+
def put_transform(arguments = {})
|
20
|
+
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
|
21
|
+
raise ArgumentError, "Required argument 'transform_id' missing" unless arguments[:transform_id]
|
22
|
+
|
23
|
+
headers = arguments.delete(:headers) || {}
|
24
|
+
|
25
|
+
arguments = arguments.clone
|
26
|
+
|
27
|
+
_transform_id = arguments.delete(:transform_id)
|
28
|
+
|
29
|
+
method = Elasticsearch::API::HTTP_PUT
|
30
|
+
path = "_transform/#{Elasticsearch::API::Utils.__listify(_transform_id)}"
|
31
|
+
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
32
|
+
|
33
|
+
body = arguments[:body]
|
34
|
+
perform_request(method, path, params, body, headers).body
|
35
|
+
end
|
36
|
+
|
37
|
+
# Register this action with its valid params when the module is loaded.
|
38
|
+
#
|
39
|
+
# @since 6.2.0
|
40
|
+
ParamsRegistry.register(:put_transform, [
|
41
|
+
:defer_validation
|
42
|
+
].freeze)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,45 @@
|
|
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 Transform
|
9
|
+
module Actions
|
10
|
+
# Starts one or more transforms.
|
11
|
+
#
|
12
|
+
# @option arguments [String] :transform_id The id of the transform to start
|
13
|
+
# @option arguments [Time] :timeout Controls the time to wait for the transform to start
|
14
|
+
# @option arguments [Hash] :headers Custom HTTP headers
|
15
|
+
#
|
16
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html
|
17
|
+
#
|
18
|
+
def start_transform(arguments = {})
|
19
|
+
raise ArgumentError, "Required argument 'transform_id' missing" unless arguments[:transform_id]
|
20
|
+
|
21
|
+
headers = arguments.delete(:headers) || {}
|
22
|
+
|
23
|
+
arguments = arguments.clone
|
24
|
+
|
25
|
+
_transform_id = arguments.delete(:transform_id)
|
26
|
+
|
27
|
+
method = Elasticsearch::API::HTTP_POST
|
28
|
+
path = "_transform/#{Elasticsearch::API::Utils.__listify(_transform_id)}/_start"
|
29
|
+
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
30
|
+
|
31
|
+
body = nil
|
32
|
+
perform_request(method, path, params, body, headers).body
|
33
|
+
end
|
34
|
+
|
35
|
+
# Register this action with its valid params when the module is loaded.
|
36
|
+
#
|
37
|
+
# @since 6.2.0
|
38
|
+
ParamsRegistry.register(:start_transform, [
|
39
|
+
:timeout
|
40
|
+
].freeze)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,53 @@
|
|
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 Transform
|
9
|
+
module Actions
|
10
|
+
# Stops one or more transforms.
|
11
|
+
#
|
12
|
+
# @option arguments [String] :transform_id The id of the transform to stop
|
13
|
+
# @option arguments [Boolean] :force Whether to force stop a failed transform or not. Default to false
|
14
|
+
# @option arguments [Boolean] :wait_for_completion Whether to wait for the transform to fully stop before returning or not. Default to false
|
15
|
+
# @option arguments [Time] :timeout Controls the time to wait until the transform has stopped. Default to 30 seconds
|
16
|
+
# @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)
|
17
|
+
# @option arguments [Boolean] :wait_for_checkpoint Whether to wait for the transform to reach a checkpoint before stopping. Default to false
|
18
|
+
# @option arguments [Hash] :headers Custom HTTP headers
|
19
|
+
#
|
20
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-transform.html
|
21
|
+
#
|
22
|
+
def stop_transform(arguments = {})
|
23
|
+
raise ArgumentError, "Required argument 'transform_id' missing" unless arguments[:transform_id]
|
24
|
+
|
25
|
+
headers = arguments.delete(:headers) || {}
|
26
|
+
|
27
|
+
arguments = arguments.clone
|
28
|
+
|
29
|
+
_transform_id = arguments.delete(:transform_id)
|
30
|
+
|
31
|
+
method = Elasticsearch::API::HTTP_POST
|
32
|
+
path = "_transform/#{Elasticsearch::API::Utils.__listify(_transform_id)}/_stop"
|
33
|
+
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
34
|
+
|
35
|
+
body = nil
|
36
|
+
perform_request(method, path, params, body, headers).body
|
37
|
+
end
|
38
|
+
|
39
|
+
# Register this action with its valid params when the module is loaded.
|
40
|
+
#
|
41
|
+
# @since 6.2.0
|
42
|
+
ParamsRegistry.register(:stop_transform, [
|
43
|
+
:force,
|
44
|
+
:wait_for_completion,
|
45
|
+
:timeout,
|
46
|
+
:allow_no_match,
|
47
|
+
:wait_for_checkpoint
|
48
|
+
].freeze)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,47 @@
|
|
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 Transform
|
9
|
+
module Actions
|
10
|
+
# Updates certain properties of a transform.
|
11
|
+
#
|
12
|
+
# @option arguments [String] :transform_id The id of the transform. (*Required*)
|
13
|
+
# @option arguments [Boolean] :defer_validation If validations should be deferred until transform starts, defaults to false.
|
14
|
+
# @option arguments [Hash] :headers Custom HTTP headers
|
15
|
+
# @option arguments [Hash] :body The update transform definition (*Required*)
|
16
|
+
#
|
17
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html
|
18
|
+
#
|
19
|
+
def update_transform(arguments = {})
|
20
|
+
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
|
21
|
+
raise ArgumentError, "Required argument 'transform_id' missing" unless arguments[:transform_id]
|
22
|
+
|
23
|
+
headers = arguments.delete(:headers) || {}
|
24
|
+
|
25
|
+
arguments = arguments.clone
|
26
|
+
|
27
|
+
_transform_id = arguments.delete(:transform_id)
|
28
|
+
|
29
|
+
method = Elasticsearch::API::HTTP_POST
|
30
|
+
path = "_transform/#{Elasticsearch::API::Utils.__listify(_transform_id)}/_update"
|
31
|
+
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
32
|
+
|
33
|
+
body = arguments[:body]
|
34
|
+
perform_request(method, path, params, body, headers).body
|
35
|
+
end
|
36
|
+
|
37
|
+
# Register this action with its valid params when the module is loaded.
|
38
|
+
#
|
39
|
+
# @since 6.2.0
|
40
|
+
ParamsRegistry.register(:update_transform, [
|
41
|
+
:defer_validation
|
42
|
+
].freeze)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -6,15 +6,16 @@ module Elasticsearch
|
|
6
6
|
module XPack
|
7
7
|
module API
|
8
8
|
module Actions
|
9
|
-
#
|
10
|
-
|
9
|
+
# Retrieves usage information about the installed X-Pack features.
|
11
10
|
#
|
12
11
|
# @option arguments [Time] :master_timeout Specify timeout for watch write operation
|
13
|
-
|
12
|
+
# @option arguments [Hash] :headers Custom HTTP headers
|
14
13
|
#
|
15
14
|
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/usage-api.html
|
16
15
|
#
|
17
16
|
def usage(arguments = {})
|
17
|
+
headers = arguments.delete(:headers) || {}
|
18
|
+
|
18
19
|
arguments = arguments.clone
|
19
20
|
|
20
21
|
method = Elasticsearch::API::HTTP_GET
|
@@ -22,7 +23,7 @@ module Elasticsearch
|
|
22
23
|
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
23
24
|
|
24
25
|
body = nil
|
25
|
-
perform_request(method, path, params, body).body
|
26
|
+
perform_request(method, path, params, body, headers).body
|
26
27
|
end
|
27
28
|
|
28
29
|
# Register this action with its valid params when the module is loaded.
|
@@ -7,18 +7,19 @@ module Elasticsearch
|
|
7
7
|
module API
|
8
8
|
module Watcher
|
9
9
|
module Actions
|
10
|
-
#
|
11
|
-
|
10
|
+
# Acknowledges a watch, manually throttling the execution of the watch's actions.
|
12
11
|
#
|
13
12
|
# @option arguments [String] :watch_id Watch ID
|
14
13
|
# @option arguments [List] :action_id A comma-separated list of the action ids to be acked
|
15
|
-
|
14
|
+
# @option arguments [Hash] :headers Custom HTTP headers
|
16
15
|
#
|
17
|
-
# @see
|
16
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html
|
18
17
|
#
|
19
18
|
def ack_watch(arguments = {})
|
20
19
|
raise ArgumentError, "Required argument 'watch_id' missing" unless arguments[:watch_id]
|
21
20
|
|
21
|
+
headers = arguments.delete(:headers) || {}
|
22
|
+
|
22
23
|
arguments = arguments.clone
|
23
24
|
|
24
25
|
_watch_id = arguments.delete(:watch_id)
|
@@ -34,7 +35,7 @@ module Elasticsearch
|
|
34
35
|
params = {}
|
35
36
|
|
36
37
|
body = nil
|
37
|
-
perform_request(method, path, params, body).body
|
38
|
+
perform_request(method, path, params, body, headers).body
|
38
39
|
end
|
39
40
|
end
|
40
41
|
end
|
@@ -7,17 +7,18 @@ module Elasticsearch
|
|
7
7
|
module API
|
8
8
|
module Watcher
|
9
9
|
module Actions
|
10
|
-
#
|
11
|
-
|
10
|
+
# Activates a currently inactive watch.
|
12
11
|
#
|
13
12
|
# @option arguments [String] :watch_id Watch ID
|
14
|
-
|
13
|
+
# @option arguments [Hash] :headers Custom HTTP headers
|
15
14
|
#
|
16
15
|
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html
|
17
16
|
#
|
18
17
|
def activate_watch(arguments = {})
|
19
18
|
raise ArgumentError, "Required argument 'watch_id' missing" unless arguments[:watch_id]
|
20
19
|
|
20
|
+
headers = arguments.delete(:headers) || {}
|
21
|
+
|
21
22
|
arguments = arguments.clone
|
22
23
|
|
23
24
|
_watch_id = arguments.delete(:watch_id)
|
@@ -27,7 +28,7 @@ module Elasticsearch
|
|
27
28
|
params = {}
|
28
29
|
|
29
30
|
body = nil
|
30
|
-
perform_request(method, path, params, body).body
|
31
|
+
perform_request(method, path, params, body, headers).body
|
31
32
|
end
|
32
33
|
end
|
33
34
|
end
|
@@ -7,17 +7,18 @@ module Elasticsearch
|
|
7
7
|
module API
|
8
8
|
module Watcher
|
9
9
|
module Actions
|
10
|
-
#
|
11
|
-
|
10
|
+
# Deactivates a currently active watch.
|
12
11
|
#
|
13
12
|
# @option arguments [String] :watch_id Watch ID
|
14
|
-
|
13
|
+
# @option arguments [Hash] :headers Custom HTTP headers
|
15
14
|
#
|
16
15
|
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-deactivate-watch.html
|
17
16
|
#
|
18
17
|
def deactivate_watch(arguments = {})
|
19
18
|
raise ArgumentError, "Required argument 'watch_id' missing" unless arguments[:watch_id]
|
20
19
|
|
20
|
+
headers = arguments.delete(:headers) || {}
|
21
|
+
|
21
22
|
arguments = arguments.clone
|
22
23
|
|
23
24
|
_watch_id = arguments.delete(:watch_id)
|
@@ -27,7 +28,7 @@ module Elasticsearch
|
|
27
28
|
params = {}
|
28
29
|
|
29
30
|
body = nil
|
30
|
-
perform_request(method, path, params, body).body
|
31
|
+
perform_request(method, path, params, body, headers).body
|
31
32
|
end
|
32
33
|
end
|
33
34
|
end
|
@@ -7,17 +7,18 @@ module Elasticsearch
|
|
7
7
|
module API
|
8
8
|
module Watcher
|
9
9
|
module Actions
|
10
|
-
#
|
11
|
-
|
10
|
+
# Removes a watch from Watcher.
|
12
11
|
#
|
13
12
|
# @option arguments [String] :id Watch ID
|
14
|
-
|
13
|
+
# @option arguments [Hash] :headers Custom HTTP headers
|
15
14
|
#
|
16
|
-
# @see
|
15
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html
|
17
16
|
#
|
18
17
|
def delete_watch(arguments = {})
|
19
18
|
raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
|
20
19
|
|
20
|
+
headers = arguments.delete(:headers) || {}
|
21
|
+
|
21
22
|
arguments = arguments.clone
|
22
23
|
|
23
24
|
_id = arguments.delete(:id)
|
@@ -28,9 +29,9 @@ module Elasticsearch
|
|
28
29
|
|
29
30
|
body = nil
|
30
31
|
if Array(arguments[:ignore]).include?(404)
|
31
|
-
Elasticsearch::API::Utils.__rescue_from_not_found { perform_request(method, path, params, body).body }
|
32
|
+
Elasticsearch::API::Utils.__rescue_from_not_found { perform_request(method, path, params, body, headers).body }
|
32
33
|
else
|
33
|
-
perform_request(method, path, params, body).body
|
34
|
+
perform_request(method, path, params, body, headers).body
|
34
35
|
end
|
35
36
|
end
|
36
37
|
end
|
@@ -7,17 +7,18 @@ module Elasticsearch
|
|
7
7
|
module API
|
8
8
|
module Watcher
|
9
9
|
module Actions
|
10
|
-
#
|
11
|
-
|
10
|
+
# Forces the execution of a stored watch.
|
12
11
|
#
|
13
12
|
# @option arguments [String] :id Watch ID
|
14
13
|
# @option arguments [Boolean] :debug indicates whether the watch should execute in debug mode
|
15
|
-
|
14
|
+
# @option arguments [Hash] :headers Custom HTTP headers
|
16
15
|
# @option arguments [Hash] :body Execution control
|
17
16
|
#
|
18
|
-
# @see
|
17
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html
|
19
18
|
#
|
20
19
|
def execute_watch(arguments = {})
|
20
|
+
headers = arguments.delete(:headers) || {}
|
21
|
+
|
21
22
|
arguments = arguments.clone
|
22
23
|
|
23
24
|
_id = arguments.delete(:id)
|
@@ -27,11 +28,11 @@ module Elasticsearch
|
|
27
28
|
"_watcher/watch/#{Elasticsearch::API::Utils.__listify(_id)}/_execute"
|
28
29
|
else
|
29
30
|
"_watcher/watch/_execute"
|
30
|
-
|
31
|
+
end
|
31
32
|
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
32
33
|
|
33
34
|
body = arguments[:body]
|
34
|
-
perform_request(method, path, params, body).body
|
35
|
+
perform_request(method, path, params, body, headers).body
|
35
36
|
end
|
36
37
|
|
37
38
|
# Register this action with its valid params when the module is loaded.
|