elasticsearch-api 1.0.16.pre → 1.0.16.pre2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 081fe135d7cd87037475fd790752c46d26b170ed
4
- data.tar.gz: 3d8753842bdfff64dffcccd95e431988b0cf943a
3
+ metadata.gz: b1af9abf86e7d7d4c9bbe1ca622b785780866908
4
+ data.tar.gz: 9e89adabd828f41a55c5b795c8b15f6da98c9f52
5
5
  SHA512:
6
- metadata.gz: 90ae2bede4146274cf1bcbae9477999e7144982d595ec67e64bf1839337ebfa93083ed9afac814cf2f0746de40eab462a973a0bebb7d55e4919d78795eeed9bb
7
- data.tar.gz: 22646e3f5530a92e0e25d380bfcef7ccd6db6e8b06dd1048a83fb1eaf3912a0581de5607701511f156422003dad597fc28ede8b90c6324440201bac9fc675be8
6
+ metadata.gz: e1576a27895b37c22c05b4063e351dae84fd94b078dd039be7a5855d2fddc73313a74768fa5051502560d1fbb3053fa6ee459d15e59d4e4997ab3250d6c5db2b
7
+ data.tar.gz: ee34141581c01bd22eb20642f020a7f297da502714be589ccc16593e3241cb13770fb58b934983af1c89d61067724287060a4b46d24cc0b1cfd1dd7ea4405325
@@ -46,6 +46,7 @@ module Elasticsearch
46
46
  Elasticsearch::API::Nodes,
47
47
  Elasticsearch::API::Indices,
48
48
  Elasticsearch::API::Snapshot,
49
+ Elasticsearch::API::Tasks,
49
50
  Elasticsearch::API::Cat
50
51
  end
51
52
 
@@ -0,0 +1,40 @@
1
+ module Elasticsearch
2
+ module API
3
+ module Tasks
4
+ module Actions
5
+
6
+ # Cancel a specific task
7
+ #
8
+ # @option arguments [Number] :task_id Cancel the task with specified id
9
+ # @option arguments [List] :node_id A comma-separated list of node IDs or names to limit the returned
10
+ # information; use `_local` to return information from the node
11
+ # you're connecting to, leave empty to get information from all nodes
12
+ # @option arguments [List] :actions A comma-separated list of actions that should be returned.
13
+ # Leave empty to return all.
14
+ # @option arguments [String] :parent_node Cancel tasks with specified parent node.
15
+ # @option arguments [Number] :parent_task Cancel tasks with specified parent task id.
16
+ # Set to -1 to cancel all.
17
+ #
18
+ # @see http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks-cancel.html
19
+ #
20
+ def cancel(arguments={})
21
+ valid_params = [
22
+ :node_id,
23
+ :actions,
24
+ :parent_node,
25
+ :parent_task ]
26
+
27
+ task_id = arguments.delete(:task_id)
28
+
29
+ method = 'POST'
30
+ path = "_tasks"
31
+ path = Utils.__pathify( '_tasks', Utils.__escape(task_id), '_cancel' )
32
+ params = Utils.__validate_and_extract_params arguments, valid_params
33
+ body = nil
34
+
35
+ perform_request(method, path, params, body).body
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,44 @@
1
+ module Elasticsearch
2
+ module API
3
+ module Tasks
4
+ module Actions
5
+
6
+ # Return the list of tasks
7
+ #
8
+ # @option arguments [Number] :task_id Return the task with specified id
9
+ # @option arguments [List] :node_id A comma-separated list of node IDs or names to limit the returned
10
+ # information; use `_local` to return information from the node
11
+ # you're connecting to, leave empty to get information from all nodes
12
+ # @option arguments [List] :actions A comma-separated list of actions that should be returned.
13
+ # Leave empty to return all.
14
+ # @option arguments [Boolean] :detailed Return detailed task information (default: false)
15
+ # @option arguments [String] :parent_node Return tasks with specified parent node.
16
+ # @option arguments [Number] :parent_task Return tasks with specified parent task id.
17
+ # Set to -1 to return all.
18
+ # @option arguments [Boolean] :wait_for_completion Wait for the matching tasks to complete (default: false)
19
+ #
20
+ # @see http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks-list.html
21
+ #
22
+ def list(arguments={})
23
+ valid_params = [
24
+ :node_id,
25
+ :actions,
26
+ :detailed,
27
+ :parent_node,
28
+ :parent_task,
29
+ :wait_for_completion ]
30
+
31
+ task_id = arguments.delete(:task_id)
32
+
33
+ method = 'GET'
34
+ path = "_tasks"
35
+ path = Utils.__pathify( '_tasks', Utils.__escape(task_id) )
36
+ params = Utils.__validate_and_extract_params arguments, valid_params
37
+ body = nil
38
+
39
+ perform_request(method, path, params, body).body
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,20 @@
1
+ module Elasticsearch
2
+ module API
3
+ module Tasks
4
+ module Actions; end
5
+
6
+ # Client for the "tasks" namespace (includes the {Tasks::Actions} methods)
7
+ #
8
+ class TasksClient
9
+ include Common::Client, Common::Client::Base, Tasks::Actions
10
+ end
11
+
12
+ # Proxy method for {TasksClient}, available in the receiving object
13
+ #
14
+ def tasks
15
+ @tasks ||= TasksClient.new(self)
16
+ end
17
+
18
+ end
19
+ end
20
+ end
@@ -1,5 +1,5 @@
1
1
  module Elasticsearch
2
2
  module API
3
- VERSION = "1.0.16.pre"
3
+ VERSION = "1.0.16.pre2"
4
4
  end
5
5
  end
@@ -14,7 +14,7 @@ require 'elasticsearch/extensions/test/startup_shutdown'
14
14
  require 'elasticsearch/extensions/test/profiling' unless JRUBY
15
15
 
16
16
  # Skip features
17
- skip_features = 'stash_in_path,requires_replica'
17
+ skip_features = 'stash_in_path,requires_replica,headers'
18
18
  SKIP_FEATURES = ENV.fetch('TEST_SKIP_FEATURES', skip_features)
19
19
 
20
20
  # Turn configuration
@@ -0,0 +1,38 @@
1
+ require 'test_helper'
2
+
3
+ module Elasticsearch
4
+ module Test
5
+ class TasksCancelTest < ::Test::Unit::TestCase
6
+
7
+ context "Tasks: Cancel" do
8
+ subject { FakeClient.new }
9
+
10
+ should "perform correct request" do
11
+ subject.expects(:perform_request).with do |method, url, params, body|
12
+ assert_equal 'POST', method
13
+ assert_equal '_tasks/_cancel', url
14
+ assert_equal Hash.new, params
15
+ assert_nil body
16
+ true
17
+ end.returns(FakeResponse.new)
18
+
19
+ subject.tasks.cancel
20
+ end
21
+
22
+ should "perform correct request with a task_id" do
23
+ subject.expects(:perform_request).with do |method, url, params, body|
24
+ assert_equal 'POST', method
25
+ assert_equal '_tasks/foo/_cancel', url
26
+ assert_equal Hash.new, params
27
+ assert_nil body
28
+ true
29
+ end.returns(FakeResponse.new)
30
+
31
+ subject.tasks.cancel :task_id => 'foo'
32
+ end
33
+
34
+ end
35
+
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,38 @@
1
+ require 'test_helper'
2
+
3
+ module Elasticsearch
4
+ module Test
5
+ class TasksListTest < ::Test::Unit::TestCase
6
+
7
+ context "Tasks: List" do
8
+ subject { FakeClient.new }
9
+
10
+ should "perform correct request" do
11
+ subject.expects(:perform_request).with do |method, url, params, body|
12
+ assert_equal 'GET', method
13
+ assert_equal '_tasks', url
14
+ assert_equal Hash.new, params
15
+ assert_nil body
16
+ true
17
+ end.returns(FakeResponse.new)
18
+
19
+ subject.tasks.list
20
+ end
21
+
22
+ should "perform correct request with :task_id" do
23
+ subject.expects(:perform_request).with do |method, url, params, body|
24
+ assert_equal 'GET', method
25
+ assert_equal '_tasks/foo', url
26
+ assert_equal Hash.new, params
27
+ assert_nil body
28
+ true
29
+ end.returns(FakeResponse.new)
30
+
31
+ subject.tasks.list :task_id => 'foo'
32
+ end
33
+
34
+ end
35
+
36
+ end
37
+ end
38
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elasticsearch-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.16.pre
4
+ version: 1.0.16.pre2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karel Minarik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-17 00:00:00.000000000 Z
11
+ date: 2016-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -466,6 +466,8 @@ files:
466
466
  - lib/elasticsearch/api/actions/snapshot/status.rb
467
467
  - lib/elasticsearch/api/actions/snapshot/verify_repository.rb
468
468
  - lib/elasticsearch/api/actions/suggest.rb
469
+ - lib/elasticsearch/api/actions/tasks/cancel.rb
470
+ - lib/elasticsearch/api/actions/tasks/list.rb
469
471
  - lib/elasticsearch/api/actions/termvectors.rb
470
472
  - lib/elasticsearch/api/actions/update.rb
471
473
  - lib/elasticsearch/api/namespace/cat.rb
@@ -474,6 +476,7 @@ files:
474
476
  - lib/elasticsearch/api/namespace/indices.rb
475
477
  - lib/elasticsearch/api/namespace/nodes.rb
476
478
  - lib/elasticsearch/api/namespace/snapshot.rb
479
+ - lib/elasticsearch/api/namespace/tasks.rb
477
480
  - lib/elasticsearch/api/utils.rb
478
481
  - lib/elasticsearch/api/version.rb
479
482
  - test/integration/yaml_test_runner.rb
@@ -598,6 +601,8 @@ files:
598
601
  - test/unit/snapshot/status_test.rb
599
602
  - test/unit/snapshot/verify_repository_test.rb
600
603
  - test/unit/suggest_test.rb
604
+ - test/unit/tasks/cancel_test.rb
605
+ - test/unit/tasks/list_test.rb
601
606
  - test/unit/termvectors_test.rb
602
607
  - test/unit/update_document_test.rb
603
608
  - test/unit/utils_test.rb
@@ -757,6 +762,8 @@ test_files:
757
762
  - test/unit/snapshot/status_test.rb
758
763
  - test/unit/snapshot/verify_repository_test.rb
759
764
  - test/unit/suggest_test.rb
765
+ - test/unit/tasks/cancel_test.rb
766
+ - test/unit/tasks/list_test.rb
760
767
  - test/unit/termvectors_test.rb
761
768
  - test/unit/update_document_test.rb
762
769
  - test/unit/utils_test.rb