elasticsearch-api 6.0.2 → 6.0.3

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: c55a30f0db61dcdfbb873ba85a8510676ebc9465
4
- data.tar.gz: 38ae6ef5d63796206875009ea7f2cc17aa09826b
3
+ metadata.gz: 68a87daeb6c52cecf38a0caa2a6c3c3bb935bd5b
4
+ data.tar.gz: 9a54edd2550c5d268444410135bdb207ef908e9c
5
5
  SHA512:
6
- metadata.gz: c3792d6c5feb6ca8d153fd5b078e7341ed2025b0517cb2b0bc95a73de78b3433659078de13df99c3ff480a17847347664398233e4e9a968ce01825639cadc96c
7
- data.tar.gz: 8811d738df8d8be954ecbe8824fbfe42066fb5ef3549829efd4eb2bccd522fc4d64f345bcf64ac95e682e3fb2122fc217b5887da274e645c0811307618eb42a2
6
+ metadata.gz: c0d66648a591014cf42d03794bd8c012da7013e0342e13688d2eda2fa9de0f571a3c5abea813331db2370580a647b13ecfb14780e41ff0ae84fea56e13885381
7
+ data.tar.gz: 25d7bb747ab4c3fb4c058bd998da4bcbe54359ca85354d73c0d2f10595f5b6d77c24bbaa1a3462c9256f211b915e7766277ab47f71060b00bc6f96f0b1d247a8
@@ -26,6 +26,8 @@ module Elasticsearch
26
26
  # shards is finished
27
27
  # @option arguments [Boolean] :wait_for_no_relocating_shards Whether to wait until there are no relocating
28
28
  # shards in the cluster
29
+ # @option arguments [Boolean] :wait_for_no_initializing_shards Whether to wait until there are no
30
+ # initializing shards in the cluster
29
31
  # @option arguments [String] :wait_for_status Wait until cluster is in a specific state
30
32
  # (options: green, yellow, red)
31
33
  # @option arguments [List] :wait_for_events Wait until all currently queued events with the given priorty
@@ -46,6 +48,7 @@ module Elasticsearch
46
48
  :wait_for_nodes,
47
49
  :wait_for_relocating_shards,
48
50
  :wait_for_no_relocating_shards,
51
+ :wait_for_no_initializing_shards,
49
52
  :wait_for_status,
50
53
  :wait_for_events ]
51
54
 
@@ -21,6 +21,7 @@ module Elasticsearch
21
21
  # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when
22
22
  # unavailable (missing, closed, etc)
23
23
  # @option arguments [Time] :timeout Explicit operation timeout
24
+ # @option arguments [Number] :wait_for_active_shards Wait until the specified number of shards is active
24
25
  #
25
26
  # @see http://www.elasticsearch.org/guide/reference/api/admin-indices-open-close/
26
27
  #
@@ -32,7 +33,8 @@ module Elasticsearch
32
33
  :ignore_unavailable,
33
34
  :allow_no_indices,
34
35
  :expand_wildcards,
35
- :timeout
36
+ :timeout,
37
+ :wait_for_active_shards
36
38
  ]
37
39
 
38
40
  method = HTTP_POST
@@ -0,0 +1,35 @@
1
+ module Elasticsearch
2
+ module API
3
+ module Indices
4
+ module Actions
5
+
6
+ # The split index API allows you to split an existing index into a new index,
7
+ # where each original primary shard is split into two or more primary shards in the new index.
8
+ #
9
+ # @option arguments [String] :index The name of the source index to split (*Required*)
10
+ # @option arguments [String] :target The name of the target index to split into (*Required*)
11
+ # @option arguments [Hash] :body The configuration for the target index (`settings` and `aliases`)
12
+ # @option arguments [Time] :timeout Explicit operation timeout
13
+ # @option arguments [Time] :master_timeout Specify timeout for connection to master
14
+ # @option arguments [String] :wait_for_active_shards Set the number of active shards to wait for on the shrunken index before the operation returns.
15
+ #
16
+ # @see http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-split-index.html
17
+ #
18
+ def split(arguments={})
19
+ raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
20
+ raise ArgumentError, "Required argument 'target' missing" unless arguments[:target]
21
+ valid_params = [
22
+ :timeout,
23
+ :master_timeout,
24
+ :wait_for_active_shards ]
25
+ method = HTTP_PUT
26
+ path = Utils.__pathify Utils.__escape(arguments[:index]), '_split', Utils.__escape(arguments[:target])
27
+ params = Utils.__validate_and_extract_params arguments, valid_params
28
+ body = arguments[:body]
29
+
30
+ perform_request(method, path, params, body).body
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -43,9 +43,11 @@ module Elasticsearch
43
43
  # @option arguments [String] :consistency Explicit write consistency setting for the operation
44
44
  # (Options: one, quorum, all)
45
45
  # @option arguments [Boolean] :wait_for_completion Whether the request should block and wait until
46
- # the operation has completed
46
+ # the operation has completed
47
47
  # @option arguments [Float] :requests_per_second The throttling for this request in sub-requests per second.
48
48
  # 0 means set no throttling (default)
49
+ # @option arguments [Integer] :slices The number of slices this request should be divided into.
50
+ # Defaults to 1 meaning the request isn't sliced into sub-requests.
49
51
  #
50
52
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html
51
53
  #
@@ -56,7 +58,8 @@ module Elasticsearch
56
58
  :timeout,
57
59
  :consistency,
58
60
  :wait_for_completion,
59
- :requests_per_second ]
61
+ :requests_per_second,
62
+ :slices ]
60
63
  method = 'POST'
61
64
  path = "_reindex"
62
65
  params = Utils.__validate_and_extract_params arguments, valid_params
@@ -61,6 +61,7 @@ module Elasticsearch
61
61
  # @option arguments [Integer] :scroll_size Size on the scroll request powering the update_by_query
62
62
  # @option arguments [Boolean] :wait_for_completion Should the request should block until the reindex is complete.
63
63
  # @option arguments [Float] :requests_per_second The throttle for this request in sub-requests per second. 0 means set no throttle.
64
+ # @option arguments [Integer] :slices The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks.
64
65
  #
65
66
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-by-query.html
66
67
  #
@@ -109,7 +110,8 @@ module Elasticsearch
109
110
  :consistency,
110
111
  :scroll_size,
111
112
  :wait_for_completion,
112
- :requests_per_second ]
113
+ :requests_per_second,
114
+ :slices ]
113
115
 
114
116
  method = HTTP_POST
115
117
 
@@ -1,5 +1,5 @@
1
1
  module Elasticsearch
2
2
  module API
3
- VERSION = "6.0.2"
3
+ VERSION = "6.0.3"
4
4
  end
5
5
  end
@@ -0,0 +1,26 @@
1
+ require 'test_helper'
2
+
3
+ module Elasticsearch
4
+ module Test
5
+ class IndicesSplitTest < ::Test::Unit::TestCase
6
+
7
+ context "Indices: Split" 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 'FAKE', method
13
+ assert_equal 'test', url
14
+ assert_equal Hash.new, params
15
+ assert_equal Hash.new, body
16
+ true
17
+ end.returns(FakeResponse.new)
18
+
19
+ subject.indices.split :index => 'foo', :target => 'foo'
20
+ end
21
+
22
+ end
23
+
24
+ end
25
+ end
26
+ 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: 6.0.2
4
+ version: 6.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karel Minarik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-22 00:00:00.000000000 Z
11
+ date: 2018-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -439,6 +439,7 @@ files:
439
439
  - lib/elasticsearch/api/actions/indices/shard_stores.rb
440
440
  - lib/elasticsearch/api/actions/indices/shrink.rb
441
441
  - lib/elasticsearch/api/actions/indices/snapshot_index.rb
442
+ - lib/elasticsearch/api/actions/indices/split.rb
442
443
  - lib/elasticsearch/api/actions/indices/stats.rb
443
444
  - lib/elasticsearch/api/actions/indices/status.rb
444
445
  - lib/elasticsearch/api/actions/indices/update_aliases.rb
@@ -592,6 +593,7 @@ files:
592
593
  - test/unit/indices/shard_stores_test.rb
593
594
  - test/unit/indices/shrink_test.rb
594
595
  - test/unit/indices/snapshot_index_test.rb
596
+ - test/unit/indices/split_test.rb
595
597
  - test/unit/indices/stats_test.rb
596
598
  - test/unit/indices/status_test.rb
597
599
  - test/unit/indices/update_aliases_test.rb
@@ -770,6 +772,7 @@ test_files:
770
772
  - test/unit/indices/shard_stores_test.rb
771
773
  - test/unit/indices/shrink_test.rb
772
774
  - test/unit/indices/snapshot_index_test.rb
775
+ - test/unit/indices/split_test.rb
773
776
  - test/unit/indices/stats_test.rb
774
777
  - test/unit/indices/status_test.rb
775
778
  - test/unit/indices/update_aliases_test.rb