elasticsearch-api 7.15.0 → 7.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +14 -35
- data/Rakefile +0 -14
- data/elasticsearch-api.gemspec +13 -5
- data/lib/elasticsearch/api/actions/bulk.rb +2 -2
- data/lib/elasticsearch/api/actions/cat/aliases.rb +1 -1
- data/lib/elasticsearch/api/actions/cat/allocation.rb +1 -1
- data/lib/elasticsearch/api/actions/cat/count.rb +1 -1
- data/lib/elasticsearch/api/actions/cat/fielddata.rb +1 -1
- data/lib/elasticsearch/api/actions/cat/health.rb +1 -1
- data/lib/elasticsearch/api/actions/cat/help.rb +1 -1
- data/lib/elasticsearch/api/actions/cat/indices.rb +1 -1
- data/lib/elasticsearch/api/actions/cat/master.rb +1 -1
- data/lib/elasticsearch/api/actions/cat/nodeattrs.rb +1 -1
- data/lib/elasticsearch/api/actions/cat/nodes.rb +1 -1
- data/lib/elasticsearch/api/actions/cat/pending_tasks.rb +1 -1
- data/lib/elasticsearch/api/actions/cat/plugins.rb +1 -1
- data/lib/elasticsearch/api/actions/cat/recovery.rb +1 -1
- data/lib/elasticsearch/api/actions/cat/repositories.rb +1 -1
- data/lib/elasticsearch/api/actions/cat/segments.rb +1 -1
- data/lib/elasticsearch/api/actions/cat/shards.rb +1 -1
- data/lib/elasticsearch/api/actions/cat/snapshots.rb +1 -1
- data/lib/elasticsearch/api/actions/cat/tasks.rb +1 -1
- data/lib/elasticsearch/api/actions/cat/templates.rb +1 -1
- data/lib/elasticsearch/api/actions/cat/thread_pool.rb +1 -1
- data/lib/elasticsearch/api/actions/clear_scroll.rb +1 -1
- data/lib/elasticsearch/api/actions/close_point_in_time.rb +1 -1
- data/lib/elasticsearch/api/actions/cluster/allocation_explain.rb +1 -1
- data/lib/elasticsearch/api/actions/cluster/delete_component_template.rb +1 -1
- data/lib/elasticsearch/api/actions/cluster/delete_voting_config_exclusions.rb +1 -1
- data/lib/elasticsearch/api/actions/cluster/exists_component_template.rb +1 -1
- data/lib/elasticsearch/api/actions/cluster/get_component_template.rb +1 -1
- data/lib/elasticsearch/api/actions/cluster/get_settings.rb +1 -1
- data/lib/elasticsearch/api/actions/cluster/health.rb +1 -1
- data/lib/elasticsearch/api/actions/cluster/pending_tasks.rb +1 -1
- data/lib/elasticsearch/api/actions/cluster/post_voting_config_exclusions.rb +1 -1
- data/lib/elasticsearch/api/actions/cluster/put_component_template.rb +1 -1
- data/lib/elasticsearch/api/actions/cluster/put_settings.rb +1 -1
- data/lib/elasticsearch/api/actions/cluster/remote_info.rb +1 -1
- data/lib/elasticsearch/api/actions/cluster/reroute.rb +1 -1
- data/lib/elasticsearch/api/actions/cluster/state.rb +1 -1
- data/lib/elasticsearch/api/actions/cluster/stats.rb +1 -1
- data/lib/elasticsearch/api/actions/count.rb +7 -2
- data/lib/elasticsearch/api/actions/create.rb +1 -1
- data/lib/elasticsearch/api/actions/dangling_indices/delete_dangling_index.rb +1 -1
- data/lib/elasticsearch/api/actions/dangling_indices/import_dangling_index.rb +1 -1
- data/lib/elasticsearch/api/actions/dangling_indices/list_dangling_indices.rb +1 -1
- data/lib/elasticsearch/api/actions/delete.rb +1 -1
- data/lib/elasticsearch/api/actions/delete_by_query.rb +1 -7
- data/lib/elasticsearch/api/actions/delete_by_query_rethrottle.rb +1 -1
- data/lib/elasticsearch/api/actions/delete_script.rb +1 -1
- data/lib/elasticsearch/api/actions/exists.rb +1 -1
- data/lib/elasticsearch/api/actions/exists_source.rb +1 -1
- data/lib/elasticsearch/api/actions/explain.rb +1 -1
- data/lib/elasticsearch/api/actions/features/get_features.rb +1 -1
- data/lib/elasticsearch/api/actions/features/reset_features.rb +1 -1
- data/lib/elasticsearch/api/actions/field_caps.rb +1 -1
- data/lib/elasticsearch/api/actions/get.rb +1 -1
- data/lib/elasticsearch/api/actions/get_script.rb +1 -1
- data/lib/elasticsearch/api/actions/get_script_context.rb +1 -5
- data/lib/elasticsearch/api/actions/get_script_languages.rb +1 -5
- data/lib/elasticsearch/api/actions/get_source.rb +1 -1
- data/lib/elasticsearch/api/actions/index.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/add_block.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/analyze.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/clear_cache.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/clone.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/close.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/create.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/delete.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/delete_alias.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/delete_index_template.rb +6 -2
- data/lib/elasticsearch/api/actions/indices/delete_template.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/disk_usage.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/exists.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/exists_alias.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/exists_index_template.rb +5 -2
- data/lib/elasticsearch/api/actions/indices/exists_template.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/exists_type.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/field_usage_stats.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/flush.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/flush_synced.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/forcemerge.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/get.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/get_alias.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/get_field_mapping.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/get_index_template.rb +2 -2
- data/lib/elasticsearch/api/actions/indices/get_mapping.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/get_settings.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/get_template.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/get_upgrade.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/open.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/put_alias.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/put_index_template.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/put_mapping.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/put_settings.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/put_template.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/recovery.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/refresh.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/resolve_index.rb +1 -5
- data/lib/elasticsearch/api/actions/indices/rollover.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/segments.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/shard_stores.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/shrink.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/simulate_index_template.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/simulate_template.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/split.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/stats.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/update_aliases.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/upgrade.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/validate_query.rb +1 -1
- data/lib/elasticsearch/api/actions/info.rb +1 -1
- data/lib/elasticsearch/api/actions/ingest/delete_pipeline.rb +1 -1
- data/lib/elasticsearch/api/actions/ingest/geo_ip_stats.rb +1 -1
- data/lib/elasticsearch/api/actions/ingest/get_pipeline.rb +1 -1
- data/lib/elasticsearch/api/actions/ingest/processor_grok.rb +1 -1
- data/lib/elasticsearch/api/actions/ingest/put_pipeline.rb +3 -1
- data/lib/elasticsearch/api/actions/ingest/simulate.rb +1 -1
- data/lib/elasticsearch/api/actions/mget.rb +1 -1
- data/lib/elasticsearch/api/actions/msearch.rb +2 -2
- data/lib/elasticsearch/api/actions/msearch_template.rb +2 -2
- data/lib/elasticsearch/api/actions/mtermvectors.rb +1 -1
- data/lib/elasticsearch/api/actions/nodes/clear_repositories_metering_archive.rb +2 -4
- data/lib/elasticsearch/api/actions/nodes/get_repositories_metering_info.rb +1 -1
- data/lib/elasticsearch/api/actions/nodes/hot_threads.rb +4 -2
- data/lib/elasticsearch/api/actions/nodes/info.rb +2 -2
- data/lib/elasticsearch/api/actions/nodes/reload_secure_settings.rb +1 -1
- data/lib/elasticsearch/api/actions/nodes/stats.rb +2 -2
- data/lib/elasticsearch/api/actions/nodes/usage.rb +1 -1
- data/lib/elasticsearch/api/actions/open_point_in_time.rb +2 -2
- data/lib/elasticsearch/api/actions/ping.rb +1 -1
- data/lib/elasticsearch/api/actions/put_script.rb +1 -1
- data/lib/elasticsearch/api/actions/rank_eval.rb +1 -5
- data/lib/elasticsearch/api/actions/reindex.rb +1 -1
- data/lib/elasticsearch/api/actions/reindex_rethrottle.rb +1 -1
- data/lib/elasticsearch/api/actions/render_search_template.rb +1 -1
- data/lib/elasticsearch/api/actions/scripts_painless_execute.rb +1 -1
- data/lib/elasticsearch/api/actions/scroll.rb +1 -1
- data/lib/elasticsearch/api/actions/search.rb +1 -1
- data/lib/elasticsearch/api/actions/search_mvt.rb +5 -3
- data/lib/elasticsearch/api/actions/search_shards.rb +1 -1
- data/lib/elasticsearch/api/actions/search_template.rb +1 -1
- data/lib/elasticsearch/api/actions/shutdown/delete_node.rb +1 -5
- data/lib/elasticsearch/api/actions/shutdown/get_node.rb +1 -5
- data/lib/elasticsearch/api/actions/shutdown/put_node.rb +1 -5
- data/lib/elasticsearch/api/actions/snapshot/cleanup_repository.rb +1 -1
- data/lib/elasticsearch/api/actions/snapshot/clone.rb +1 -1
- data/lib/elasticsearch/api/actions/snapshot/create.rb +1 -1
- data/lib/elasticsearch/api/actions/snapshot/create_repository.rb +1 -1
- data/lib/elasticsearch/api/actions/snapshot/delete.rb +1 -1
- data/lib/elasticsearch/api/actions/snapshot/delete_repository.rb +1 -1
- data/lib/elasticsearch/api/actions/snapshot/get.rb +1 -1
- data/lib/elasticsearch/api/actions/snapshot/get_repository.rb +1 -1
- data/lib/elasticsearch/api/actions/snapshot/repository_analyze.rb +1 -1
- data/lib/elasticsearch/api/actions/snapshot/restore.rb +1 -1
- data/lib/elasticsearch/api/actions/snapshot/status.rb +1 -1
- data/lib/elasticsearch/api/actions/snapshot/verify_repository.rb +1 -1
- data/lib/elasticsearch/api/actions/tasks/cancel.rb +1 -1
- data/lib/elasticsearch/api/actions/tasks/get.rb +1 -1
- data/lib/elasticsearch/api/actions/tasks/list.rb +1 -1
- data/lib/elasticsearch/api/actions/termvectors.rb +1 -1
- data/lib/elasticsearch/api/actions/update.rb +1 -1
- data/lib/elasticsearch/api/actions/update_by_query.rb +1 -7
- data/lib/elasticsearch/api/actions/update_by_query_rethrottle.rb +1 -1
- data/lib/elasticsearch/api/utils.rb +7 -3
- data/lib/elasticsearch/api/version.rb +1 -1
- data/spec/elasticsearch/api/actions/count_spec.rb +2 -5
- data/spec/elasticsearch/api/actions/nodes/clear_repositories_metering_archive_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/nodes/get_repositories_metering_info_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/search_mvt_spec.rb +1 -2
- data/spec/elasticsearch/api/rest_api_yaml_spec.rb +1 -2
- data/spec/elasticsearch/api/utils_spec.rb +9 -21
- data/spec/rest_yaml_tests_helper.rb +59 -8
- data/spec/spec_helper.rb +5 -1
- data/utils/thor/.rubocop.yml +2 -0
- data/utils/thor/generate_source.rb +16 -11
- data/utils/thor/generator/endpoint_specifics.rb +3 -1
- data/utils/thor/templates/_perform_request.erb +1 -1
- metadata +38 -26
- data/lib/elasticsearch/api/actions/abort_benchmark.rb +0 -41
- data/lib/elasticsearch/api/actions/benchmark.rb +0 -81
- data/lib/elasticsearch/api/actions/delete_by_rethrottle.rb +0 -47
- data/lib/elasticsearch/api/actions/nodes/shutdown.rb +0 -56
- data/lib/elasticsearch/api/actions/remote/info.rb +0 -37
- data/lib/elasticsearch/api/actions/snapshot/get_features.rb +0 -51
- data/spec/elasticsearch/api/actions/abort_benchmark_spec.rb +0 -34
- data/spec/elasticsearch/api/actions/benchmark_spec.rb +0 -34
- data/spec/elasticsearch/api/actions/nodes/shutdown_spec.rb +0 -76
- data/spec/elasticsearch/api/actions/remote/info_spec.rb +0 -35
- data/spec/elasticsearch/api/actions/snapshot/get_features_spec.rb +0 -38
@@ -26,7 +26,7 @@ module Elasticsearch
|
|
26
26
|
# @option arguments [Time] :timeout Explicit operation timeout
|
27
27
|
# @option arguments [Hash] :headers Custom HTTP headers
|
28
28
|
#
|
29
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
29
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.17/clean-up-snapshot-repo-api.html
|
30
30
|
#
|
31
31
|
def cleanup_repository(arguments = {})
|
32
32
|
raise ArgumentError, "Required argument 'repository' missing" unless arguments[:repository]
|
@@ -28,7 +28,7 @@ module Elasticsearch
|
|
28
28
|
# @option arguments [Hash] :headers Custom HTTP headers
|
29
29
|
# @option arguments [Hash] :body The snapshot clone definition (*Required*)
|
30
30
|
#
|
31
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
31
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.17/modules-snapshots.html
|
32
32
|
#
|
33
33
|
def clone(arguments = {})
|
34
34
|
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
|
@@ -28,7 +28,7 @@ module Elasticsearch
|
|
28
28
|
# @option arguments [Hash] :headers Custom HTTP headers
|
29
29
|
# @option arguments [Hash] :body The snapshot definition
|
30
30
|
#
|
31
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
31
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.17/modules-snapshots.html
|
32
32
|
#
|
33
33
|
def create(arguments = {})
|
34
34
|
raise ArgumentError, "Required argument 'repository' missing" unless arguments[:repository]
|
@@ -28,7 +28,7 @@ module Elasticsearch
|
|
28
28
|
# @option arguments [Hash] :headers Custom HTTP headers
|
29
29
|
# @option arguments [Hash] :body The repository definition (*Required*)
|
30
30
|
#
|
31
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
31
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.17/modules-snapshots.html
|
32
32
|
#
|
33
33
|
def create_repository(arguments = {})
|
34
34
|
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
|
@@ -26,7 +26,7 @@ module Elasticsearch
|
|
26
26
|
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
|
27
27
|
# @option arguments [Hash] :headers Custom HTTP headers
|
28
28
|
#
|
29
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
29
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.17/modules-snapshots.html
|
30
30
|
#
|
31
31
|
def delete(arguments = {})
|
32
32
|
raise ArgumentError, "Required argument 'repository' missing" unless arguments[:repository]
|
@@ -26,7 +26,7 @@ module Elasticsearch
|
|
26
26
|
# @option arguments [Time] :timeout Explicit operation timeout
|
27
27
|
# @option arguments [Hash] :headers Custom HTTP headers
|
28
28
|
#
|
29
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
29
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.17/modules-snapshots.html
|
30
30
|
#
|
31
31
|
def delete_repository(arguments = {})
|
32
32
|
raise ArgumentError, "Required argument 'repository' missing" unless arguments[:repository]
|
@@ -30,7 +30,7 @@ module Elasticsearch
|
|
30
30
|
# @option arguments [Boolean] :verbose Whether to show verbose snapshot info or only show the basic info found in the repository index blob
|
31
31
|
# @option arguments [Hash] :headers Custom HTTP headers
|
32
32
|
#
|
33
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
33
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.17/modules-snapshots.html
|
34
34
|
#
|
35
35
|
def get(arguments = {})
|
36
36
|
raise ArgumentError, "Required argument 'repository' missing" unless arguments[:repository]
|
@@ -26,7 +26,7 @@ module Elasticsearch
|
|
26
26
|
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false)
|
27
27
|
# @option arguments [Hash] :headers Custom HTTP headers
|
28
28
|
#
|
29
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
29
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.17/modules-snapshots.html
|
30
30
|
#
|
31
31
|
def get_repository(arguments = {})
|
32
32
|
headers = arguments.delete(:headers) || {}
|
@@ -35,7 +35,7 @@ module Elasticsearch
|
|
35
35
|
# @option arguments [Boolean] :rarely_abort_writes Whether to rarely abort writes before they complete. Defaults to 'true'.
|
36
36
|
# @option arguments [Hash] :headers Custom HTTP headers
|
37
37
|
#
|
38
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
38
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.17/modules-snapshots.html
|
39
39
|
#
|
40
40
|
def repository_analyze(arguments = {})
|
41
41
|
raise ArgumentError, "Required argument 'repository' missing" unless arguments[:repository]
|
@@ -28,7 +28,7 @@ module Elasticsearch
|
|
28
28
|
# @option arguments [Hash] :headers Custom HTTP headers
|
29
29
|
# @option arguments [Hash] :body Details of what to restore
|
30
30
|
#
|
31
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
31
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.17/modules-snapshots.html
|
32
32
|
#
|
33
33
|
def restore(arguments = {})
|
34
34
|
raise ArgumentError, "Required argument 'repository' missing" unless arguments[:repository]
|
@@ -27,7 +27,7 @@ module Elasticsearch
|
|
27
27
|
# @option arguments [Boolean] :ignore_unavailable Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown
|
28
28
|
# @option arguments [Hash] :headers Custom HTTP headers
|
29
29
|
#
|
30
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
30
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.17/modules-snapshots.html
|
31
31
|
#
|
32
32
|
def status(arguments = {})
|
33
33
|
headers = arguments.delete(:headers) || {}
|
@@ -26,7 +26,7 @@ module Elasticsearch
|
|
26
26
|
# @option arguments [Time] :timeout Explicit operation timeout
|
27
27
|
# @option arguments [Hash] :headers Custom HTTP headers
|
28
28
|
#
|
29
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
29
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.17/modules-snapshots.html
|
30
30
|
#
|
31
31
|
def verify_repository(arguments = {})
|
32
32
|
raise ArgumentError, "Required argument 'repository' missing" unless arguments[:repository]
|
@@ -32,7 +32,7 @@ module Elasticsearch
|
|
32
32
|
# @option arguments [Boolean] :wait_for_completion Should the request block until the cancellation of the task and its descendant tasks is completed. Defaults to false
|
33
33
|
# @option arguments [Hash] :headers Custom HTTP headers
|
34
34
|
#
|
35
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
35
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.17/tasks.html
|
36
36
|
#
|
37
37
|
def cancel(arguments = {})
|
38
38
|
headers = arguments.delete(:headers) || {}
|
@@ -30,7 +30,7 @@ module Elasticsearch
|
|
30
30
|
# @option arguments [Time] :timeout Explicit operation timeout
|
31
31
|
# @option arguments [Hash] :headers Custom HTTP headers
|
32
32
|
#
|
33
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
33
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.17/tasks.html
|
34
34
|
#
|
35
35
|
def get(arguments = {})
|
36
36
|
headers = arguments.delete(:headers) || {}
|
@@ -34,7 +34,7 @@ module Elasticsearch
|
|
34
34
|
# @option arguments [Time] :timeout Explicit operation timeout
|
35
35
|
# @option arguments [Hash] :headers Custom HTTP headers
|
36
36
|
#
|
37
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
37
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.17/tasks.html
|
38
38
|
#
|
39
39
|
def list(arguments = {})
|
40
40
|
headers = arguments.delete(:headers) || {}
|
@@ -42,7 +42,7 @@ module Elasticsearch
|
|
42
42
|
# Deprecated since version 7.0.0
|
43
43
|
#
|
44
44
|
#
|
45
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
45
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.17/docs-termvectors.html
|
46
46
|
#
|
47
47
|
def termvectors(arguments = {})
|
48
48
|
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
|
@@ -43,7 +43,7 @@ module Elasticsearch
|
|
43
43
|
# Deprecated since version 7.0.0
|
44
44
|
#
|
45
45
|
#
|
46
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
46
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.17/docs-update.html
|
47
47
|
#
|
48
48
|
def update(arguments = {})
|
49
49
|
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
|
@@ -43,9 +43,6 @@ module Elasticsearch
|
|
43
43
|
# @option arguments [Number] :size Deprecated, please use `max_docs` instead
|
44
44
|
# @option arguments [Number] :max_docs Maximum number of documents to process (default: all documents)
|
45
45
|
# @option arguments [List] :sort A comma-separated list of <field>:<direction> pairs
|
46
|
-
# @option arguments [List] :_source True or false to return the _source field or not, or a list of fields to return
|
47
|
-
# @option arguments [List] :_source_excludes A list of fields to exclude from the returned _source field
|
48
|
-
# @option arguments [List] :_source_includes A list of fields to extract and return from the _source field
|
49
46
|
# @option arguments [Number] :terminate_after The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.
|
50
47
|
# @option arguments [List] :stats Specific 'tag' of the request for logging and statistical purposes
|
51
48
|
# @option arguments [Boolean] :version Specify whether to return document version as part of a hit
|
@@ -66,7 +63,7 @@ module Elasticsearch
|
|
66
63
|
# Deprecated since version 7.0.0
|
67
64
|
#
|
68
65
|
#
|
69
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
66
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.17/docs-update-by-query.html
|
70
67
|
#
|
71
68
|
def update_by_query(arguments = {})
|
72
69
|
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
|
@@ -115,9 +112,6 @@ module Elasticsearch
|
|
115
112
|
:size,
|
116
113
|
:max_docs,
|
117
114
|
:sort,
|
118
|
-
:_source,
|
119
|
-
:_source_excludes,
|
120
|
-
:_source_includes,
|
121
115
|
:terminate_after,
|
122
116
|
:stats,
|
123
117
|
:version,
|
@@ -24,7 +24,7 @@ module Elasticsearch
|
|
24
24
|
# @option arguments [Number] :requests_per_second The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. (*Required*)
|
25
25
|
# @option arguments [Hash] :headers Custom HTTP headers
|
26
26
|
#
|
27
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
27
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.17/docs-update-by-query.html
|
28
28
|
#
|
29
29
|
def update_by_query_rethrottle(arguments = {})
|
30
30
|
raise ArgumentError, "Required argument 'task_id' missing" unless arguments[:task_id]
|
@@ -14,14 +14,13 @@
|
|
14
14
|
# KIND, either express or implied. See the License for the
|
15
15
|
# specific language governing permissions and limitations
|
16
16
|
# under the License.
|
17
|
+
require 'erb'
|
17
18
|
|
18
19
|
module Elasticsearch
|
19
20
|
module API
|
20
|
-
|
21
21
|
# Generic utility methods
|
22
22
|
#
|
23
23
|
module Utils
|
24
|
-
|
25
24
|
# URL-escape a string
|
26
25
|
#
|
27
26
|
# @example
|
@@ -31,7 +30,7 @@ module Elasticsearch
|
|
31
30
|
# @api private
|
32
31
|
def __escape(string)
|
33
32
|
return string if string == '*'
|
34
|
-
|
33
|
+
ERB::Util.url_encode(string.to_s)
|
35
34
|
end
|
36
35
|
|
37
36
|
# Create a "list" of values from arguments, ignoring nil values and encoding special characters.
|
@@ -282,6 +281,11 @@ module Elasticsearch
|
|
282
281
|
end
|
283
282
|
end
|
284
283
|
|
284
|
+
def ndjson_headers(headers)
|
285
|
+
headers.merge!('Content-Type' => 'application/x-ndjson') unless ['1', 'true'].include?(ENV['ELASTIC_CLIENT_APIVERSIONING'])
|
286
|
+
headers
|
287
|
+
end
|
288
|
+
|
285
289
|
extend self
|
286
290
|
end
|
287
291
|
end
|
@@ -18,10 +18,9 @@
|
|
18
18
|
require 'spec_helper'
|
19
19
|
|
20
20
|
describe 'client#count' do
|
21
|
-
|
22
21
|
let(:expected_args) do
|
23
22
|
[
|
24
|
-
'
|
23
|
+
'GET',
|
25
24
|
'_count',
|
26
25
|
{},
|
27
26
|
nil,
|
@@ -34,10 +33,9 @@ describe 'client#count' do
|
|
34
33
|
end
|
35
34
|
|
36
35
|
context 'when an index and type are specified' do
|
37
|
-
|
38
36
|
let(:expected_args) do
|
39
37
|
[
|
40
|
-
'
|
38
|
+
'GET',
|
41
39
|
'foo,bar/t1,t2/_count',
|
42
40
|
{},
|
43
41
|
nil,
|
@@ -51,7 +49,6 @@ describe 'client#count' do
|
|
51
49
|
end
|
52
50
|
|
53
51
|
context 'when there is a query provided' do
|
54
|
-
|
55
52
|
let(:expected_args) do
|
56
53
|
[
|
57
54
|
'POST',
|
@@ -20,7 +20,7 @@ require 'spec_helper'
|
|
20
20
|
describe 'client#search_mvt' do
|
21
21
|
let(:expected_args) do
|
22
22
|
[
|
23
|
-
|
23
|
+
'POST',
|
24
24
|
url,
|
25
25
|
params,
|
26
26
|
body,
|
@@ -29,7 +29,6 @@ describe 'client#search_mvt' do
|
|
29
29
|
end
|
30
30
|
|
31
31
|
context 'with right parameters' do
|
32
|
-
let(:method) { 'POST' }
|
33
32
|
let(:url) { 'foo/_mvt/field/10/57.2127/6.2348' }
|
34
33
|
let(:params) { {} }
|
35
34
|
let(:body) { nil }
|
@@ -50,13 +50,12 @@ describe 'Rest API YAML tests' do
|
|
50
50
|
|
51
51
|
# Runs once before each test in a test file
|
52
52
|
before(:all) do
|
53
|
-
Elasticsearch::RestAPIYAMLTests::TestFile.wipe_cluster(ADMIN_CLIENT)
|
54
53
|
test_file.setup
|
55
54
|
end
|
56
55
|
|
57
56
|
after(:all) do
|
58
57
|
test_file.teardown
|
59
|
-
Elasticsearch::RestAPIYAMLTests::
|
58
|
+
Elasticsearch::RestAPIYAMLTests::WipeCluster.run(ADMIN_CLIENT)
|
60
59
|
end
|
61
60
|
|
62
61
|
test.task_groups.each do |task_group|
|
@@ -30,7 +30,7 @@ describe Elasticsearch::API::Utils do
|
|
30
30
|
end
|
31
31
|
|
32
32
|
it 'encodes special characters' do
|
33
|
-
expect(utils.__escape('foo bar')).to eq('foo
|
33
|
+
expect(utils.__escape('foo bar')).to eq('foo%20bar')
|
34
34
|
expect(utils.__escape('foo/bar')).to eq('foo%2Fbar')
|
35
35
|
expect(utils.__escape('foo^bar')).to eq('foo%5Ebar')
|
36
36
|
end
|
@@ -38,18 +38,6 @@ describe Elasticsearch::API::Utils do
|
|
38
38
|
it 'does not encode asterisks' do
|
39
39
|
expect(utils.__escape('*')).to eq('*')
|
40
40
|
end
|
41
|
-
|
42
|
-
it 'users CGI.escape by default' do
|
43
|
-
expect(CGI).to receive(:escape).and_call_original
|
44
|
-
expect(utils.__escape('foo bar')).to eq('foo+bar')
|
45
|
-
end
|
46
|
-
|
47
|
-
it 'uses the escape_utils gem when available', unless: defined?(JRUBY_VERSION) do
|
48
|
-
require 'escape_utils'
|
49
|
-
expect(CGI).not_to receive(:escape)
|
50
|
-
expect(EscapeUtils).to receive(:escape_url).and_call_original
|
51
|
-
expect(utils.__escape('foo bar')).to eq('foo+bar')
|
52
|
-
end
|
53
41
|
end
|
54
42
|
|
55
43
|
describe '#__listify' do
|
@@ -77,7 +65,7 @@ describe Elasticsearch::API::Utils do
|
|
77
65
|
context 'when the escape option is set to false' do
|
78
66
|
|
79
67
|
it 'does not escape the characters' do
|
80
|
-
expect(utils.__listify(['foo', 'bar^bam'], :
|
68
|
+
expect(utils.__listify(['foo', 'bar^bam'], escape: false)).to eq('foo,bar^bam')
|
81
69
|
end
|
82
70
|
end
|
83
71
|
end
|
@@ -107,19 +95,19 @@ describe Elasticsearch::API::Utils do
|
|
107
95
|
|
108
96
|
let(:result) do
|
109
97
|
utils.__bulkify [
|
110
|
-
{ :
|
111
|
-
{ :
|
112
|
-
{ :
|
98
|
+
{ index: { _index: 'myindexA', _id: '1', data: { title: 'Test' } } },
|
99
|
+
{ update: { _index: 'myindexB', _id: '2', data: { doc: { title: 'Update' } } } },
|
100
|
+
{ delete: { _index: 'myindexC', _id: '3' } }
|
113
101
|
]
|
114
102
|
end
|
115
103
|
|
116
104
|
let(:expected_string) do
|
117
105
|
<<-PAYLOAD.gsub(/^\s+/, '')
|
118
|
-
{"index":{"_index":"myindexA","
|
106
|
+
{"index":{"_index":"myindexA","_id":"1"}}
|
119
107
|
{"title":"Test"}
|
120
|
-
{"update":{"_index":"myindexB","
|
108
|
+
{"update":{"_index":"myindexB","_id":"2"}}
|
121
109
|
{"doc":{"title":"Update"}}
|
122
|
-
{"delete":{"_index":"myindexC","
|
110
|
+
{"delete":{"_index":"myindexC","_id":"3"}}
|
123
111
|
PAYLOAD
|
124
112
|
end
|
125
113
|
|
@@ -379,7 +367,7 @@ describe Elasticsearch::API::Utils do
|
|
379
367
|
end
|
380
368
|
|
381
369
|
let(:unsupported_params) do
|
382
|
-
[ { :
|
370
|
+
[ { foo: { explanation: 'NOT_SUPPORTED'} }, :moo ]
|
383
371
|
end
|
384
372
|
|
385
373
|
|
@@ -17,10 +17,13 @@
|
|
17
17
|
|
18
18
|
require "#{File.expand_path(File.dirname('..'), '..')}/api-spec-testing/test_file"
|
19
19
|
require "#{File.expand_path(File.dirname('..'), '..')}/api-spec-testing/rspec_matchers"
|
20
|
+
require "#{File.expand_path(File.dirname('..'), '..')}/api-spec-testing/wipe_cluster"
|
20
21
|
include Elasticsearch::RestAPIYAMLTests
|
21
22
|
|
22
23
|
TRANSPORT_OPTIONS = {}
|
23
24
|
PROJECT_PATH = File.join(File.dirname(__FILE__), '..')
|
25
|
+
STACK_VERSION = ENV['STACK_VERSION']
|
26
|
+
require 'elasticsearch/xpack'
|
24
27
|
|
25
28
|
if (hosts = ELASTICSEARCH_URL)
|
26
29
|
split_hosts = hosts.split(',').map do |host|
|
@@ -33,21 +36,69 @@ else
|
|
33
36
|
TEST_HOST, TEST_PORT = 'localhost', '9200'
|
34
37
|
end
|
35
38
|
|
39
|
+
test_suite = ENV['TEST_SUITE'] || 'free'
|
40
|
+
password = ENV['ELASTIC_PASSWORD'] || 'changeme'
|
41
|
+
user = ENV['ELASTIC_USER'] || 'elastic'
|
42
|
+
|
36
43
|
if defined?(TEST_HOST) && defined?(TEST_PORT)
|
37
|
-
URL = "http://#{TEST_HOST}:#{TEST_PORT}"
|
44
|
+
URL = "http://#{TEST_HOST}:#{TEST_PORT}".freeze
|
45
|
+
|
46
|
+
if STACK_VERSION.match?(/^8\./)
|
47
|
+
if ENV['TEST_SUITE'] == 'platinum'
|
48
|
+
raw_certificate = File.read(File.join(PROJECT_PATH, '../.ci/certs/testnode.crt'))
|
49
|
+
certificate = OpenSSL::X509::Certificate.new(raw_certificate)
|
50
|
+
raw_key = File.read(File.join(PROJECT_PATH, '../.ci/certs/testnode.key'))
|
51
|
+
key = OpenSSL::PKey::RSA.new(raw_key)
|
52
|
+
ca_file = File.expand_path(File.join(PROJECT_PATH, '/.ci/certs/ca.crt'))
|
53
|
+
host = "https://elastic:#{password}@#{uri.host}:#{uri.port}".freeze
|
54
|
+
transport_options = { ssl: { verify: false, client_cert: certificate, client_key: key, ca_file: ca_file } }
|
55
|
+
else
|
56
|
+
host = "http://elastic:#{password}@#{uri.host}:#{uri.port}".freeze
|
57
|
+
transport_options = {}
|
58
|
+
end
|
38
59
|
|
39
|
-
|
60
|
+
ADMIN_CLIENT = Elasticsearch::Client.new(host: host, transport_options: transport_options)
|
40
61
|
|
41
|
-
|
42
|
-
|
62
|
+
DEFAULT_CLIENT = if ENV['QUIET'] == 'true'
|
63
|
+
Elasticsearch::Client.new(host: host, transport_options: transport_options)
|
64
|
+
else
|
65
|
+
Elasticsearch::Client.new(
|
66
|
+
host: host,
|
67
|
+
tracer: Logger.new($stdout),
|
68
|
+
transport_options: transport_options
|
69
|
+
)
|
70
|
+
end
|
71
|
+
|
72
|
+
if ENV['QUIET'] == 'true'
|
73
|
+
DEFAULT_CLIENT = Elasticsearch::Client.new(
|
74
|
+
host: URL,
|
75
|
+
transport_options: TRANSPORT_OPTIONS,
|
76
|
+
user: user,
|
77
|
+
password: password
|
78
|
+
)
|
79
|
+
else
|
80
|
+
DEFAULT_CLIENT = Elasticsearch::Client.new(
|
81
|
+
host: URL,
|
82
|
+
transport_options: TRANSPORT_OPTIONS,
|
83
|
+
user: user,
|
84
|
+
password: password,
|
85
|
+
tracer: Logger.new($stdout)
|
86
|
+
)
|
87
|
+
end
|
43
88
|
else
|
44
|
-
|
45
|
-
|
46
|
-
|
89
|
+
ADMIN_CLIENT = Elasticsearch::Client.new(host: URL, transport_options: TRANSPORT_OPTIONS)
|
90
|
+
|
91
|
+
if ENV['QUIET'] == 'true'
|
92
|
+
DEFAULT_CLIENT = Elasticsearch::Client.new(host: URL, transport_options: TRANSPORT_OPTIONS)
|
93
|
+
else
|
94
|
+
DEFAULT_CLIENT = Elasticsearch::Client.new(host: URL,
|
95
|
+
transport_options: TRANSPORT_OPTIONS,
|
96
|
+
tracer: Logger.new($stdout))
|
97
|
+
end
|
47
98
|
end
|
48
99
|
end
|
49
100
|
|
50
|
-
YAML_FILES_DIRECTORY = "#{PROJECT_PATH}/../tmp/rest-api-spec
|
101
|
+
YAML_FILES_DIRECTORY = "#{PROJECT_PATH}/../tmp/rest-api-spec/#{STACK_VERSION.match?(/^8\./) ? 'compatTest' : 'test'}/free"
|
51
102
|
|
52
103
|
SINGLE_TEST = if ENV['SINGLE_TEST'] && !ENV['SINGLE_TEST'].empty?
|
53
104
|
test_target = ENV['SINGLE_TEST']
|
data/spec/spec_helper.rb
CHANGED
@@ -25,6 +25,10 @@ else
|
|
25
25
|
require 'pry-byebug'
|
26
26
|
end
|
27
27
|
require 'ansi'
|
28
|
+
require 'yaml'
|
29
|
+
require 'active_support/isolated_execution_state' unless RUBY_VERSION < '2.7.0'
|
30
|
+
require 'jbuilder'
|
31
|
+
require 'jsonify'
|
28
32
|
require 'elasticsearch'
|
29
33
|
require 'elasticsearch-api'
|
30
34
|
require 'elasticsearch-transport'
|
@@ -67,7 +71,7 @@ end
|
|
67
71
|
RSpec.configure do |config|
|
68
72
|
config.include(HelperModule)
|
69
73
|
config.formatter = 'documentation'
|
70
|
-
config.
|
74
|
+
config.color_mode = :on
|
71
75
|
config.add_formatter('RspecJunitFormatter', 'tmp/elasticsearch-api-junit.xml')
|
72
76
|
end
|
73
77
|
|
data/utils/thor/.rubocop.yml
CHANGED
@@ -148,6 +148,7 @@ module Elasticsearch
|
|
148
148
|
|
149
149
|
def __http_method
|
150
150
|
return '_id ? Elasticsearch::API::HTTP_PUT : Elasticsearch::API::HTTP_POST' if @endpoint_name == 'index'
|
151
|
+
return post_and_get if @endpoint_name == 'count'
|
151
152
|
|
152
153
|
default_method = @spec['url']['paths'].map { |a| a['methods'] }.flatten.first
|
153
154
|
if @spec['body'] && default_method == 'GET'
|
@@ -155,19 +156,23 @@ module Elasticsearch
|
|
155
156
|
if @spec['body']['required']
|
156
157
|
'Elasticsearch::API::HTTP_POST'
|
157
158
|
else
|
158
|
-
|
159
|
-
if arguments[:body]
|
160
|
-
Elasticsearch::API::HTTP_POST
|
161
|
-
else
|
162
|
-
Elasticsearch::API::HTTP_GET
|
163
|
-
end
|
164
|
-
SRC
|
159
|
+
post_and_get
|
165
160
|
end
|
166
161
|
else
|
167
162
|
"Elasticsearch::API::HTTP_#{default_method}"
|
168
163
|
end
|
169
164
|
end
|
170
165
|
|
166
|
+
def post_and_get
|
167
|
+
<<~SRC
|
168
|
+
if arguments[:body]
|
169
|
+
Elasticsearch::API::HTTP_POST
|
170
|
+
else
|
171
|
+
Elasticsearch::API::HTTP_GET
|
172
|
+
end
|
173
|
+
SRC
|
174
|
+
end
|
175
|
+
|
171
176
|
def __http_path
|
172
177
|
return "\"#{__parse_path(@paths.first)}\"" if @paths.size == 1
|
173
178
|
return termvectors_path if @method_name == 'termvectors'
|
@@ -194,9 +199,9 @@ module Elasticsearch
|
|
194
199
|
|
195
200
|
def __parse_path(path)
|
196
201
|
path.gsub(/^\//, '')
|
197
|
-
|
198
|
-
|
199
|
-
|
202
|
+
.gsub(/\/$/, '')
|
203
|
+
.gsub('{', "\#{#{__utils}.__listify(_")
|
204
|
+
.gsub('}', ')}')
|
200
205
|
end
|
201
206
|
|
202
207
|
def __path_variables
|
@@ -291,7 +296,7 @@ module Elasticsearch
|
|
291
296
|
end
|
292
297
|
|
293
298
|
def __utils
|
294
|
-
|
299
|
+
@current_api == :xpack ? 'Elasticsearch::API::Utils' : 'Utils'
|
295
300
|
end
|
296
301
|
|
297
302
|
def run_rubocop(api)
|
@@ -27,6 +27,7 @@ module Elasticsearch
|
|
27
27
|
exists
|
28
28
|
indices.exists
|
29
29
|
indices.exists_alias
|
30
|
+
indices.exists_index_template
|
30
31
|
indices.exists_template
|
31
32
|
indices.exists_type
|
32
33
|
].freeze
|
@@ -37,8 +38,9 @@ module Elasticsearch
|
|
37
38
|
delete
|
38
39
|
get
|
39
40
|
indices.flush_synced
|
40
|
-
indices.delete_template
|
41
41
|
indices.delete
|
42
|
+
indices.delete_index_template
|
43
|
+
indices.delete_template
|
42
44
|
security.get_role
|
43
45
|
security.get_user
|
44
46
|
snapshot.status
|
@@ -34,7 +34,7 @@ when 'mtermvectors'
|
|
34
34
|
<%- end -%>
|
35
35
|
<%- if ['bulk', 'msearch', 'msearch_template', 'find_structure'].include? @method_name -%>
|
36
36
|
<%= self.send("#{@method_name}_body_helper".to_s) %>
|
37
|
-
headers
|
37
|
+
headers = <%= __utils %>.ndjson_headers(headers)
|
38
38
|
<%= ' '*(@namespace_depth+4) %>perform_request(method, path, params, payload, headers).body
|
39
39
|
<%- elsif @method_name == 'ping' -%>
|
40
40
|
<%= ping_perform_request %>
|