elasticsearch-xpack 7.3.0 → 7.4.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.
- checksums.yaml +4 -4
- data/lib/elasticsearch/xpack.rb +7 -1
- data/lib/elasticsearch/xpack/api/actions/data_frame/delete_data_frame_transform.rb +10 -2
- data/lib/elasticsearch/xpack/api/actions/data_frame/get_data_frame_transform.rb +8 -6
- data/lib/elasticsearch/xpack/api/actions/data_frame/get_data_frame_transform_stats.rb +7 -5
- data/lib/elasticsearch/xpack/api/actions/data_frame/params_registry.rb +50 -0
- data/lib/elasticsearch/xpack/api/actions/data_frame/put_data_frame_transform.rb +10 -2
- data/lib/elasticsearch/xpack/api/actions/data_frame/start_data_frame_transform.rb +6 -4
- data/lib/elasticsearch/xpack/api/actions/data_frame/stop_data_frame_transform.rb +9 -6
- data/lib/elasticsearch/xpack/api/actions/data_frame/update_data_frame_transform.rb +45 -0
- data/lib/elasticsearch/xpack/api/actions/graph/explore.rb +7 -5
- data/lib/elasticsearch/xpack/api/actions/graph/params_registry.rb +50 -0
- data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/delete_policy.rb +39 -0
- data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/explain.rb +40 -0
- data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/get_policy.rb +38 -0
- data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/get_status.rb +36 -0
- data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/move_to_step.rb +41 -0
- data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/params_registry.rb +50 -0
- data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/put_policy.rb +40 -0
- data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/remove_policy.rb +38 -0
- data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/retry_policy.rb +38 -0
- data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/start.rb +36 -0
- data/lib/elasticsearch/xpack/api/actions/index_lifecycle_management/stop.rb +36 -0
- data/lib/elasticsearch/xpack/api/actions/info.rb +7 -5
- data/lib/elasticsearch/xpack/api/actions/license/get.rb +6 -2
- data/lib/elasticsearch/xpack/api/actions/license/params_registry.rb +50 -0
- data/lib/elasticsearch/xpack/api/actions/license/post.rb +6 -2
- data/lib/elasticsearch/xpack/api/actions/license/post_start_basic.rb +6 -3
- data/lib/elasticsearch/xpack/api/actions/license/post_start_trial.rb +7 -4
- data/lib/elasticsearch/xpack/api/actions/machine_learning/close_job.rb +8 -5
- data/lib/elasticsearch/xpack/api/actions/machine_learning/delete_datafeed.rb +6 -3
- data/lib/elasticsearch/xpack/api/actions/machine_learning/delete_forecast.rb +8 -6
- data/lib/elasticsearch/xpack/api/actions/machine_learning/delete_job.rb +6 -3
- data/lib/elasticsearch/xpack/api/actions/machine_learning/estimate_memory_usage.rb +30 -0
- data/lib/elasticsearch/xpack/api/actions/machine_learning/flush_job.rb +10 -7
- data/lib/elasticsearch/xpack/api/actions/machine_learning/forecast.rb +7 -4
- data/lib/elasticsearch/xpack/api/actions/machine_learning/get_buckets.rb +15 -13
- data/lib/elasticsearch/xpack/api/actions/machine_learning/get_calendar_events.rb +11 -9
- data/lib/elasticsearch/xpack/api/actions/machine_learning/get_calendars.rb +8 -6
- data/lib/elasticsearch/xpack/api/actions/machine_learning/get_categories.rb +7 -4
- data/lib/elasticsearch/xpack/api/actions/machine_learning/get_datafeed_stats.rb +6 -4
- data/lib/elasticsearch/xpack/api/actions/machine_learning/get_datafeeds.rb +6 -4
- data/lib/elasticsearch/xpack/api/actions/machine_learning/get_filters.rb +7 -4
- data/lib/elasticsearch/xpack/api/actions/machine_learning/get_influencers.rb +13 -10
- data/lib/elasticsearch/xpack/api/actions/machine_learning/get_job_stats.rb +6 -4
- data/lib/elasticsearch/xpack/api/actions/machine_learning/get_jobs.rb +6 -4
- data/lib/elasticsearch/xpack/api/actions/machine_learning/get_model_snapshots.rb +11 -8
- data/lib/elasticsearch/xpack/api/actions/machine_learning/get_overall_buckets.rb +12 -11
- data/lib/elasticsearch/xpack/api/actions/machine_learning/get_records.rb +13 -12
- data/lib/elasticsearch/xpack/api/actions/machine_learning/params_registry.rb +50 -0
- data/lib/elasticsearch/xpack/api/actions/machine_learning/post_data.rb +7 -4
- 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 +8 -6
- data/lib/elasticsearch/xpack/api/actions/machine_learning/start_datafeed.rb +8 -7
- data/lib/elasticsearch/xpack/api/actions/machine_learning/stop_datafeed.rb +8 -5
- data/lib/elasticsearch/xpack/api/actions/migration/get_assistance.rb +8 -6
- data/lib/elasticsearch/xpack/api/actions/migration/params_registry.rb +50 -0
- data/lib/elasticsearch/xpack/api/actions/migration/upgrade.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/monitoring/bulk.rb +9 -8
- data/lib/elasticsearch/xpack/api/actions/monitoring/params_registry.rb +50 -0
- data/lib/elasticsearch/xpack/api/actions/params_registry.rb +48 -0
- data/lib/elasticsearch/xpack/api/actions/rollup/params_registry.rb +50 -0
- data/lib/elasticsearch/xpack/api/actions/rollup/rollup_search.rb +7 -3
- data/lib/elasticsearch/xpack/api/actions/security/authenticate.rb +0 -1
- data/lib/elasticsearch/xpack/api/actions/security/change_password.rb +6 -4
- data/lib/elasticsearch/xpack/api/actions/security/clear_cached_realms.rb +6 -4
- data/lib/elasticsearch/xpack/api/actions/security/create_api_key.rb +6 -4
- data/lib/elasticsearch/xpack/api/actions/security/delete_privileges.rb +6 -3
- data/lib/elasticsearch/xpack/api/actions/security/delete_role.rb +6 -4
- data/lib/elasticsearch/xpack/api/actions/security/delete_role_mapping.rb +7 -5
- data/lib/elasticsearch/xpack/api/actions/security/delete_user.rb +7 -5
- data/lib/elasticsearch/xpack/api/actions/security/disable_user.rb +10 -6
- data/lib/elasticsearch/xpack/api/actions/security/enable_user.rb +10 -6
- data/lib/elasticsearch/xpack/api/actions/security/get_api_key.rb +9 -7
- data/lib/elasticsearch/xpack/api/actions/security/params_registry.rb +50 -0
- data/lib/elasticsearch/xpack/api/actions/security/put_privileges.rb +6 -4
- data/lib/elasticsearch/xpack/api/actions/security/put_role.rb +6 -4
- data/lib/elasticsearch/xpack/api/actions/security/put_role_mapping.rb +10 -6
- data/lib/elasticsearch/xpack/api/actions/security/put_user.rb +6 -4
- data/lib/elasticsearch/xpack/api/actions/sql/params_registry.rb +50 -0
- data/lib/elasticsearch/xpack/api/actions/sql/query.rb +6 -3
- data/lib/elasticsearch/xpack/api/actions/ssl/params_registry.rb +50 -0
- data/lib/elasticsearch/xpack/api/actions/usage.rb +7 -2
- data/lib/elasticsearch/xpack/api/actions/watcher/ack_watch.rb +6 -5
- data/lib/elasticsearch/xpack/api/actions/watcher/activate_watch.rb +6 -3
- data/lib/elasticsearch/xpack/api/actions/watcher/deactivate_watch.rb +6 -3
- data/lib/elasticsearch/xpack/api/actions/watcher/delete_watch.rb +7 -4
- data/lib/elasticsearch/xpack/api/actions/watcher/execute_watch.rb +6 -2
- data/lib/elasticsearch/xpack/api/actions/watcher/params_registry.rb +50 -0
- data/lib/elasticsearch/xpack/api/actions/watcher/put_watch.rb +10 -9
- data/lib/elasticsearch/xpack/api/actions/watcher/stats.rb +7 -2
- data/lib/elasticsearch/xpack/api/namespace/index_lifecycle_management.rb +22 -0
- data/lib/elasticsearch/xpack/version.rb +1 -1
- metadata +29 -3
|
@@ -17,17 +17,18 @@ module Elasticsearch
|
|
|
17
17
|
#
|
|
18
18
|
def upgrade(arguments={})
|
|
19
19
|
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
|
|
20
|
-
|
|
21
|
-
valid_params = [
|
|
22
|
-
:wait_for_completion ]
|
|
23
|
-
|
|
24
20
|
method = Elasticsearch::API::HTTP_POST
|
|
25
21
|
path = Elasticsearch::API::Utils.__pathify "_xpack/migration/upgrade", arguments[:index]
|
|
26
|
-
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments,
|
|
22
|
+
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
|
27
23
|
body = nil
|
|
28
24
|
|
|
29
25
|
perform_request(method, path, params, body).body
|
|
30
26
|
end
|
|
27
|
+
|
|
28
|
+
# Register this action with its valid params when the module is loaded.
|
|
29
|
+
#
|
|
30
|
+
# @since 7.4.0
|
|
31
|
+
ParamsRegistry.register(:upgrade, [ :wait_for_completion ].freeze)
|
|
31
32
|
end
|
|
32
33
|
end
|
|
33
34
|
end
|
|
@@ -20,20 +20,13 @@ module Elasticsearch
|
|
|
20
20
|
#
|
|
21
21
|
def bulk(arguments={})
|
|
22
22
|
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
|
|
23
|
-
|
|
24
|
-
valid_params = [
|
|
25
|
-
:system_id,
|
|
26
|
-
:system_api_version,
|
|
27
|
-
:system_version,
|
|
28
|
-
:interval ]
|
|
29
|
-
|
|
30
23
|
arguments = arguments.clone
|
|
31
24
|
type = arguments.delete(:type)
|
|
32
25
|
body = arguments.delete(:body)
|
|
33
26
|
|
|
34
27
|
method = Elasticsearch::API::HTTP_POST
|
|
35
28
|
path = Elasticsearch::API::Utils.__pathify '_xpack/monitoring', type, '_bulk'
|
|
36
|
-
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments,
|
|
29
|
+
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
|
37
30
|
|
|
38
31
|
if body.is_a? Array
|
|
39
32
|
payload = Elasticsearch::API::Utils.__bulkify(body)
|
|
@@ -43,6 +36,14 @@ module Elasticsearch
|
|
|
43
36
|
|
|
44
37
|
perform_request(method, path, params, payload).body
|
|
45
38
|
end
|
|
39
|
+
|
|
40
|
+
# Register this action with its valid params when the module is loaded.
|
|
41
|
+
#
|
|
42
|
+
# @since 7.4.0
|
|
43
|
+
ParamsRegistry.register(:bulk, [ :system_id,
|
|
44
|
+
:system_api_version,
|
|
45
|
+
:system_version,
|
|
46
|
+
:interval ].freeze)
|
|
46
47
|
end
|
|
47
48
|
end
|
|
48
49
|
end
|
|
@@ -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 Monitoring
|
|
9
|
+
module Actions
|
|
10
|
+
module ParamsRegistry
|
|
11
|
+
|
|
12
|
+
extend self
|
|
13
|
+
|
|
14
|
+
# A Mapping of all the actions to their list of valid params.
|
|
15
|
+
#
|
|
16
|
+
# @since 7.4.0
|
|
17
|
+
PARAMS = {}
|
|
18
|
+
|
|
19
|
+
# Register an action with its list of valid params.
|
|
20
|
+
#
|
|
21
|
+
# @example Register the action.
|
|
22
|
+
# ParamsRegistry.register(:benchmark, [ :verbose ])
|
|
23
|
+
#
|
|
24
|
+
# @param [ Symbol ] action The action to register.
|
|
25
|
+
# @param [ Array[Symbol] ] valid_params The list of valid params.
|
|
26
|
+
#
|
|
27
|
+
# @since 7.4.0
|
|
28
|
+
def register(action, valid_params)
|
|
29
|
+
PARAMS[action.to_sym] = valid_params
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Get the list of valid params for a given action.
|
|
33
|
+
#
|
|
34
|
+
# @example Get the list of valid params.
|
|
35
|
+
# ParamsRegistry.get(:benchmark)
|
|
36
|
+
#
|
|
37
|
+
# @param [ Symbol ] action The action.
|
|
38
|
+
#
|
|
39
|
+
# @return [ Array<Symbol> ] The list of valid params for the action.
|
|
40
|
+
#
|
|
41
|
+
# @since 7.4.0
|
|
42
|
+
def get(action)
|
|
43
|
+
PARAMS.fetch(action, [])
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
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 Actions
|
|
9
|
+
module ParamsRegistry
|
|
10
|
+
|
|
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
|
|
@@ -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 Rollup
|
|
9
|
+
module Actions
|
|
10
|
+
module ParamsRegistry
|
|
11
|
+
|
|
12
|
+
extend self
|
|
13
|
+
|
|
14
|
+
# A Mapping of all the actions to their list of valid params.
|
|
15
|
+
#
|
|
16
|
+
# @since 7.4.0
|
|
17
|
+
PARAMS = {}
|
|
18
|
+
|
|
19
|
+
# Register an action with its list of valid params.
|
|
20
|
+
#
|
|
21
|
+
# @example Register the action.
|
|
22
|
+
# ParamsRegistry.register(:benchmark, [ :verbose ])
|
|
23
|
+
#
|
|
24
|
+
# @param [ Symbol ] action The action to register.
|
|
25
|
+
# @param [ Array[Symbol] ] valid_params The list of valid params.
|
|
26
|
+
#
|
|
27
|
+
# @since 7.4.0
|
|
28
|
+
def register(action, valid_params)
|
|
29
|
+
PARAMS[action.to_sym] = valid_params
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Get the list of valid params for a given action.
|
|
33
|
+
#
|
|
34
|
+
# @example Get the list of valid params.
|
|
35
|
+
# ParamsRegistry.get(:benchmark)
|
|
36
|
+
#
|
|
37
|
+
# @param [ Symbol ] action The action.
|
|
38
|
+
#
|
|
39
|
+
# @return [ Array<Symbol> ] The list of valid params for the action.
|
|
40
|
+
#
|
|
41
|
+
# @since 7.4.0
|
|
42
|
+
def get(action)
|
|
43
|
+
PARAMS.fetch(action, [])
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
@@ -20,15 +20,19 @@ module Elasticsearch
|
|
|
20
20
|
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
|
|
21
21
|
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
|
|
22
22
|
|
|
23
|
-
valid_params = [ :typed_keys, :rest_total_hits_as_int ]
|
|
24
|
-
|
|
25
23
|
method = Elasticsearch::API::HTTP_GET
|
|
26
24
|
path = "#{arguments[:index]}/_rollup_search"
|
|
27
|
-
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments,
|
|
25
|
+
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
|
28
26
|
body = arguments[:body]
|
|
29
27
|
|
|
30
28
|
perform_request(method, path, params, body).body
|
|
31
29
|
end
|
|
30
|
+
|
|
31
|
+
# Register this action with its valid params when the module is loaded.
|
|
32
|
+
#
|
|
33
|
+
# @since 7.4.0
|
|
34
|
+
ParamsRegistry.register(:rollup_search, [ :typed_keys,
|
|
35
|
+
:rest_total_hits_as_int ].freeze)
|
|
32
36
|
end
|
|
33
37
|
end
|
|
34
38
|
end
|
|
@@ -13,7 +13,6 @@ module Elasticsearch
|
|
|
13
13
|
# @see https://www.elastic.co/guide/en/x-pack/current/security-api-authenticate.html
|
|
14
14
|
#
|
|
15
15
|
def authenticate(arguments={})
|
|
16
|
-
valid_params = []
|
|
17
16
|
method = Elasticsearch::API::HTTP_GET
|
|
18
17
|
path = "_xpack/security/_authenticate"
|
|
19
18
|
params = {}
|
|
@@ -18,19 +18,21 @@ module Elasticsearch
|
|
|
18
18
|
#
|
|
19
19
|
def change_password(arguments={})
|
|
20
20
|
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
|
|
21
|
-
|
|
22
|
-
valid_params = [ :refresh ]
|
|
23
|
-
|
|
24
21
|
arguments = arguments.clone
|
|
25
22
|
username = arguments.delete(:username)
|
|
26
23
|
|
|
27
24
|
method = Elasticsearch::API::HTTP_PUT
|
|
28
25
|
path = Elasticsearch::API::Utils.__pathify "_xpack/security/user/", username, "/_password"
|
|
29
|
-
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments,
|
|
26
|
+
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
|
30
27
|
body = arguments[:body]
|
|
31
28
|
|
|
32
29
|
perform_request(method, path, params, body).body
|
|
33
30
|
end
|
|
31
|
+
|
|
32
|
+
# Register this action with its valid params when the module is loaded.
|
|
33
|
+
#
|
|
34
|
+
# @since 7.4.0
|
|
35
|
+
ParamsRegistry.register(:change_password, [ :refresh ].freeze)
|
|
34
36
|
end
|
|
35
37
|
end
|
|
36
38
|
end
|
|
@@ -17,19 +17,21 @@ module Elasticsearch
|
|
|
17
17
|
#
|
|
18
18
|
def clear_cached_realms(arguments={})
|
|
19
19
|
raise ArgumentError, "Required argument 'realms' missing" unless arguments[:realms]
|
|
20
|
-
|
|
21
|
-
valid_params = [ :usernames ]
|
|
22
|
-
|
|
23
20
|
arguments = arguments.clone
|
|
24
21
|
realms = arguments.delete(:realms)
|
|
25
22
|
|
|
26
23
|
method = Elasticsearch::API::HTTP_POST
|
|
27
24
|
path = Elasticsearch::API::Utils.__pathify "_xpack/security/realm/", Elasticsearch::API::Utils.__listify(realms), "_clear_cache"
|
|
28
|
-
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments,
|
|
25
|
+
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
|
29
26
|
body = nil
|
|
30
27
|
|
|
31
28
|
perform_request(method, path, params, body).body
|
|
32
29
|
end
|
|
30
|
+
|
|
31
|
+
# Register this action with its valid params when the module is loaded.
|
|
32
|
+
#
|
|
33
|
+
# @since 7.4.0
|
|
34
|
+
ParamsRegistry.register(:clear_cached_realms, [ :usernames ].freeze)
|
|
33
35
|
end
|
|
34
36
|
end
|
|
35
37
|
end
|
|
@@ -20,15 +20,17 @@ module Elasticsearch
|
|
|
20
20
|
#
|
|
21
21
|
def create_api_key(arguments={})
|
|
22
22
|
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
|
|
23
|
-
|
|
24
|
-
valid_params = [ :refresh ]
|
|
25
|
-
|
|
26
23
|
method = Elasticsearch::API::HTTP_PUT
|
|
27
24
|
path = "_security/api_key"
|
|
28
|
-
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments,
|
|
25
|
+
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
|
29
26
|
|
|
30
27
|
perform_request(method, path, params, arguments[:body]).body
|
|
31
28
|
end
|
|
29
|
+
|
|
30
|
+
# Register this action with its valid params when the module is loaded.
|
|
31
|
+
#
|
|
32
|
+
# @since 7.4.0
|
|
33
|
+
ParamsRegistry.register(:create_api_key, [ :refresh ].freeze)
|
|
32
34
|
end
|
|
33
35
|
end
|
|
34
36
|
end
|
|
@@ -15,15 +15,18 @@ module Elasticsearch
|
|
|
15
15
|
raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]
|
|
16
16
|
raise ArgumentError, "Required argument 'application' missing" unless arguments[:application]
|
|
17
17
|
|
|
18
|
-
valid_params = [ :refresh ]
|
|
19
|
-
|
|
20
18
|
method = Elasticsearch::API::HTTP_DELETE
|
|
21
19
|
path = "_xpack/security/privilege/#{arguments.delete(:application)}/#{arguments[:name]}"
|
|
22
|
-
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments,
|
|
20
|
+
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
|
23
21
|
body = nil
|
|
24
22
|
|
|
25
23
|
perform_request(method, path, params, body).body
|
|
26
24
|
end
|
|
25
|
+
|
|
26
|
+
# Register this action with its valid params when the module is loaded.
|
|
27
|
+
#
|
|
28
|
+
# @since 7.4.0
|
|
29
|
+
ParamsRegistry.register(:delete_privileges, [ :refresh ].freeze)
|
|
27
30
|
end
|
|
28
31
|
end
|
|
29
32
|
end
|
|
@@ -17,12 +17,9 @@ module Elasticsearch
|
|
|
17
17
|
#
|
|
18
18
|
def delete_role(arguments={})
|
|
19
19
|
raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]
|
|
20
|
-
|
|
21
|
-
valid_params = [ :refresh ]
|
|
22
|
-
|
|
23
20
|
method = Elasticsearch::API::HTTP_DELETE
|
|
24
21
|
path = "_xpack/security/role/#{arguments[:name]}"
|
|
25
|
-
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments,
|
|
22
|
+
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
|
26
23
|
body = nil
|
|
27
24
|
|
|
28
25
|
if Array(arguments[:ignore]).include?(404)
|
|
@@ -31,6 +28,11 @@ module Elasticsearch
|
|
|
31
28
|
perform_request(method, path, params, body).body
|
|
32
29
|
end
|
|
33
30
|
end
|
|
31
|
+
|
|
32
|
+
# Register this action with its valid params when the module is loaded.
|
|
33
|
+
#
|
|
34
|
+
# @since 7.4.0
|
|
35
|
+
ParamsRegistry.register(:delete_role, [ :refresh ].freeze)
|
|
34
36
|
end
|
|
35
37
|
end
|
|
36
38
|
end
|
|
@@ -17,20 +17,22 @@ module Elasticsearch
|
|
|
17
17
|
#
|
|
18
18
|
def delete_role_mapping(arguments={})
|
|
19
19
|
raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]
|
|
20
|
-
valid_params = [
|
|
21
|
-
:name,
|
|
22
|
-
:refresh ]
|
|
23
|
-
|
|
24
20
|
arguments = arguments.clone
|
|
25
21
|
name = arguments.delete(:name)
|
|
26
22
|
|
|
27
23
|
method = Elasticsearch::API::HTTP_DELETE
|
|
28
24
|
path = "_xpack/security/role_mapping/#{name}"
|
|
29
|
-
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments,
|
|
25
|
+
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
|
30
26
|
body = nil
|
|
31
27
|
|
|
32
28
|
perform_request(method, path, params, body).body
|
|
33
29
|
end
|
|
30
|
+
|
|
31
|
+
# Register this action with its valid params when the module is loaded.
|
|
32
|
+
#
|
|
33
|
+
# @since 7.4.0
|
|
34
|
+
ParamsRegistry.register(:delete_role_mapping, [ :name,
|
|
35
|
+
:refresh ].freeze)
|
|
34
36
|
end
|
|
35
37
|
end
|
|
36
38
|
end
|
|
@@ -16,16 +16,12 @@ module Elasticsearch
|
|
|
16
16
|
# @see https://www.elastic.co/guide/en/x-pack/current/security-api-users.html#security-api-delete-user
|
|
17
17
|
#
|
|
18
18
|
def delete_user(arguments={})
|
|
19
|
-
valid_params = [
|
|
20
|
-
:username,
|
|
21
|
-
:refresh ]
|
|
22
|
-
|
|
23
19
|
arguments = arguments.clone
|
|
24
20
|
username = arguments.delete(:username)
|
|
25
21
|
|
|
26
22
|
method = Elasticsearch::API::HTTP_DELETE
|
|
27
23
|
path = "_xpack/security/user/#{username}"
|
|
28
|
-
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments,
|
|
24
|
+
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
|
29
25
|
body = nil
|
|
30
26
|
|
|
31
27
|
if Array(arguments[:ignore]).include?(404)
|
|
@@ -34,6 +30,12 @@ module Elasticsearch
|
|
|
34
30
|
perform_request(method, path, params, body).body
|
|
35
31
|
end
|
|
36
32
|
end
|
|
33
|
+
|
|
34
|
+
# Register this action with its valid params when the module is loaded.
|
|
35
|
+
#
|
|
36
|
+
# @since 7.4.0
|
|
37
|
+
ParamsRegistry.register(:delete_user, [ :username,
|
|
38
|
+
:refresh ].freeze)
|
|
37
39
|
end
|
|
38
40
|
end
|
|
39
41
|
end
|
|
@@ -11,25 +11,29 @@ module Elasticsearch
|
|
|
11
11
|
# Disable a user
|
|
12
12
|
#
|
|
13
13
|
# @option arguments [String] :username The username of the user to disable
|
|
14
|
-
# @option arguments [String] :refresh If `true` (the default) then refresh the affected shards to make this
|
|
14
|
+
# @option arguments [String] :refresh If `true` (the default) then refresh the affected shards to make this
|
|
15
|
+
# operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search,
|
|
16
|
+
# if `false` then do nothing with refreshes. (options: true, false, wait_for)
|
|
15
17
|
#
|
|
16
18
|
# @see https://www.elastic.co/guide/en/x-pack/5.4/security-api-users.html
|
|
17
19
|
#
|
|
18
20
|
def disable_user(arguments={})
|
|
19
|
-
valid_params = [
|
|
20
|
-
:username,
|
|
21
|
-
:refresh ]
|
|
22
|
-
|
|
23
21
|
arguments = arguments.clone
|
|
24
22
|
username = arguments.delete(:username)
|
|
25
23
|
|
|
26
24
|
method = Elasticsearch::API::HTTP_PUT
|
|
27
25
|
path = "_xpack/security/user/#{username}/_disable"
|
|
28
|
-
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments,
|
|
26
|
+
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
|
29
27
|
body = nil
|
|
30
28
|
|
|
31
29
|
perform_request(method, path, params, body).body
|
|
32
30
|
end
|
|
31
|
+
|
|
32
|
+
# Register this action with its valid params when the module is loaded.
|
|
33
|
+
#
|
|
34
|
+
# @since 7.4.0
|
|
35
|
+
ParamsRegistry.register(:disable_user, [ :username,
|
|
36
|
+
:refresh ].freeze)
|
|
33
37
|
end
|
|
34
38
|
end
|
|
35
39
|
end
|