elasticsearch-api 1.0.6 → 1.0.7

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.
Files changed (136) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +16 -0
  3. data/Rakefile +3 -3
  4. data/elasticsearch-api.gemspec +4 -1
  5. data/lib/elasticsearch/api.rb +19 -0
  6. data/lib/elasticsearch/api/actions/abort_benchmark.rb +1 -1
  7. data/lib/elasticsearch/api/actions/benchmark.rb +1 -1
  8. data/lib/elasticsearch/api/actions/bulk.rb +1 -1
  9. data/lib/elasticsearch/api/actions/cat/aliases.rb +1 -1
  10. data/lib/elasticsearch/api/actions/cat/allocation.rb +1 -1
  11. data/lib/elasticsearch/api/actions/cat/count.rb +1 -1
  12. data/lib/elasticsearch/api/actions/cat/fielddata.rb +1 -1
  13. data/lib/elasticsearch/api/actions/cat/health.rb +1 -1
  14. data/lib/elasticsearch/api/actions/cat/help.rb +1 -1
  15. data/lib/elasticsearch/api/actions/cat/indices.rb +1 -1
  16. data/lib/elasticsearch/api/actions/cat/master.rb +1 -1
  17. data/lib/elasticsearch/api/actions/cat/nodes.rb +1 -1
  18. data/lib/elasticsearch/api/actions/cat/pending_tasks.rb +1 -1
  19. data/lib/elasticsearch/api/actions/cat/recovery.rb +1 -1
  20. data/lib/elasticsearch/api/actions/cat/segments.rb +34 -0
  21. data/lib/elasticsearch/api/actions/cat/shards.rb +1 -1
  22. data/lib/elasticsearch/api/actions/cat/thread_pool.rb +1 -1
  23. data/lib/elasticsearch/api/actions/clear_scroll.rb +12 -3
  24. data/lib/elasticsearch/api/actions/cluster/get_settings.rb +1 -1
  25. data/lib/elasticsearch/api/actions/cluster/health.rb +1 -1
  26. data/lib/elasticsearch/api/actions/cluster/pending_tasks.rb +1 -1
  27. data/lib/elasticsearch/api/actions/cluster/put_settings.rb +1 -1
  28. data/lib/elasticsearch/api/actions/cluster/reroute.rb +1 -1
  29. data/lib/elasticsearch/api/actions/cluster/state.rb +8 -2
  30. data/lib/elasticsearch/api/actions/count.rb +1 -1
  31. data/lib/elasticsearch/api/actions/count_percolate.rb +1 -1
  32. data/lib/elasticsearch/api/actions/delete.rb +1 -1
  33. data/lib/elasticsearch/api/actions/delete_by_query.rb +1 -1
  34. data/lib/elasticsearch/api/actions/delete_script.rb +1 -1
  35. data/lib/elasticsearch/api/actions/delete_template.rb +1 -1
  36. data/lib/elasticsearch/api/actions/exists.rb +4 -2
  37. data/lib/elasticsearch/api/actions/explain.rb +1 -1
  38. data/lib/elasticsearch/api/actions/get.rb +2 -2
  39. data/lib/elasticsearch/api/actions/get_script.rb +1 -1
  40. data/lib/elasticsearch/api/actions/get_source.rb +2 -2
  41. data/lib/elasticsearch/api/actions/get_template.rb +1 -1
  42. data/lib/elasticsearch/api/actions/index.rb +1 -1
  43. data/lib/elasticsearch/api/actions/indices/analyze.rb +5 -3
  44. data/lib/elasticsearch/api/actions/indices/clear_cache.rb +1 -1
  45. data/lib/elasticsearch/api/actions/indices/close.rb +1 -1
  46. data/lib/elasticsearch/api/actions/indices/create.rb +1 -1
  47. data/lib/elasticsearch/api/actions/indices/delete.rb +7 -1
  48. data/lib/elasticsearch/api/actions/indices/delete_alias.rb +1 -1
  49. data/lib/elasticsearch/api/actions/indices/delete_mapping.rb +1 -1
  50. data/lib/elasticsearch/api/actions/indices/delete_template.rb +1 -1
  51. data/lib/elasticsearch/api/actions/indices/delete_warmer.rb +1 -1
  52. data/lib/elasticsearch/api/actions/indices/exists.rb +3 -1
  53. data/lib/elasticsearch/api/actions/indices/exists_alias.rb +3 -1
  54. data/lib/elasticsearch/api/actions/indices/exists_template.rb +3 -2
  55. data/lib/elasticsearch/api/actions/indices/exists_type.rb +3 -1
  56. data/lib/elasticsearch/api/actions/indices/flush.rb +1 -1
  57. data/lib/elasticsearch/api/actions/indices/get.rb +1 -1
  58. data/lib/elasticsearch/api/actions/indices/get_alias.rb +1 -1
  59. data/lib/elasticsearch/api/actions/indices/get_aliases.rb +1 -1
  60. data/lib/elasticsearch/api/actions/indices/get_field_mapping.rb +1 -1
  61. data/lib/elasticsearch/api/actions/indices/get_mapping.rb +1 -1
  62. data/lib/elasticsearch/api/actions/indices/get_settings.rb +1 -1
  63. data/lib/elasticsearch/api/actions/indices/get_template.rb +3 -2
  64. data/lib/elasticsearch/api/actions/indices/get_warmer.rb +1 -1
  65. data/lib/elasticsearch/api/actions/indices/open.rb +1 -1
  66. data/lib/elasticsearch/api/actions/indices/optimize.rb +1 -1
  67. data/lib/elasticsearch/api/actions/indices/put_alias.rb +2 -2
  68. data/lib/elasticsearch/api/actions/indices/put_mapping.rb +1 -1
  69. data/lib/elasticsearch/api/actions/indices/put_settings.rb +1 -1
  70. data/lib/elasticsearch/api/actions/indices/put_template.rb +1 -1
  71. data/lib/elasticsearch/api/actions/indices/put_warmer.rb +1 -1
  72. data/lib/elasticsearch/api/actions/indices/recovery.rb +1 -1
  73. data/lib/elasticsearch/api/actions/indices/refresh.rb +1 -1
  74. data/lib/elasticsearch/api/actions/indices/segments.rb +1 -1
  75. data/lib/elasticsearch/api/actions/indices/snapshot_index.rb +1 -1
  76. data/lib/elasticsearch/api/actions/indices/stats.rb +1 -1
  77. data/lib/elasticsearch/api/actions/indices/status.rb +1 -1
  78. data/lib/elasticsearch/api/actions/indices/update_aliases.rb +1 -1
  79. data/lib/elasticsearch/api/actions/indices/upgrade.rb +1 -1
  80. data/lib/elasticsearch/api/actions/indices/validate_query.rb +1 -1
  81. data/lib/elasticsearch/api/actions/info.rb +1 -1
  82. data/lib/elasticsearch/api/actions/list_benchmarks.rb +1 -1
  83. data/lib/elasticsearch/api/actions/mget.rb +1 -1
  84. data/lib/elasticsearch/api/actions/mlt.rb +1 -1
  85. data/lib/elasticsearch/api/actions/mpercolate.rb +1 -1
  86. data/lib/elasticsearch/api/actions/msearch.rb +1 -1
  87. data/lib/elasticsearch/api/actions/mtermvectors.rb +1 -1
  88. data/lib/elasticsearch/api/actions/nodes/hot_threads.rb +1 -1
  89. data/lib/elasticsearch/api/actions/nodes/info.rb +18 -2
  90. data/lib/elasticsearch/api/actions/nodes/shutdown.rb +1 -1
  91. data/lib/elasticsearch/api/actions/nodes/stats.rb +1 -1
  92. data/lib/elasticsearch/api/actions/percolate.rb +4 -5
  93. data/lib/elasticsearch/api/actions/ping.rb +1 -1
  94. data/lib/elasticsearch/api/actions/put_script.rb +1 -1
  95. data/lib/elasticsearch/api/actions/put_template.rb +1 -1
  96. data/lib/elasticsearch/api/actions/scroll.rb +2 -2
  97. data/lib/elasticsearch/api/actions/search.rb +4 -3
  98. data/lib/elasticsearch/api/actions/search_shards.rb +1 -1
  99. data/lib/elasticsearch/api/actions/search_template.rb +1 -1
  100. data/lib/elasticsearch/api/actions/snapshot/create.rb +1 -1
  101. data/lib/elasticsearch/api/actions/snapshot/create_repository.rb +1 -1
  102. data/lib/elasticsearch/api/actions/snapshot/delete.rb +1 -1
  103. data/lib/elasticsearch/api/actions/snapshot/delete_repository.rb +1 -1
  104. data/lib/elasticsearch/api/actions/snapshot/get.rb +1 -1
  105. data/lib/elasticsearch/api/actions/snapshot/get_repository.rb +1 -1
  106. data/lib/elasticsearch/api/actions/snapshot/restore.rb +1 -1
  107. data/lib/elasticsearch/api/actions/snapshot/status.rb +1 -1
  108. data/lib/elasticsearch/api/actions/snapshot/verify_repository.rb +1 -1
  109. data/lib/elasticsearch/api/actions/suggest.rb +1 -1
  110. data/lib/elasticsearch/api/actions/{termvector.rb → termvectors.rb} +24 -7
  111. data/lib/elasticsearch/api/actions/update.rb +1 -1
  112. data/lib/elasticsearch/api/utils.rb +27 -6
  113. data/lib/elasticsearch/api/version.rb +1 -1
  114. data/test/integration/yaml_test_runner.rb +3 -2
  115. data/test/unit/api_test.rb +24 -0
  116. data/test/unit/cat/segments_test.rb +26 -0
  117. data/test/unit/clear_scroll_test.rb +4 -4
  118. data/test/unit/exists_document_test.rb +5 -0
  119. data/test/unit/indices/delete_test.rb +7 -0
  120. data/test/unit/indices/exists_alias_test.rb +5 -0
  121. data/test/unit/indices/exists_test.rb +5 -0
  122. data/test/unit/indices/exists_type_test.rb +5 -0
  123. data/test/unit/indices/put_alias_test.rb +9 -0
  124. data/test/unit/nodes/info_test.rb +9 -0
  125. data/test/unit/scroll_test.rb +1 -2
  126. data/test/unit/{termvector_test.rb → termvectors_test.rb} +15 -12
  127. data/test/unit/utils_test.rb +22 -0
  128. data/utils/Gemfile +9 -0
  129. data/utils/Thorfile +3 -0
  130. data/utils/thor/generate_api.rb +189 -0
  131. data/utils/thor/generate_source.rb +122 -0
  132. data/utils/thor/lister.rb +41 -0
  133. data/utils/thor/templates/ruby/method.erb +62 -0
  134. data/utils/thor/templates/ruby/test.erb +26 -0
  135. data/utils/thor/templates/ruby/test_helper.rb +71 -0
  136. metadata +18 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b1554532d71fd5117adb7ac3122e6511562ca46b
4
- data.tar.gz: afd742d0f2bda5ef8b46ded7bc55f1a2f3db27a1
3
+ metadata.gz: 25fb9700e6298b2c6a37cd1a114041689e9cbfd4
4
+ data.tar.gz: c04e61a9efce06dbecdec9f45681259dc3a26ff5
5
5
  SHA512:
6
- metadata.gz: a46bcd15c661d6fff1d90eab4ec2d950b992f17e71e89515d9090d6166f6263b6d7a6df079ba78f634c162b03abb0c4881adc0bd2cd8ace5c0b77b1a5302e3af
7
- data.tar.gz: 16b84a016789792774afa4cb84107b69ae4483ac31949c2efa0bd491041fe1bb81f34928fb9287b1e4afa9f35b9e67782d022c87e6887646ef040a775287bcb6
6
+ metadata.gz: 570c0084b961fccc4741ba790dc93edef6562027c531c3019535143c2e1161dcfbb064058eb55016afce2bced5a70126c7a24e062728ae5e44be8ff9d01bc661
7
+ data.tar.gz: bbe4bc6dd89766e037af5ac4ac38abd80f7df830caf3a75f221a5874266cc0275f6a6ba4e1028a1893a4788dd1a184043e1dca95f384686addf90aec3ee37750
data/README.md CHANGED
@@ -155,6 +155,22 @@ mash.facets.tags.terms.first
155
155
  # => #<Hashie::Mash count=3 term="z">
156
156
  ```
157
157
 
158
+ ## Development
159
+
160
+ To work on the code, clone and bootstrap the main repository first --
161
+ please see instructions in the main [README](../README.md#development).
162
+
163
+ To run tests, launch a testing cluster -- again, see instructions
164
+ in the main [README](../README.md#development) -- and use the Rake tasks:
165
+
166
+ ```
167
+ time rake test:unit
168
+ time rake test:integration
169
+ ```
170
+
171
+ Unit tests have to use Ruby 1.8 compatible syntax, integration tests
172
+ can use Ruby 2.x syntax and features.
173
+
158
174
  ## License
159
175
 
160
176
  This software is licensed under the Apache 2 license, quoted below.
data/Rakefile CHANGED
@@ -5,7 +5,7 @@ def __current__
5
5
  end
6
6
 
7
7
  def git_specs(command, options={})
8
- sh "git --git-dir=#{__current__.join('../support/elasticsearch/.git')} --work-tree=#{__current__.join('../support/elasticsearch')} #{command}", options
8
+ sh "git --git-dir=#{__current__.join('../tmp/elasticsearch/.git')} --work-tree=#{__current__.join('../tmp/elasticsearch')} #{command}", options
9
9
  end
10
10
 
11
11
  task(:default) { system "rake --tasks" }
@@ -44,7 +44,7 @@ namespace :test do
44
44
  task :integration do
45
45
  require 'elasticsearch'
46
46
 
47
- branches = `git --git-dir=#{__current__.join('../support/elasticsearch/.git')} --work-tree=#{__current__.join('../support/elasticsearch')} branch --no-color`
47
+ branches = `git --git-dir=#{__current__.join('../tmp/elasticsearch/.git')} --work-tree=#{__current__.join('../tmp/elasticsearch')} branch --no-color`
48
48
 
49
49
  current_branch = branches.
50
50
  split("\n").
@@ -98,7 +98,7 @@ namespace :test do
98
98
  end
99
99
 
100
100
  # Path to the API specs
101
- ENV['TEST_REST_API_SPEC'] = __current__.join('../support/elasticsearch/rest-api-spec/test/').to_s
101
+ ENV['TEST_REST_API_SPEC'] = __current__.join('../tmp/elasticsearch/rest-api-spec/test/').to_s
102
102
 
103
103
  # Run the task
104
104
  args = [t.ruby_opts_string, t.run_code, t.file_list_string, t.option_list].join(' ')
@@ -48,7 +48,6 @@ Gem::Specification.new do |s|
48
48
  # Prevent unit test failures on Ruby 1.8
49
49
  if defined?(RUBY_VERSION) && RUBY_VERSION < '1.9'
50
50
  s.add_development_dependency "test-unit", '~> 2'
51
- s.add_development_dependency "activesupport", '~> 3'
52
51
  s.add_development_dependency "json"
53
52
  end
54
53
 
@@ -62,6 +61,10 @@ Gem::Specification.new do |s|
62
61
  s.add_development_dependency "require-prof" unless defined?(JRUBY_VERSION) || defined?(Rubinius)
63
62
  end
64
63
 
64
+ if defined?(RUBY_VERSION) && RUBY_VERSION > '2.2'
65
+ s.add_development_dependency "test-unit", '~> 2'
66
+ end
67
+
65
68
  s.description = <<-DESC.gsub(/^ /, '')
66
69
  Ruby API for Elasticsearch. See the `elasticsearch` gem for full integration.
67
70
  DESC
@@ -25,6 +25,14 @@ module Elasticsearch
25
25
  :human # Return numeric values in human readable format
26
26
  ]
27
27
 
28
+ HTTP_GET = 'GET'.freeze
29
+ HTTP_HEAD = 'HEAD'.freeze
30
+ HTTP_POST = 'POST'.freeze
31
+ HTTP_PUT = 'PUT'.freeze
32
+ HTTP_DELETE = 'DELETE'.freeze
33
+ UNDERSCORE_SEARCH = '_search'.freeze
34
+ UNDERSCORE_ALL = '_all'.freeze
35
+
28
36
  # Auto-include all namespaces in the receiver
29
37
  #
30
38
  def self.included(base)
@@ -37,5 +45,16 @@ module Elasticsearch
37
45
  Elasticsearch::API::Snapshot,
38
46
  Elasticsearch::API::Cat
39
47
  end
48
+
49
+ module ClassMethods
50
+
51
+ # Access the module settings
52
+ #
53
+ def settings
54
+ @settings ||= {}
55
+ end
56
+ end
57
+
58
+ extend ClassMethods
40
59
  end
41
60
  end
@@ -15,7 +15,7 @@ module Elasticsearch
15
15
  def abort_benchmark(arguments={})
16
16
  valid_params = [
17
17
  ]
18
- method = 'POST'
18
+ method = HTTP_POST
19
19
  path = "_bench/abort/#{arguments[:name]}"
20
20
  params = {}
21
21
  body = nil
@@ -50,7 +50,7 @@ module Elasticsearch
50
50
  def benchmark(arguments={})
51
51
  valid_params = [
52
52
  :verbose ]
53
- method = 'PUT'
53
+ method = HTTP_PUT
54
54
  path = "_bench"
55
55
  params = Utils.__validate_and_extract_params arguments, valid_params
56
56
  body = arguments[:body]
@@ -65,7 +65,7 @@ module Elasticsearch
65
65
  :type,
66
66
  :timeout ]
67
67
 
68
- method = 'POST'
68
+ method = HTTP_POST
69
69
  path = Utils.__pathify Utils.__escape(arguments[:index]), Utils.__escape(arguments[:type]), '_bulk'
70
70
 
71
71
  params = Utils.__validate_and_extract_params arguments, valid_params
@@ -50,7 +50,7 @@ module Elasticsearch
50
50
 
51
51
  name = arguments.delete(:name)
52
52
 
53
- method = 'GET'
53
+ method = HTTP_GET
54
54
 
55
55
  path = Utils.__pathify '_cat/aliases', Utils.__listify(name)
56
56
 
@@ -52,7 +52,7 @@ module Elasticsearch
52
52
 
53
53
  node_id = arguments.delete(:node_id)
54
54
 
55
- method = 'GET'
55
+ method = HTTP_GET
56
56
 
57
57
  path = Utils.__pathify '_cat/allocation', Utils.__listify(node_id)
58
58
 
@@ -46,7 +46,7 @@ module Elasticsearch
46
46
 
47
47
  index = arguments.delete(:index)
48
48
 
49
- method = 'GET'
49
+ method = HTTP_GET
50
50
 
51
51
  path = Utils.__pathify '_cat/count', Utils.__listify(index)
52
52
 
@@ -36,7 +36,7 @@ module Elasticsearch
36
36
 
37
37
  fields = arguments.delete(:fields)
38
38
 
39
- method = 'GET'
39
+ method = HTTP_GET
40
40
  path = Utils.__pathify "_cat/fielddata", Utils.__listify(fields)
41
41
  params = Utils.__validate_and_extract_params arguments, valid_params
42
42
  body = nil
@@ -37,7 +37,7 @@ module Elasticsearch
37
37
  :ts,
38
38
  :v ]
39
39
 
40
- method = 'GET'
40
+ method = HTTP_GET
41
41
  path = "_cat/health"
42
42
  params = Utils.__validate_and_extract_params arguments, valid_params
43
43
  params[:h] = Utils.__listify(params[:h]) if params[:h]
@@ -12,7 +12,7 @@ module Elasticsearch
12
12
  def help(arguments={})
13
13
  valid_params = [
14
14
  :help ]
15
- method = 'GET'
15
+ method = HTTP_GET
16
16
  path = "_cat"
17
17
  params = Utils.__validate_and_extract_params arguments, valid_params
18
18
  body = nil
@@ -60,7 +60,7 @@ module Elasticsearch
60
60
 
61
61
  index = arguments.delete(:index)
62
62
 
63
- method = 'GET'
63
+ method = HTTP_GET
64
64
 
65
65
  path = Utils.__pathify '_cat/indices', Utils.__listify(index)
66
66
 
@@ -35,7 +35,7 @@ module Elasticsearch
35
35
  :help,
36
36
  :v ]
37
37
 
38
- method = 'GET'
38
+ method = HTTP_GET
39
39
  path = "_cat/master"
40
40
  params = Utils.__validate_and_extract_params arguments, valid_params
41
41
  body = nil
@@ -43,7 +43,7 @@ module Elasticsearch
43
43
  :help,
44
44
  :v ]
45
45
 
46
- method = 'GET'
46
+ method = HTTP_GET
47
47
  path = "_cat/nodes"
48
48
 
49
49
  params = Utils.__validate_and_extract_params arguments, valid_params
@@ -35,7 +35,7 @@ module Elasticsearch
35
35
  :help,
36
36
  :v ]
37
37
 
38
- method = 'GET'
38
+ method = HTTP_GET
39
39
  path = "_cat/pending_tasks"
40
40
  params = Utils.__validate_and_extract_params arguments, valid_params
41
41
  params[:h] = Utils.__listify(params[:h]) if params[:h]
@@ -56,7 +56,7 @@ module Elasticsearch
56
56
 
57
57
  index = arguments.delete(:index)
58
58
 
59
- method = 'GET'
59
+ method = HTTP_GET
60
60
 
61
61
  path = Utils.__pathify '_cat/recovery', Utils.__listify(index)
62
62
 
@@ -0,0 +1,34 @@
1
+ module Elasticsearch
2
+ module API
3
+ module Cat
4
+ module Actions
5
+
6
+ # Display information about the segments in the shards of an index
7
+ #
8
+ # @example Display information for all indices
9
+ #
10
+ # puts client.cat.segments
11
+ #
12
+ # @option arguments [List] :index A comma-separated list of index names to limit the returned information
13
+ # @option arguments [List] :h Comma-separated list of column names to display
14
+ # @option arguments [Boolean] :help Return help information
15
+ # @option arguments [Boolean] :v Verbose mode. Display column headers
16
+ #
17
+ # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/cat-segments.html
18
+ #
19
+ def segments(arguments={})
20
+ valid_params = [
21
+ :h,
22
+ :help,
23
+ :v ]
24
+ method = 'GET'
25
+ path = "_cat/segments"
26
+ params = Utils.__validate_and_extract_params arguments, valid_params
27
+ body = nil
28
+
29
+ perform_request(method, path, params, body).body
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -55,7 +55,7 @@ module Elasticsearch
55
55
 
56
56
  index = arguments.delete(:index)
57
57
 
58
- method = 'GET'
58
+ method = HTTP_GET
59
59
 
60
60
  path = Utils.__pathify '_cat/shards', Utils.__listify(index)
61
61
 
@@ -42,7 +42,7 @@ module Elasticsearch
42
42
  :help,
43
43
  :v ]
44
44
 
45
- method = 'GET'
45
+ method = HTTP_GET
46
46
  path = "_cat/thread_pool"
47
47
  params = Utils.__validate_and_extract_params arguments, valid_params
48
48
  params[:h] = Utils.__listify(params[:h]) if params[:h]
@@ -12,10 +12,19 @@ module Elasticsearch
12
12
  def clear_scroll(arguments={})
13
13
  raise ArgumentError, "Required argument 'scroll_id' missing" unless arguments[:scroll_id]
14
14
 
15
- method = 'DELETE'
16
- path = Utils.__pathify '_search/scroll', Utils.__listify(arguments[:scroll_id])
15
+ scroll_id = arguments.delete(:scroll_id)
16
+
17
+ scroll_ids = case scroll_id
18
+ when Array
19
+ scroll_id.join(',')
20
+ else
21
+ scroll_id
22
+ end
23
+
24
+ method = HTTP_DELETE
25
+ path = Utils.__pathify '_search/scroll'
17
26
  params = {}
18
- body = nil
27
+ body = scroll_ids
19
28
 
20
29
  perform_request(method, path, params, body).body
21
30
  end
@@ -18,7 +18,7 @@ module Elasticsearch
18
18
  :flat_settings
19
19
  ]
20
20
 
21
- method = 'GET'
21
+ method = HTTP_GET
22
22
  path = "_cluster/settings"
23
23
  params = Utils.__validate_and_extract_params arguments, valid_params
24
24
  body = nil
@@ -40,7 +40,7 @@ module Elasticsearch
40
40
  :wait_for_relocating_shards,
41
41
  :wait_for_status ]
42
42
 
43
- method = 'GET'
43
+ method = HTTP_GET
44
44
  path = "_cluster/health"
45
45
 
46
46
  params = Utils.__validate_and_extract_params arguments, valid_params
@@ -20,7 +20,7 @@ module Elasticsearch
20
20
  valid_params = [
21
21
  :local,
22
22
  :master_timeout ]
23
- method = 'GET'
23
+ method = HTTP_GET
24
24
  path = "/_cluster/pending_tasks"
25
25
  params = Utils.__validate_and_extract_params arguments, valid_params
26
26
  body = nil
@@ -17,7 +17,7 @@ module Elasticsearch
17
17
  def put_settings(arguments={})
18
18
  valid_params = [ :flat_settings ]
19
19
 
20
- method = 'PUT'
20
+ method = HTTP_PUT
21
21
  path = "_cluster/settings"
22
22
  params = Utils.__validate_and_extract_params arguments, valid_params
23
23
  body = arguments[:body] || {}
@@ -32,7 +32,7 @@ module Elasticsearch
32
32
  def reroute(arguments={})
33
33
  valid_params = [ :dry_run, :explain, :metric, :master_timeout, :timeout ]
34
34
 
35
- method = 'POST'
35
+ method = HTTP_POST
36
36
  path = "_cluster/reroute"
37
37
 
38
38
  params = Utils.__validate_and_extract_params arguments, valid_params
@@ -19,6 +19,10 @@ module Elasticsearch
19
19
  # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node
20
20
  # (default: false)
21
21
  # @option arguments [Time] :master_timeout Specify timeout for connection to master
22
+ # @option arguments [String] :expand_wildcards Whether to expand wildcard expression for inidices
23
+ # (options: open, closed)
24
+ # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when
25
+ # unavailable (missing, closed, etc)
22
26
  #
23
27
  # @see http://elasticsearch.org/guide/reference/api/admin-cluster-state/
24
28
  #
@@ -32,9 +36,11 @@ module Elasticsearch
32
36
  :index_templates,
33
37
  :local,
34
38
  :master_timeout,
35
- :flat_settings ]
39
+ :flat_settings,
40
+ :expand_wildcards,
41
+ :ignore_unavailable ]
36
42
 
37
- method = 'GET'
43
+ method = HTTP_GET
38
44
  path = "_cluster/state"
39
45
 
40
46
  path = Utils.__pathify '_cluster/state',
@@ -45,7 +45,7 @@ module Elasticsearch
45
45
  :routing,
46
46
  :source ]
47
47
 
48
- method = 'GET'
48
+ method = HTTP_GET
49
49
  path = Utils.__pathify( Utils.__listify(arguments[:index]), Utils.__listify(arguments[:type]), '_count' )
50
50
 
51
51
  params = Utils.__validate_and_extract_params arguments, valid_params
@@ -62,7 +62,7 @@ module Elasticsearch
62
62
  :version,
63
63
  :version_type ]
64
64
 
65
- method = 'GET'
65
+ method = HTTP_GET
66
66
  path = Utils.__pathify Utils.__escape(arguments[:index]),
67
67
  Utils.__escape(arguments[:type]),
68
68
  arguments[:id],
@@ -43,7 +43,7 @@ module Elasticsearch
43
43
  :version,
44
44
  :version_type ]
45
45
 
46
- method = 'DELETE'
46
+ method = HTTP_DELETE
47
47
  path = Utils.__pathify Utils.__escape(arguments[:index]),
48
48
  Utils.__escape(arguments[:type]),
49
49
  Utils.__escape(arguments[:id])
@@ -60,7 +60,7 @@ module Elasticsearch
60
60
  :source,
61
61
  :timeout ]
62
62
 
63
- method = 'DELETE'
63
+ method = HTTP_DELETE
64
64
  path = Utils.__pathify Utils.__listify(arguments[:index]),
65
65
  Utils.__listify(arguments[:type]),
66
66
  '/_query'