elasticsearch-api 7.3.0 → 7.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (187) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +16 -23
  3. data/elasticsearch-api.gemspec +1 -1
  4. data/lib/elasticsearch/api/actions/abort_benchmark.rb +1 -2
  5. data/lib/elasticsearch/api/actions/benchmark.rb +2 -3
  6. data/lib/elasticsearch/api/actions/bulk.rb +35 -68
  7. data/lib/elasticsearch/api/actions/cat/aliases.rb +30 -52
  8. data/lib/elasticsearch/api/actions/cat/allocation.rb +36 -50
  9. data/lib/elasticsearch/api/actions/cat/count.rb +25 -46
  10. data/lib/elasticsearch/api/actions/cat/fielddata.rb +31 -33
  11. data/lib/elasticsearch/api/actions/cat/health.rb +27 -37
  12. data/lib/elasticsearch/api/actions/cat/help.rb +14 -10
  13. data/lib/elasticsearch/api/actions/cat/indices.rb +45 -62
  14. data/lib/elasticsearch/api/actions/cat/master.rb +24 -34
  15. data/lib/elasticsearch/api/actions/cat/nodeattrs.rb +20 -16
  16. data/lib/elasticsearch/api/actions/cat/nodes.rb +34 -46
  17. data/lib/elasticsearch/api/actions/cat/params_registry.rb +0 -1
  18. data/lib/elasticsearch/api/actions/cat/pending_tasks.rb +29 -35
  19. data/lib/elasticsearch/api/actions/cat/plugins.rb +21 -18
  20. data/lib/elasticsearch/api/actions/cat/recovery.rb +40 -56
  21. data/lib/elasticsearch/api/actions/cat/repositories.rb +21 -24
  22. data/lib/elasticsearch/api/actions/cat/segments.rb +29 -22
  23. data/lib/elasticsearch/api/actions/cat/shards.rb +38 -59
  24. data/lib/elasticsearch/api/actions/cat/snapshots.rb +32 -27
  25. data/lib/elasticsearch/api/actions/cat/tasks.rb +25 -19
  26. data/lib/elasticsearch/api/actions/cat/templates.rb +26 -18
  27. data/lib/elasticsearch/api/actions/cat/thread_pool.rb +36 -46
  28. data/lib/elasticsearch/api/actions/clear_scroll.rb +21 -8
  29. data/lib/elasticsearch/api/actions/cluster/allocation_explain.rb +15 -13
  30. data/lib/elasticsearch/api/actions/cluster/get_settings.rb +18 -18
  31. data/lib/elasticsearch/api/actions/cluster/health.rb +42 -44
  32. data/lib/elasticsearch/api/actions/cluster/params_registry.rb +0 -1
  33. data/lib/elasticsearch/api/actions/cluster/pending_tasks.rb +15 -17
  34. data/lib/elasticsearch/api/actions/cluster/put_settings.rb +20 -17
  35. data/lib/elasticsearch/api/actions/cluster/remote_info.rb +8 -6
  36. data/lib/elasticsearch/api/actions/cluster/reroute.rb +25 -37
  37. data/lib/elasticsearch/api/actions/cluster/state.rb +37 -41
  38. data/lib/elasticsearch/api/actions/cluster/stats.rb +20 -12
  39. data/lib/elasticsearch/api/actions/count.rb +52 -39
  40. data/lib/elasticsearch/api/actions/create.rb +25 -26
  41. data/lib/elasticsearch/api/actions/delete.rb +43 -36
  42. data/lib/elasticsearch/api/actions/delete_by_query.rb +74 -62
  43. data/lib/elasticsearch/api/actions/delete_by_query_rethrottle.rb +39 -0
  44. data/lib/elasticsearch/api/actions/delete_by_rethrottle.rb +4 -3
  45. data/lib/elasticsearch/api/actions/delete_script.rb +19 -13
  46. data/lib/elasticsearch/api/actions/exists.rb +44 -34
  47. data/lib/elasticsearch/api/actions/exists_source.rb +43 -25
  48. data/lib/elasticsearch/api/actions/explain.rb +46 -51
  49. data/lib/elasticsearch/api/actions/field_caps.rb +27 -20
  50. data/lib/elasticsearch/api/actions/get.rb +42 -41
  51. data/lib/elasticsearch/api/actions/get_script.rb +19 -14
  52. data/lib/elasticsearch/api/actions/get_source.rb +38 -44
  53. data/lib/elasticsearch/api/actions/index.rb +60 -89
  54. data/lib/elasticsearch/api/actions/indices/analyze.rb +19 -48
  55. data/lib/elasticsearch/api/actions/indices/clear_cache.rb +29 -41
  56. data/lib/elasticsearch/api/actions/indices/clone.rb +50 -0
  57. data/lib/elasticsearch/api/actions/indices/close.rb +28 -32
  58. data/lib/elasticsearch/api/actions/indices/create.rb +22 -70
  59. data/lib/elasticsearch/api/actions/indices/delete.rb +23 -35
  60. data/lib/elasticsearch/api/actions/indices/delete_alias.rb +24 -20
  61. data/lib/elasticsearch/api/actions/indices/delete_template.rb +18 -20
  62. data/lib/elasticsearch/api/actions/indices/exists.rb +32 -34
  63. data/lib/elasticsearch/api/actions/indices/exists_alias.rb +33 -29
  64. data/lib/elasticsearch/api/actions/indices/exists_template.rb +21 -16
  65. data/lib/elasticsearch/api/actions/indices/exists_type.rb +29 -29
  66. data/lib/elasticsearch/api/actions/indices/flush.rb +28 -28
  67. data/lib/elasticsearch/api/actions/indices/flush_synced.rb +23 -12
  68. data/lib/elasticsearch/api/actions/indices/forcemerge.rb +26 -41
  69. data/lib/elasticsearch/api/actions/indices/freeze.rb +7 -8
  70. data/lib/elasticsearch/api/actions/indices/get.rb +25 -19
  71. data/lib/elasticsearch/api/actions/indices/get_alias.rb +31 -23
  72. data/lib/elasticsearch/api/actions/indices/get_field_mapping.rb +42 -38
  73. data/lib/elasticsearch/api/actions/indices/get_mapping.rb +39 -31
  74. data/lib/elasticsearch/api/actions/indices/get_settings.rb +34 -37
  75. data/lib/elasticsearch/api/actions/indices/get_template.rb +21 -23
  76. data/lib/elasticsearch/api/actions/indices/get_upgrade.rb +48 -0
  77. data/lib/elasticsearch/api/actions/indices/open.rb +24 -21
  78. data/lib/elasticsearch/api/actions/indices/params_registry.rb +0 -1
  79. data/lib/elasticsearch/api/actions/indices/put_alias.rb +25 -27
  80. data/lib/elasticsearch/api/actions/indices/put_mapping.rb +40 -39
  81. data/lib/elasticsearch/api/actions/indices/put_settings.rb +30 -37
  82. data/lib/elasticsearch/api/actions/indices/put_template.rb +23 -23
  83. data/lib/elasticsearch/api/actions/indices/recovery.rb +20 -23
  84. data/lib/elasticsearch/api/actions/indices/refresh.rb +22 -26
  85. data/lib/elasticsearch/api/actions/indices/rollover.rb +28 -19
  86. data/lib/elasticsearch/api/actions/indices/segments.rb +24 -17
  87. data/lib/elasticsearch/api/actions/indices/shard_stores.rb +27 -15
  88. data/lib/elasticsearch/api/actions/indices/shrink.rb +23 -17
  89. data/lib/elasticsearch/api/actions/indices/split.rb +23 -17
  90. data/lib/elasticsearch/api/actions/indices/stats.rb +53 -104
  91. data/lib/elasticsearch/api/actions/indices/unfreeze.rb +7 -7
  92. data/lib/elasticsearch/api/actions/indices/update_aliases.rb +15 -32
  93. data/lib/elasticsearch/api/actions/indices/upgrade.rb +26 -16
  94. data/lib/elasticsearch/api/actions/indices/validate_query.rb +46 -59
  95. data/lib/elasticsearch/api/actions/info.rb +9 -6
  96. data/lib/elasticsearch/api/actions/ingest/delete_pipeline.rb +18 -12
  97. data/lib/elasticsearch/api/actions/ingest/get_pipeline.rb +21 -11
  98. data/lib/elasticsearch/api/actions/ingest/params_registry.rb +0 -1
  99. data/lib/elasticsearch/api/actions/ingest/processor_grok.rb +12 -13
  100. data/lib/elasticsearch/api/actions/ingest/put_pipeline.rb +19 -14
  101. data/lib/elasticsearch/api/actions/ingest/simulate.rb +23 -13
  102. data/lib/elasticsearch/api/actions/mget.rb +37 -44
  103. data/lib/elasticsearch/api/actions/msearch.rb +54 -54
  104. data/lib/elasticsearch/api/actions/msearch_template.rb +46 -35
  105. data/lib/elasticsearch/api/actions/mtermvectors.rb +39 -35
  106. data/lib/elasticsearch/api/actions/nodes/hot_threads.rb +30 -25
  107. data/lib/elasticsearch/api/actions/nodes/info.rb +29 -63
  108. data/lib/elasticsearch/api/actions/nodes/params_registry.rb +0 -1
  109. data/lib/elasticsearch/api/actions/nodes/reload_secure_settings.rb +24 -22
  110. data/lib/elasticsearch/api/actions/nodes/shutdown.rb +4 -4
  111. data/lib/elasticsearch/api/actions/nodes/stats.rb +43 -36
  112. data/lib/elasticsearch/api/actions/nodes/usage.rb +31 -10
  113. data/lib/elasticsearch/api/actions/params_registry.rb +0 -1
  114. data/lib/elasticsearch/api/actions/ping.rb +12 -13
  115. data/lib/elasticsearch/api/actions/put_script.rb +26 -30
  116. data/lib/elasticsearch/api/actions/rank_eval.rb +24 -15
  117. data/lib/elasticsearch/api/actions/reindex.rb +25 -48
  118. data/lib/elasticsearch/api/actions/reindex_rethrottle.rb +18 -12
  119. data/lib/elasticsearch/api/actions/remote/info.rb +1 -2
  120. data/lib/elasticsearch/api/actions/render_search_template.rb +17 -15
  121. data/lib/elasticsearch/api/actions/scripts_painless_execute.rb +8 -6
  122. data/lib/elasticsearch/api/actions/scroll.rb +28 -51
  123. data/lib/elasticsearch/api/actions/search.rb +104 -165
  124. data/lib/elasticsearch/api/actions/search_shards.rb +31 -28
  125. data/lib/elasticsearch/api/actions/search_template.rb +48 -40
  126. data/lib/elasticsearch/api/actions/snapshot/cleanup_repository.rb +44 -0
  127. data/lib/elasticsearch/api/actions/snapshot/create.rb +22 -29
  128. data/lib/elasticsearch/api/actions/snapshot/create_repository.rb +19 -24
  129. data/lib/elasticsearch/api/actions/snapshot/delete.rb +20 -22
  130. data/lib/elasticsearch/api/actions/snapshot/delete_repository.rb +16 -18
  131. data/lib/elasticsearch/api/actions/snapshot/get.rb +22 -31
  132. data/lib/elasticsearch/api/actions/snapshot/get_repository.rb +21 -25
  133. data/lib/elasticsearch/api/actions/snapshot/params_registry.rb +0 -1
  134. data/lib/elasticsearch/api/actions/snapshot/restore.rb +21 -32
  135. data/lib/elasticsearch/api/actions/snapshot/status.rb +23 -24
  136. data/lib/elasticsearch/api/actions/snapshot/verify_repository.rb +18 -13
  137. data/lib/elasticsearch/api/actions/tasks/cancel.rb +19 -13
  138. data/lib/elasticsearch/api/actions/tasks/get.rb +16 -13
  139. data/lib/elasticsearch/api/actions/tasks/list.rb +20 -18
  140. data/lib/elasticsearch/api/actions/tasks/params_registry.rb +0 -1
  141. data/lib/elasticsearch/api/actions/termvectors.rb +52 -70
  142. data/lib/elasticsearch/api/actions/update.rb +53 -98
  143. data/lib/elasticsearch/api/actions/update_by_query.rb +77 -66
  144. data/lib/elasticsearch/api/actions/update_by_query_rethrottle.rb +17 -11
  145. data/lib/elasticsearch/api/version.rb +1 -1
  146. data/spec/elasticsearch/api/actions/cat/segments_spec.rb +9 -11
  147. data/spec/elasticsearch/api/actions/cluster/put_settings_spec.rb +1 -1
  148. data/spec/elasticsearch/api/actions/count_spec.rb +8 -8
  149. data/spec/elasticsearch/api/actions/delete_by_query_spec.rb +12 -7
  150. data/spec/elasticsearch/api/actions/delete_script_spec.rb +0 -14
  151. data/spec/elasticsearch/api/actions/exists_document_spec.rb +1 -1
  152. data/spec/elasticsearch/api/actions/get_document_source_spec.rb +1 -1
  153. data/spec/elasticsearch/api/actions/index_document_spec.rb +6 -15
  154. data/spec/elasticsearch/api/actions/indices/analyze_spec.rb +0 -4
  155. data/spec/elasticsearch/api/actions/indices/clear_cache_spec.rb +1 -5
  156. data/spec/elasticsearch/api/actions/indices/clone_spec.rb +109 -0
  157. data/spec/elasticsearch/api/actions/indices/delete_alias_spec.rb +2 -2
  158. data/spec/elasticsearch/api/actions/indices/get_spec.rb +0 -11
  159. data/spec/elasticsearch/api/actions/indices/put_alias_spec.rb +3 -3
  160. data/spec/elasticsearch/api/actions/indices/put_mapping_spec.rb +3 -3
  161. data/spec/elasticsearch/api/actions/indices/stats_spec.rb +0 -1
  162. data/spec/elasticsearch/api/actions/nodes/hot_threads_spec.rb +3 -3
  163. data/spec/elasticsearch/api/actions/put_script_spec.rb +20 -15
  164. data/spec/elasticsearch/api/actions/render_search_template_spec.rb +23 -7
  165. data/spec/elasticsearch/api/actions/scroll_spec.rb +37 -0
  166. data/spec/elasticsearch/api/actions/search_spec.rb +0 -15
  167. data/spec/elasticsearch/api/actions/tasks/list_spec.rb +0 -11
  168. data/spec/elasticsearch/api/actions/update_document_spec.rb +3 -7
  169. data/spec/elasticsearch/api/rest_api_yaml_spec.rb +1 -1
  170. data/spec/rest_yaml_tests_helper.rb +12 -0
  171. data/utils/Gemfile +1 -0
  172. data/utils/Thorfile +0 -1
  173. data/utils/thor/generate_source.rb +192 -85
  174. data/utils/thor/generator/endpoint_specifics.rb +157 -0
  175. data/utils/thor/generator/files_helper.rb +37 -0
  176. data/utils/thor/lister.rb +3 -4
  177. data/utils/thor/templates/_documentation_top.erb +27 -0
  178. data/utils/thor/templates/_method_setup.erb +35 -0
  179. data/utils/thor/templates/_params_registry.erb +12 -0
  180. data/utils/thor/templates/_perform_request.erb +37 -0
  181. data/utils/thor/templates/method.erb +59 -0
  182. data/utils/thor/templates/{ruby/test.erb → test.erb} +0 -0
  183. data/utils/thor/templates/{ruby/test_helper.rb → test_helper.rb} +0 -0
  184. metadata +31 -14
  185. data/spec/elasticsearch/api/actions/scoll_spec.rb +0 -21
  186. data/utils/thor/generate_api.rb +0 -193
  187. data/utils/thor/templates/ruby/method.erb +0 -62
@@ -6,54 +6,52 @@ module Elasticsearch
6
6
  module API
7
7
  module Cat
8
8
  module Actions
9
-
10
- # Return information about field data usage across the cluster
11
- #
12
- # @example Return the total size of field data
13
- #
14
- # client.cat.fielddata
9
+ # Shows how much heap memory is currently being used by fielddata on every data node in the cluster.
15
10
  #
16
- # @example Return both the total size and size for specific fields
17
- #
18
- # client.cat.fielddata fields: 'title,body'
19
- #
20
- # @option arguments [List] :fields A comma-separated list of fields to include in the output
21
- # @option arguments [String] :bytes The unit in which to display byte values (options: b, k, m, g)
22
- # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node
23
- # (default: false)
24
- # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
11
+ # @option arguments [List] :fields A comma-separated list of fields to return the fielddata size
12
+ # @option arguments [String] :format a short version of the Accept header, e.g. json, yaml
13
+ # @option arguments [String] :bytes The unit in which to display byte values
14
+ # (options: b,k,kb,m,mb,g,gb,t,tb,p,pb)
15
+
25
16
  # @option arguments [List] :h Comma-separated list of column names to display
26
17
  # @option arguments [Boolean] :help Return help information
27
- # @option arguments [Boolean] :v Verbose mode. Display column headers
28
18
  # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
19
+ # @option arguments [Boolean] :v Verbose mode. Display column headers
20
+ # @option arguments [List] :fields A comma-separated list of fields to return in the output
21
+
29
22
  #
30
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html
23
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/cat-fielddata.html
31
24
  #
32
- def fielddata(arguments={})
33
- fields = arguments.delete(:fields)
25
+ def fielddata(arguments = {})
26
+ arguments = arguments.clone
34
27
 
35
- method = HTTP_GET
36
- path = Utils.__pathify "_cat/fielddata", Utils.__listify(fields)
28
+ _fields = arguments.delete(:fields)
29
+
30
+ method = Elasticsearch::API::HTTP_GET
31
+ path = if _fields
32
+ "_cat/fielddata/#{Utils.__listify(_fields)}"
33
+ else
34
+ "_cat/fielddata"
35
+ end
37
36
  params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
38
- body = nil
39
37
 
38
+ body = nil
40
39
  perform_request(method, path, params, body).body
41
40
  end
42
41
 
43
42
  # Register this action with its valid params when the module is loaded.
44
43
  #
45
- # @since 6.1.1
44
+ # @since 6.2.0
46
45
  ParamsRegistry.register(:fielddata, [
47
- :format,
48
- :bytes,
49
- :local,
50
- :master_timeout,
51
- :h,
52
- :help,
53
- :s,
54
- :v,
55
- :fields ].freeze)
46
+ :format,
47
+ :bytes,
48
+ :h,
49
+ :help,
50
+ :s,
51
+ :v,
52
+ :fields
53
+ ].freeze)
54
+ end
56
55
  end
57
- end
58
56
  end
59
57
  end
@@ -6,56 +6,46 @@ module Elasticsearch
6
6
  module API
7
7
  module Cat
8
8
  module Actions
9
-
10
- # Display a terse version of the {Elasticsearch::API::Cluster::Actions#health} API output
11
- #
12
- # @example Display cluster health
13
- #
14
- # puts client.cat.health
15
- #
16
- # @example Display header names in the output
17
- #
18
- # puts client.cat.health v: true
19
- #
20
- # @example Return the information as Ruby objects
9
+ # Returns a concise representation of the cluster health.
21
10
  #
22
- # client.cat.health format: 'json'
23
- #
24
- # @option arguments [Boolean] :ts Whether to display timestamp information
25
- # @option arguments [List] :h Comma-separated list of column names to display -- see the `help` argument
26
- # @option arguments [Boolean] :v Display column headers as part of the output
11
+ # @option arguments [String] :format a short version of the Accept header, e.g. json, yaml
12
+ # @option arguments [List] :h Comma-separated list of column names to display
13
+ # @option arguments [Boolean] :help Return help information
27
14
  # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
28
- # @option arguments [String] :format The output format. Options: 'text', 'json'; default: 'text'
29
- # @option arguments [Boolean] :help Return information about headers
30
- # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node
31
- # (default: false)
32
- # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
15
+ # @option arguments [String] :time The unit in which to display time values
16
+ # (options: d (Days),h (Hours),m (Minutes),s (Seconds),ms (Milliseconds),micros (Microseconds),nanos (Nanoseconds))
17
+
18
+ # @option arguments [Boolean] :ts Set to false to disable timestamping
19
+ # @option arguments [Boolean] :v Verbose mode. Display column headers
20
+
33
21
  #
34
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html
22
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/cat-health.html
35
23
  #
36
- def health(arguments={})
37
- method = HTTP_GET
24
+ def health(arguments = {})
25
+ arguments = arguments.clone
26
+
27
+ method = Elasticsearch::API::HTTP_GET
38
28
  path = "_cat/health"
39
- params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
29
+ params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
40
30
  params[:h] = Utils.__listify(params[:h]) if params[:h]
41
- body = nil
42
31
 
32
+ body = nil
43
33
  perform_request(method, path, params, body).body
44
34
  end
45
35
 
46
36
  # Register this action with its valid params when the module is loaded.
47
37
  #
48
- # @since 6.1.1
38
+ # @since 6.2.0
49
39
  ParamsRegistry.register(:health, [
50
- :format,
51
- :local,
52
- :master_timeout,
53
- :h,
54
- :help,
55
- :s,
56
- :ts,
57
- :v ].freeze)
40
+ :format,
41
+ :h,
42
+ :help,
43
+ :s,
44
+ :time,
45
+ :ts,
46
+ :v
47
+ ].freeze)
48
+ end
58
49
  end
59
- end
60
50
  end
61
51
  end
@@ -6,29 +6,33 @@ module Elasticsearch
6
6
  module API
7
7
  module Cat
8
8
  module Actions
9
-
10
- # Help information for the Cat API
9
+ # Returns help for the Cat APIs.
11
10
  #
12
11
  # @option arguments [Boolean] :help Return help information
12
+ # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
13
+
13
14
  #
14
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html
15
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/cat.html
15
16
  #
16
- def help(arguments={})
17
- method = HTTP_GET
17
+ def help(arguments = {})
18
+ arguments = arguments.clone
19
+
20
+ method = Elasticsearch::API::HTTP_GET
18
21
  path = "_cat"
19
22
  params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
20
- body = nil
21
23
 
24
+ body = nil
22
25
  perform_request(method, path, params, body).body
23
26
  end
24
27
 
25
28
  # Register this action with its valid params when the module is loaded.
26
29
  #
27
- # @since 6.1.1
30
+ # @since 6.2.0
28
31
  ParamsRegistry.register(:help, [
29
- :help,
30
- :s ].freeze)
32
+ :help,
33
+ :s
34
+ ].freeze)
35
+ end
31
36
  end
32
- end
33
37
  end
34
38
  end
@@ -6,84 +6,67 @@ module Elasticsearch
6
6
  module API
7
7
  module Cat
8
8
  module Actions
9
-
10
- # Return the most important statistics about indices, across the cluster nodes
11
- #
12
- # Use the `help` parameter to display available statistics.
13
- #
14
- # @example Display information for all indices
15
- #
16
- # puts client.cat.indices
17
- #
18
- # @example Display information for a specific index
19
- #
20
- # puts client.cat.indices index: 'index-a'
21
- #
22
- # @example Display information for indices matching a pattern
23
- #
24
- # puts client.cat.indices index: 'index-*'
25
- #
26
- # @example Display header names in the output
27
- #
28
- # puts client.cat.indices v: true
29
- #
30
- # @example Display only specific columns in the output (see the `help` parameter)
31
- #
32
- # puts client.cat.indices h: ['index', 'docs.count', 'fielddata.memory_size', 'filter_cache.memory_size']
33
- #
34
- # @example Display only specific columns in the output, using the short names
35
- #
36
- # puts client.cat.indices h: 'i,dc,ss,mt', v: true
37
- #
38
- # @example Return the information as Ruby objects
39
- #
40
- # client.cat.indices format: 'json'
9
+ # Returns information about indices: number of primaries and replicas, document counts, disk size, ...
41
10
  #
42
11
  # @option arguments [List] :index A comma-separated list of index names to limit the returned information
43
- # @option arguments [String] :bytes The unit in which to display byte values (options: b, k, m, g)
44
- # @option arguments [Boolean] :pri Limit the returned information on primary shards only (default: false)
45
- # @option arguments [List] :h Comma-separated list of column names to display -- see the `help` argument
46
- # @option arguments [Boolean] :v Display column headers as part of the output
47
- # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
48
- # @option arguments [String] :health A health status ("green", "yellow", or "red" to filter only indices
49
- # matching the specified health status (options: green, yellow, red)
50
- # @option arguments [String] :format The output format. Options: 'text', 'json'; default: 'text'
51
- # @option arguments [Boolean] :help Return information about headers
52
- # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node
53
- # (default: false)
12
+ # @option arguments [String] :format a short version of the Accept header, e.g. json, yaml
13
+ # @option arguments [String] :bytes The unit in which to display byte values
14
+ # (options: b,k,m,g)
15
+
16
+ # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false)
54
17
  # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
18
+ # @option arguments [List] :h Comma-separated list of column names to display
19
+ # @option arguments [String] :health A health status ("green", "yellow", or "red" to filter only indices matching the specified health status
20
+ # (options: green,yellow,red)
21
+
22
+ # @option arguments [Boolean] :help Return help information
23
+ # @option arguments [Boolean] :pri Set to true to return stats only for primary shards
24
+ # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
25
+ # @option arguments [String] :time The unit in which to display time values
26
+ # (options: d (Days),h (Hours),m (Minutes),s (Seconds),ms (Milliseconds),micros (Microseconds),nanos (Nanoseconds))
27
+
28
+ # @option arguments [Boolean] :v Verbose mode. Display column headers
29
+ # @option arguments [Boolean] :include_unloaded_segments If set to true segment stats will include stats for segments that are not currently loaded into memory
30
+
55
31
  #
56
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html
32
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/cat-indices.html
57
33
  #
58
- def indices(arguments={})
59
- index = arguments.delete(:index)
60
- method = HTTP_GET
34
+ def indices(arguments = {})
35
+ arguments = arguments.clone
61
36
 
62
- path = Utils.__pathify '_cat/indices', Utils.__listify(index)
37
+ _index = arguments.delete(:index)
63
38
 
39
+ method = Elasticsearch::API::HTTP_GET
40
+ path = if _index
41
+ "_cat/indices/#{Utils.__listify(_index)}"
42
+ else
43
+ "_cat/indices"
44
+ end
64
45
  params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
65
46
  params[:h] = Utils.__listify(params[:h]) if params[:h]
66
47
 
67
- body = nil
68
-
48
+ body = nil
69
49
  perform_request(method, path, params, body).body
70
50
  end
71
51
 
72
52
  # Register this action with its valid params when the module is loaded.
73
53
  #
74
- # @since 6.1.1
54
+ # @since 6.2.0
75
55
  ParamsRegistry.register(:indices, [
76
- :format,
77
- :bytes,
78
- :local,
79
- :master_timeout,
80
- :h,
81
- :health,
82
- :help,
83
- :pri,
84
- :s,
85
- :v ].freeze)
56
+ :format,
57
+ :bytes,
58
+ :local,
59
+ :master_timeout,
60
+ :h,
61
+ :health,
62
+ :help,
63
+ :pri,
64
+ :s,
65
+ :time,
66
+ :v,
67
+ :include_unloaded_segments
68
+ ].freeze)
69
+ end
86
70
  end
87
- end
88
71
  end
89
72
  end
@@ -6,53 +6,43 @@ module Elasticsearch
6
6
  module API
7
7
  module Cat
8
8
  module Actions
9
-
10
- # Display basic information about the master node
11
- #
12
- # @example
13
- #
14
- # puts client.cat.master
15
- #
16
- # @example Display header names in the output
17
- #
18
- # puts client.cat.master v: true
19
- #
20
- # @example Return the information as Ruby objects
9
+ # Returns information about the master node.
21
10
  #
22
- # client.cat.master format: 'json'
23
- #
24
- # @option arguments [List] :h Comma-separated list of column names to display -- see the `help` argument
25
- # @option arguments [Boolean] :v Display column headers as part of the output
26
- # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
27
- # @option arguments [String] :format The output format. Options: 'text', 'json'; default: 'text'
28
- # @option arguments [Boolean] :help Return information about headers
29
- # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node
30
- # (default: false)
11
+ # @option arguments [String] :format a short version of the Accept header, e.g. json, yaml
12
+ # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false)
31
13
  # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
14
+ # @option arguments [List] :h Comma-separated list of column names to display
15
+ # @option arguments [Boolean] :help Return help information
16
+ # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
17
+ # @option arguments [Boolean] :v Verbose mode. Display column headers
18
+
32
19
  #
33
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html
20
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/cat-master.html
34
21
  #
35
- def master(arguments={})
36
- method = HTTP_GET
22
+ def master(arguments = {})
23
+ arguments = arguments.clone
24
+
25
+ method = Elasticsearch::API::HTTP_GET
37
26
  path = "_cat/master"
38
27
  params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
39
- body = nil
40
28
 
29
+ body = nil
41
30
  perform_request(method, path, params, body).body
42
31
  end
43
32
 
44
33
  # Register this action with its valid params when the module is loaded.
45
34
  #
46
- # @since 6.1.1
35
+ # @since 6.2.0
47
36
  ParamsRegistry.register(:master, [
48
- :format,
49
- :local,
50
- :master_timeout,
51
- :h,
52
- :help,
53
- :s,
54
- :v ].freeze)
37
+ :format,
38
+ :local,
39
+ :master_timeout,
40
+ :h,
41
+ :help,
42
+ :s,
43
+ :v
44
+ ].freeze)
45
+ end
55
46
  end
56
- end
57
47
  end
58
48
  end
@@ -6,39 +6,43 @@ module Elasticsearch
6
6
  module API
7
7
  module Cat
8
8
  module Actions
9
-
10
- # Display custom node attributes
9
+ # Returns information about custom node attributes.
11
10
  #
11
+ # @option arguments [String] :format a short version of the Accept header, e.g. json, yaml
12
12
  # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false)
13
13
  # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
14
14
  # @option arguments [List] :h Comma-separated list of column names to display
15
15
  # @option arguments [Boolean] :help Return help information
16
- # @option arguments [Boolean] :v Verbose mode. Display column headers
17
16
  # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
17
+ # @option arguments [Boolean] :v Verbose mode. Display column headers
18
+
18
19
  #
19
- # @see http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html
20
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/cat-nodeattrs.html
20
21
  #
21
- def nodeattrs(arguments={})
22
- method = 'GET'
22
+ def nodeattrs(arguments = {})
23
+ arguments = arguments.clone
24
+
25
+ method = Elasticsearch::API::HTTP_GET
23
26
  path = "_cat/nodeattrs"
24
27
  params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
25
- body = nil
26
28
 
29
+ body = nil
27
30
  perform_request(method, path, params, body).body
28
31
  end
29
32
 
30
33
  # Register this action with its valid params when the module is loaded.
31
34
  #
32
- # @since 6.1.1
35
+ # @since 6.2.0
33
36
  ParamsRegistry.register(:nodeattrs, [
34
- :format,
35
- :local,
36
- :master_timeout,
37
- :h,
38
- :help,
39
- :s,
40
- :v ].freeze)
37
+ :format,
38
+ :local,
39
+ :master_timeout,
40
+ :h,
41
+ :help,
42
+ :s,
43
+ :v
44
+ ].freeze)
45
+ end
41
46
  end
42
- end
43
47
  end
44
48
  end
@@ -6,66 +6,54 @@ module Elasticsearch
6
6
  module API
7
7
  module Cat
8
8
  module Actions
9
-
10
- # Display information about cluster topology and nodes statistics
11
- #
12
- # @example Display basic information about nodes in the cluster (host, node name, memory usage, master, etc.)
13
- #
14
- # puts client.cat.nodes
15
- #
16
- # @example Display header names in the output
17
- #
18
- # puts client.cat.nodes v: true
19
- #
20
- # @example Display only specific columns in the output (see the `help` parameter)
21
- #
22
- # puts client.cat.nodes h: %w(name version jdk disk.avail heap.percent load merges.total_time), v: true
23
- #
24
- # @example Display only specific columns in the output, using the short names
25
- #
26
- # puts client.cat.nodes h: 'n,v,j,d,hp,l,mtt', v: true
27
- #
28
- # @example Return the information as Ruby objects
29
- #
30
- # client.cat.nodes format: 'json'
9
+ # Returns basic statistics about performance of cluster nodes.
31
10
  #
11
+ # @option arguments [String] :bytes The unit in which to display byte values
12
+ # (options: b,k,kb,m,mb,g,gb,t,tb,p,pb)
13
+
14
+ # @option arguments [String] :format a short version of the Accept header, e.g. json, yaml
32
15
  # @option arguments [Boolean] :full_id Return the full node ID instead of the shortened version (default: false)
33
- # @option arguments [List] :h Comma-separated list of column names to display -- see the `help` argument
34
- # @option arguments [Boolean] :v Display column headers as part of the output
35
- # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
36
- # @option arguments [String] :format The output format. Options: 'text', 'json'; default: 'text'
37
- # @option arguments [Boolean] :help Return information about headers
38
- # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node
39
- # (default: false)
16
+ # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false)
40
17
  # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
18
+ # @option arguments [List] :h Comma-separated list of column names to display
19
+ # @option arguments [Boolean] :help Return help information
20
+ # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
21
+ # @option arguments [String] :time The unit in which to display time values
22
+ # (options: d (Days),h (Hours),m (Minutes),s (Seconds),ms (Milliseconds),micros (Microseconds),nanos (Nanoseconds))
23
+
24
+ # @option arguments [Boolean] :v Verbose mode. Display column headers
25
+
41
26
  #
42
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodes.html
27
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/cat-nodes.html
43
28
  #
44
- def nodes(arguments={})
45
- method = HTTP_GET
46
- path = "_cat/nodes"
29
+ def nodes(arguments = {})
30
+ arguments = arguments.clone
47
31
 
32
+ method = Elasticsearch::API::HTTP_GET
33
+ path = "_cat/nodes"
48
34
  params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
49
- params[:h] = Utils.__listify(params[:h], :escape => false) if params[:h]
50
-
51
- body = nil
35
+ params[:h] = Utils.__listify(params[:h], escape: false) if params[:h]
52
36
 
37
+ body = nil
53
38
  perform_request(method, path, params, body).body
54
39
  end
55
40
 
56
41
  # Register this action with its valid params when the module is loaded.
57
42
  #
58
- # @since 6.1.1
43
+ # @since 6.2.0
59
44
  ParamsRegistry.register(:nodes, [
60
- :format,
61
- :full_id,
62
- :local,
63
- :master_timeout,
64
- :h,
65
- :help,
66
- :s,
67
- :v ].freeze)
45
+ :bytes,
46
+ :format,
47
+ :full_id,
48
+ :local,
49
+ :master_timeout,
50
+ :h,
51
+ :help,
52
+ :s,
53
+ :time,
54
+ :v
55
+ ].freeze)
56
+ end
68
57
  end
69
- end
70
58
  end
71
59
  end
@@ -7,7 +7,6 @@ module Elasticsearch
7
7
  module Cat
8
8
  module Actions
9
9
  module ParamsRegistry
10
-
11
10
  extend self
12
11
 
13
12
  # A Mapping of all the actions to their list of valid params.