Skip to content

Commit

Permalink
[API] Changed the endpoint for "Nodes Info" API from `/_cluster/nodes…
Browse files Browse the repository at this point in the history
…` to `/_nodes`

The "_cluster" prefix has been removed in Elasticsearch 1.0.

The "/_nodes" endpoint is supported since ~ version 0.19,
so this doesn't break backwards compatibility.

Related:

* elastic/elasticsearch#4055
* elastic/elasticsearch#4065
* elastic/elasticsearch#4347
* elastic/elasticsearch#4608
  • Loading branch information
karmi committed Jan 11, 2014
1 parent 0cc6bdc commit baaaba8
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def node_hot_threads(arguments={})
:type ]

method = 'GET'
path = Utils.__pathify '_cluster/nodes', Utils.__listify(arguments[:node_id]), 'hot_threads'
path = Utils.__pathify '_nodes', Utils.__listify(arguments[:node_id]), 'hot_threads'

params = Utils.__validate_and_extract_params arguments, valid_params
body = nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def node_info(arguments={})
:transport ]

method = 'GET'
path = Utils.__pathify '_cluster/nodes', Utils.__listify(arguments[:node_id])
path = Utils.__pathify '_nodes', Utils.__listify(arguments[:node_id])

params = Utils.__validate_and_extract_params arguments, valid_params
body = nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def node_shutdown(arguments={})
:exit ]

method = 'POST'
path = Utils.__pathify '_cluster/nodes', Utils.__listify(arguments[:node_id]), '_shutdown'
path = Utils.__pathify '_nodes', Utils.__listify(arguments[:node_id]), '_shutdown'

params = Utils.__validate_and_extract_params arguments, valid_params
body = nil
Expand Down
6 changes: 3 additions & 3 deletions elasticsearch-api/test/unit/cluster/node_hot_threads_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ClusterNodeHotThreadsTest < ::Test::Unit::TestCase
should "perform correct request" do
subject.expects(:perform_request).with do |method, url, params, body|
assert_equal 'GET', method
assert_equal '_cluster/nodes/hot_threads', url
assert_equal '_nodes/hot_threads', url
assert_equal Hash.new, params
assert_nil body
true
Expand All @@ -21,7 +21,7 @@ class ClusterNodeHotThreadsTest < ::Test::Unit::TestCase

should "send :node_id correctly" do
subject.expects(:perform_request).with do |method, url, params, body|
assert_equal '_cluster/nodes/foo/hot_threads', url
assert_equal '_nodes/foo/hot_threads', url
true
end.returns(FakeResponse.new)

Expand All @@ -30,7 +30,7 @@ class ClusterNodeHotThreadsTest < ::Test::Unit::TestCase

should "URL-escape the parts" do
subject.expects(:perform_request).with do |method, url, params, body|
assert_equal '_cluster/nodes/foo%5Ebar/hot_threads', url
assert_equal '_nodes/foo%5Ebar/hot_threads', url
true
end.returns(FakeResponse.new)

Expand Down
6 changes: 3 additions & 3 deletions elasticsearch-api/test/unit/cluster/node_info_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ClusterNodeInfoTest < ::Test::Unit::TestCase
should "perform correct request" do
subject.expects(:perform_request).with do |method, url, params, body|
assert_equal 'GET', method
assert_equal '_cluster/nodes', url
assert_equal '_nodes', url
assert_equal Hash.new, params
assert_nil body
true
Expand All @@ -21,7 +21,7 @@ class ClusterNodeInfoTest < ::Test::Unit::TestCase

should "send :node_id correctly" do
subject.expects(:perform_request).with do |method, url, params, body|
assert_equal '_cluster/nodes/foo', url
assert_equal '_nodes/foo', url
true
end.returns(FakeResponse.new)

Expand All @@ -30,7 +30,7 @@ class ClusterNodeInfoTest < ::Test::Unit::TestCase

should "send multiple :node_id-s correctly" do
subject.expects(:perform_request).with do |method, url, params, body|
assert_equal '_cluster/nodes/A,B,C', url
assert_equal '_nodes/A,B,C', url
true
end.returns(FakeResponse.new).twice

Expand Down
6 changes: 3 additions & 3 deletions elasticsearch-api/test/unit/cluster/node_shutdown_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ClusterNodeShutdownTest < ::Test::Unit::TestCase
should "perform correct request" do
subject.expects(:perform_request).with do |method, url, params, body|
assert_equal 'POST', method
assert_equal '_cluster/nodes/_shutdown', url
assert_equal '_nodes/_shutdown', url
assert_equal Hash.new, params
assert_nil body
true
Expand All @@ -21,7 +21,7 @@ class ClusterNodeShutdownTest < ::Test::Unit::TestCase

should "send :node_id correctly" do
subject.expects(:perform_request).with do |method, url, params, body|
assert_equal '_cluster/nodes/foo/_shutdown', url
assert_equal '_nodes/foo/_shutdown', url
true
end.returns(FakeResponse.new)

Expand All @@ -30,7 +30,7 @@ class ClusterNodeShutdownTest < ::Test::Unit::TestCase

should "send multiple :node_id-s correctly" do
subject.expects(:perform_request).with do |method, url, params, body|
assert_equal '_cluster/nodes/A,B,C/_shutdown', url
assert_equal '_nodes/A,B,C/_shutdown', url
true
end.returns(FakeResponse.new).twice

Expand Down

0 comments on commit baaaba8

Please sign in to comment.