elasticsearch-api 0.4.11 → 1.0.0.rc1

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 (94) hide show
  1. data/Gemfile +2 -6
  2. data/README.md +3 -4
  3. data/lib/elasticsearch/api.rb +16 -9
  4. data/lib/elasticsearch/api/actions/cat/aliases.rb +67 -0
  5. data/lib/elasticsearch/api/actions/cat/allocation.rb +69 -0
  6. data/lib/elasticsearch/api/actions/cat/count.rb +59 -0
  7. data/lib/elasticsearch/api/actions/cat/health.rb +43 -0
  8. data/lib/elasticsearch/api/actions/cat/help.rb +25 -0
  9. data/lib/elasticsearch/api/actions/cat/indices.rb +77 -0
  10. data/lib/elasticsearch/api/actions/cat/master.rb +40 -0
  11. data/lib/elasticsearch/api/actions/cat/nodes.rb +38 -0
  12. data/lib/elasticsearch/api/actions/cat/pending_tasks.rb +40 -0
  13. data/lib/elasticsearch/api/actions/cat/recovery.rb +73 -0
  14. data/lib/elasticsearch/api/actions/cat/shards.rb +72 -0
  15. data/lib/elasticsearch/api/actions/cluster/put_settings.rb +3 -1
  16. data/lib/elasticsearch/api/actions/cluster/state.rb +23 -14
  17. data/lib/elasticsearch/api/actions/count_percolate.rb +78 -0
  18. data/lib/elasticsearch/api/actions/indices/exists.rb +4 -1
  19. data/lib/elasticsearch/api/actions/indices/exists_alias.rb +5 -3
  20. data/lib/elasticsearch/api/actions/indices/exists_template.rb +34 -0
  21. data/lib/elasticsearch/api/actions/indices/exists_type.rb +4 -1
  22. data/lib/elasticsearch/api/actions/indices/get_alias.rb +5 -3
  23. data/lib/elasticsearch/api/actions/indices/get_aliases.rb +6 -3
  24. data/lib/elasticsearch/api/actions/indices/get_field_mapping.rb +2 -1
  25. data/lib/elasticsearch/api/actions/indices/get_mapping.rb +8 -3
  26. data/lib/elasticsearch/api/actions/indices/get_settings.rb +7 -2
  27. data/lib/elasticsearch/api/actions/indices/get_warmer.rb +0 -2
  28. data/lib/elasticsearch/api/actions/indices/put_alias.rb +0 -1
  29. data/lib/elasticsearch/api/actions/indices/put_mapping.rb +11 -4
  30. data/lib/elasticsearch/api/actions/indices/put_warmer.rb +0 -1
  31. data/lib/elasticsearch/api/actions/mpercolate.rb +58 -0
  32. data/lib/elasticsearch/api/actions/mtermvectors.rb +67 -0
  33. data/lib/elasticsearch/api/actions/{cluster/node_hot_threads.rb → nodes/hot_threads.rb} +3 -3
  34. data/lib/elasticsearch/api/actions/{cluster/node_info.rb → nodes/info.rb} +3 -3
  35. data/lib/elasticsearch/api/actions/{cluster/node_shutdown.rb → nodes/shutdown.rb} +3 -3
  36. data/lib/elasticsearch/api/actions/nodes/stats.rb +79 -0
  37. data/lib/elasticsearch/api/actions/percolate.rb +67 -21
  38. data/lib/elasticsearch/api/actions/snapshot/create.rb +48 -0
  39. data/lib/elasticsearch/api/actions/snapshot/create_repository.rb +44 -0
  40. data/lib/elasticsearch/api/actions/snapshot/delete.rb +41 -0
  41. data/lib/elasticsearch/api/actions/snapshot/delete_repository.rb +38 -0
  42. data/lib/elasticsearch/api/actions/snapshot/get.rb +47 -0
  43. data/lib/elasticsearch/api/actions/snapshot/get_repository.rb +42 -0
  44. data/lib/elasticsearch/api/actions/snapshot/restore.rb +53 -0
  45. data/lib/elasticsearch/api/actions/termvector.rb +77 -0
  46. data/lib/elasticsearch/api/namespace/cat.rb +20 -0
  47. data/lib/elasticsearch/api/namespace/nodes.rb +20 -0
  48. data/lib/elasticsearch/api/namespace/snapshot.rb +20 -0
  49. data/lib/elasticsearch/api/utils.rb +2 -4
  50. data/lib/elasticsearch/api/version.rb +1 -1
  51. data/test/integration/yaml_test_runner.rb +37 -8
  52. data/test/unit/cat/aliases_test.rb +26 -0
  53. data/test/unit/cat/allocation_test.rb +26 -0
  54. data/test/unit/cat/count_test.rb +26 -0
  55. data/test/unit/cat/health_test.rb +26 -0
  56. data/test/unit/cat/help_test.rb +26 -0
  57. data/test/unit/cat/indices_test.rb +26 -0
  58. data/test/unit/cat/master_test.rb +26 -0
  59. data/test/unit/cat/nodes_test.rb +26 -0
  60. data/test/unit/cat/pending_tasks_test.rb +26 -0
  61. data/test/unit/cat/recovery_test.rb +26 -0
  62. data/test/unit/cat/shards_test.rb +26 -0
  63. data/test/unit/cluster/state_test.rb +12 -3
  64. data/test/unit/count_percolate_test.rb +26 -0
  65. data/test/unit/indices/exists_alias_test.rb +0 -6
  66. data/test/unit/indices/exists_template_test.rb +59 -0
  67. data/test/unit/indices/get_alias_test.rb +0 -6
  68. data/test/unit/indices/get_aliases_test.rb +10 -0
  69. data/test/unit/indices/get_field_mapping_test.rb +1 -1
  70. data/test/unit/indices/get_mapping_test.rb +3 -3
  71. data/test/unit/indices/get_settings_test.rb +10 -0
  72. data/test/unit/indices/get_warmer_test.rb +0 -6
  73. data/test/unit/indices/put_alias_test.rb +0 -6
  74. data/test/unit/indices/put_mapping_test.rb +5 -11
  75. data/test/unit/indices/put_settings_test.rb +9 -0
  76. data/test/unit/indices/put_warmer_test.rb +0 -6
  77. data/test/unit/mpercolate_test.rb +51 -0
  78. data/test/unit/mtermvectors_test.rb +38 -0
  79. data/test/unit/{cluster/node_hot_threads_test.rb → nodes/hot_threads_test.rb} +5 -5
  80. data/test/unit/{cluster/node_info_test.rb → nodes/info_test.rb} +6 -6
  81. data/test/unit/{cluster/node_shutdown_test.rb → nodes/shutdown_test.rb} +6 -6
  82. data/test/unit/{cluster/node_stats_test.rb → nodes/stats_test.rb} +10 -10
  83. data/test/unit/percolate_test.rb +2 -13
  84. data/test/unit/snapshot/create_repository_test.rb +38 -0
  85. data/test/unit/snapshot/create_test.rb +38 -0
  86. data/test/unit/snapshot/delete_repository_test.rb +35 -0
  87. data/test/unit/snapshot/delete_test.rb +38 -0
  88. data/test/unit/snapshot/get_repository_test.rb +26 -0
  89. data/test/unit/snapshot/get_test.rb +38 -0
  90. data/test/unit/snapshot/restore_test.rb +38 -0
  91. data/test/unit/termvector_test.rb +44 -0
  92. data/test/unit/utils_test.rb +11 -0
  93. metadata +89 -17
  94. data/lib/elasticsearch/api/actions/cluster/node_stats.rb +0 -75
@@ -0,0 +1,44 @@
1
+ require 'test_helper'
2
+
3
+ module Elasticsearch
4
+ module Test
5
+ class TermvectorTest < ::Test::Unit::TestCase
6
+
7
+ context "Termvector" do
8
+ subject { FakeClient.new }
9
+
10
+ should "require the :index argument" do
11
+ assert_raise ArgumentError do
12
+ subject.termvector :type => 'bar', :id => '1'
13
+ end
14
+ end
15
+
16
+ should "require the :type argument" do
17
+ assert_raise ArgumentError do
18
+ subject.termvector :index => 'foo', :id => '1'
19
+ end
20
+ end
21
+
22
+ should "require the :id argument" do
23
+ assert_raise ArgumentError do
24
+ subject.termvector :index => 'foo', :type => 'bar'
25
+ end
26
+ end
27
+
28
+ should "perform correct request" do
29
+ subject.expects(:perform_request).with do |method, url, params, body|
30
+ assert_equal 'GET', method
31
+ assert_equal 'foo/bar/123/_termvector', url
32
+ assert_equal Hash.new, params
33
+ assert_equal Hash.new, body
34
+ true
35
+ end.returns(FakeResponse.new)
36
+
37
+ subject.termvector :index => 'foo', :type => 'bar', :id => '123', :body => {}
38
+ end
39
+
40
+ end
41
+
42
+ end
43
+ end
44
+ end
@@ -153,6 +153,17 @@ module Elasticsearch
153
153
  end
154
154
  end
155
155
 
156
+ should "not raise an exception for COMMON_PARAMS" do
157
+ assert_nothing_raised do
158
+ __validate_and_extract_params({ :index => 'foo'}, [:foo])
159
+ end
160
+ end
161
+
162
+ should "extract COMMON_QUERY_PARAMS" do
163
+ assert_equal( { :format => 'yaml' },
164
+ __validate_and_extract_params( { :format => 'yaml' } ) )
165
+ end
166
+
156
167
  end
157
168
 
158
169
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elasticsearch-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.11
5
- prerelease:
4
+ version: 1.0.0.rc1
5
+ prerelease: 6
6
6
  platform: ruby
7
7
  authors:
8
8
  - Karel Minarik
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-02-11 00:00:00.000000000 Z
12
+ date: 2014-02-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json
@@ -399,18 +399,26 @@ files:
399
399
  - lib/elasticsearch-api.rb
400
400
  - lib/elasticsearch/api.rb
401
401
  - lib/elasticsearch/api/actions/bulk.rb
402
+ - lib/elasticsearch/api/actions/cat/aliases.rb
403
+ - lib/elasticsearch/api/actions/cat/allocation.rb
404
+ - lib/elasticsearch/api/actions/cat/count.rb
405
+ - lib/elasticsearch/api/actions/cat/health.rb
406
+ - lib/elasticsearch/api/actions/cat/help.rb
407
+ - lib/elasticsearch/api/actions/cat/indices.rb
408
+ - lib/elasticsearch/api/actions/cat/master.rb
409
+ - lib/elasticsearch/api/actions/cat/nodes.rb
410
+ - lib/elasticsearch/api/actions/cat/pending_tasks.rb
411
+ - lib/elasticsearch/api/actions/cat/recovery.rb
412
+ - lib/elasticsearch/api/actions/cat/shards.rb
402
413
  - lib/elasticsearch/api/actions/clear_scroll.rb
403
414
  - lib/elasticsearch/api/actions/cluster/get_settings.rb
404
415
  - lib/elasticsearch/api/actions/cluster/health.rb
405
- - lib/elasticsearch/api/actions/cluster/node_hot_threads.rb
406
- - lib/elasticsearch/api/actions/cluster/node_info.rb
407
- - lib/elasticsearch/api/actions/cluster/node_shutdown.rb
408
- - lib/elasticsearch/api/actions/cluster/node_stats.rb
409
416
  - lib/elasticsearch/api/actions/cluster/pending_tasks.rb
410
417
  - lib/elasticsearch/api/actions/cluster/put_settings.rb
411
418
  - lib/elasticsearch/api/actions/cluster/reroute.rb
412
419
  - lib/elasticsearch/api/actions/cluster/state.rb
413
420
  - lib/elasticsearch/api/actions/count.rb
421
+ - lib/elasticsearch/api/actions/count_percolate.rb
414
422
  - lib/elasticsearch/api/actions/create.rb
415
423
  - lib/elasticsearch/api/actions/delete.rb
416
424
  - lib/elasticsearch/api/actions/delete_by_query.rb
@@ -430,6 +438,7 @@ files:
430
438
  - lib/elasticsearch/api/actions/indices/delete_warmer.rb
431
439
  - lib/elasticsearch/api/actions/indices/exists.rb
432
440
  - lib/elasticsearch/api/actions/indices/exists_alias.rb
441
+ - lib/elasticsearch/api/actions/indices/exists_template.rb
433
442
  - lib/elasticsearch/api/actions/indices/exists_type.rb
434
443
  - lib/elasticsearch/api/actions/indices/flush.rb
435
444
  - lib/elasticsearch/api/actions/indices/get_alias.rb
@@ -456,33 +465,58 @@ files:
456
465
  - lib/elasticsearch/api/actions/info.rb
457
466
  - lib/elasticsearch/api/actions/mget.rb
458
467
  - lib/elasticsearch/api/actions/mlt.rb
468
+ - lib/elasticsearch/api/actions/mpercolate.rb
459
469
  - lib/elasticsearch/api/actions/msearch.rb
470
+ - lib/elasticsearch/api/actions/mtermvectors.rb
471
+ - lib/elasticsearch/api/actions/nodes/hot_threads.rb
472
+ - lib/elasticsearch/api/actions/nodes/info.rb
473
+ - lib/elasticsearch/api/actions/nodes/shutdown.rb
474
+ - lib/elasticsearch/api/actions/nodes/stats.rb
460
475
  - lib/elasticsearch/api/actions/percolate.rb
461
476
  - lib/elasticsearch/api/actions/ping.rb
462
477
  - lib/elasticsearch/api/actions/scroll.rb
463
478
  - lib/elasticsearch/api/actions/search.rb
479
+ - lib/elasticsearch/api/actions/snapshot/create.rb
480
+ - lib/elasticsearch/api/actions/snapshot/create_repository.rb
481
+ - lib/elasticsearch/api/actions/snapshot/delete.rb
482
+ - lib/elasticsearch/api/actions/snapshot/delete_repository.rb
483
+ - lib/elasticsearch/api/actions/snapshot/get.rb
484
+ - lib/elasticsearch/api/actions/snapshot/get_repository.rb
485
+ - lib/elasticsearch/api/actions/snapshot/restore.rb
464
486
  - lib/elasticsearch/api/actions/suggest.rb
487
+ - lib/elasticsearch/api/actions/termvector.rb
465
488
  - lib/elasticsearch/api/actions/update.rb
489
+ - lib/elasticsearch/api/namespace/cat.rb
466
490
  - lib/elasticsearch/api/namespace/cluster.rb
467
491
  - lib/elasticsearch/api/namespace/common.rb
468
492
  - lib/elasticsearch/api/namespace/indices.rb
493
+ - lib/elasticsearch/api/namespace/nodes.rb
494
+ - lib/elasticsearch/api/namespace/snapshot.rb
469
495
  - lib/elasticsearch/api/utils.rb
470
496
  - lib/elasticsearch/api/version.rb
471
497
  - test/integration/yaml_test_runner.rb
472
498
  - test/test_helper.rb
473
499
  - test/unit/bulk_test.rb
500
+ - test/unit/cat/aliases_test.rb
501
+ - test/unit/cat/allocation_test.rb
502
+ - test/unit/cat/count_test.rb
503
+ - test/unit/cat/health_test.rb
504
+ - test/unit/cat/help_test.rb
505
+ - test/unit/cat/indices_test.rb
506
+ - test/unit/cat/master_test.rb
507
+ - test/unit/cat/nodes_test.rb
508
+ - test/unit/cat/pending_tasks_test.rb
509
+ - test/unit/cat/recovery_test.rb
510
+ - test/unit/cat/shards_test.rb
474
511
  - test/unit/clear_scroll_test.rb
475
512
  - test/unit/client_test.rb
476
513
  - test/unit/cluster/get_settings_test.rb
477
514
  - test/unit/cluster/health_test.rb
478
- - test/unit/cluster/node_hot_threads_test.rb
479
- - test/unit/cluster/node_info_test.rb
480
- - test/unit/cluster/node_shutdown_test.rb
481
- - test/unit/cluster/node_stats_test.rb
482
515
  - test/unit/cluster/pending_tasks_test.rb
483
516
  - test/unit/cluster/put_settings_test.rb
484
517
  - test/unit/cluster/reroute_test.rb
485
518
  - test/unit/cluster/state_test.rb
519
+ - test/unit/count_percolate_test.rb
486
520
  - test/unit/count_test.rb
487
521
  - test/unit/create_document_test.rb
488
522
  - test/unit/delete_by_query_test.rb
@@ -503,6 +537,7 @@ files:
503
537
  - test/unit/indices/delete_test.rb
504
538
  - test/unit/indices/delete_warmer_test.rb
505
539
  - test/unit/indices/exists_alias_test.rb
540
+ - test/unit/indices/exists_template_test.rb
506
541
  - test/unit/indices/exists_test.rb
507
542
  - test/unit/indices/exists_type_test.rb
508
543
  - test/unit/indices/flush_test.rb
@@ -531,12 +566,26 @@ files:
531
566
  - test/unit/json_builders_test.rb
532
567
  - test/unit/mget_test.rb
533
568
  - test/unit/mlt_test.rb
569
+ - test/unit/mpercolate_test.rb
534
570
  - test/unit/msearch_test.rb
571
+ - test/unit/mtermvectors_test.rb
572
+ - test/unit/nodes/hot_threads_test.rb
573
+ - test/unit/nodes/info_test.rb
574
+ - test/unit/nodes/shutdown_test.rb
575
+ - test/unit/nodes/stats_test.rb
535
576
  - test/unit/percolate_test.rb
536
577
  - test/unit/ping_test.rb
537
578
  - test/unit/scroll_test.rb
538
579
  - test/unit/search_test.rb
580
+ - test/unit/snapshot/create_repository_test.rb
581
+ - test/unit/snapshot/create_test.rb
582
+ - test/unit/snapshot/delete_repository_test.rb
583
+ - test/unit/snapshot/delete_test.rb
584
+ - test/unit/snapshot/get_repository_test.rb
585
+ - test/unit/snapshot/get_test.rb
586
+ - test/unit/snapshot/restore_test.rb
539
587
  - test/unit/suggest_test.rb
588
+ - test/unit/termvector_test.rb
540
589
  - test/unit/update_document_test.rb
541
590
  - test/unit/utils_test.rb
542
591
  homepage: https://github.com/elasticsearch/elasticsearch-ruby/tree/master/elasticsearch-api
@@ -556,9 +605,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
556
605
  required_rubygems_version: !ruby/object:Gem::Requirement
557
606
  none: false
558
607
  requirements:
559
- - - ! '>='
608
+ - - ! '>'
560
609
  - !ruby/object:Gem::Version
561
- version: '0'
610
+ version: 1.3.1
562
611
  requirements: []
563
612
  rubyforge_project:
564
613
  rubygems_version: 1.8.23
@@ -569,18 +618,26 @@ test_files:
569
618
  - test/integration/yaml_test_runner.rb
570
619
  - test/test_helper.rb
571
620
  - test/unit/bulk_test.rb
621
+ - test/unit/cat/aliases_test.rb
622
+ - test/unit/cat/allocation_test.rb
623
+ - test/unit/cat/count_test.rb
624
+ - test/unit/cat/health_test.rb
625
+ - test/unit/cat/help_test.rb
626
+ - test/unit/cat/indices_test.rb
627
+ - test/unit/cat/master_test.rb
628
+ - test/unit/cat/nodes_test.rb
629
+ - test/unit/cat/pending_tasks_test.rb
630
+ - test/unit/cat/recovery_test.rb
631
+ - test/unit/cat/shards_test.rb
572
632
  - test/unit/clear_scroll_test.rb
573
633
  - test/unit/client_test.rb
574
634
  - test/unit/cluster/get_settings_test.rb
575
635
  - test/unit/cluster/health_test.rb
576
- - test/unit/cluster/node_hot_threads_test.rb
577
- - test/unit/cluster/node_info_test.rb
578
- - test/unit/cluster/node_shutdown_test.rb
579
- - test/unit/cluster/node_stats_test.rb
580
636
  - test/unit/cluster/pending_tasks_test.rb
581
637
  - test/unit/cluster/put_settings_test.rb
582
638
  - test/unit/cluster/reroute_test.rb
583
639
  - test/unit/cluster/state_test.rb
640
+ - test/unit/count_percolate_test.rb
584
641
  - test/unit/count_test.rb
585
642
  - test/unit/create_document_test.rb
586
643
  - test/unit/delete_by_query_test.rb
@@ -601,6 +658,7 @@ test_files:
601
658
  - test/unit/indices/delete_test.rb
602
659
  - test/unit/indices/delete_warmer_test.rb
603
660
  - test/unit/indices/exists_alias_test.rb
661
+ - test/unit/indices/exists_template_test.rb
604
662
  - test/unit/indices/exists_test.rb
605
663
  - test/unit/indices/exists_type_test.rb
606
664
  - test/unit/indices/flush_test.rb
@@ -629,12 +687,26 @@ test_files:
629
687
  - test/unit/json_builders_test.rb
630
688
  - test/unit/mget_test.rb
631
689
  - test/unit/mlt_test.rb
690
+ - test/unit/mpercolate_test.rb
632
691
  - test/unit/msearch_test.rb
692
+ - test/unit/mtermvectors_test.rb
693
+ - test/unit/nodes/hot_threads_test.rb
694
+ - test/unit/nodes/info_test.rb
695
+ - test/unit/nodes/shutdown_test.rb
696
+ - test/unit/nodes/stats_test.rb
633
697
  - test/unit/percolate_test.rb
634
698
  - test/unit/ping_test.rb
635
699
  - test/unit/scroll_test.rb
636
700
  - test/unit/search_test.rb
701
+ - test/unit/snapshot/create_repository_test.rb
702
+ - test/unit/snapshot/create_test.rb
703
+ - test/unit/snapshot/delete_repository_test.rb
704
+ - test/unit/snapshot/delete_test.rb
705
+ - test/unit/snapshot/get_repository_test.rb
706
+ - test/unit/snapshot/get_test.rb
707
+ - test/unit/snapshot/restore_test.rb
637
708
  - test/unit/suggest_test.rb
709
+ - test/unit/termvector_test.rb
638
710
  - test/unit/update_document_test.rb
639
711
  - test/unit/utils_test.rb
640
712
  has_rdoc:
@@ -1,75 +0,0 @@
1
- module Elasticsearch
2
- module API
3
- module Cluster
4
- module Actions
5
-
6
- # Returns statistical information about nodes in the cluster.
7
- #
8
- # @example Return statistics about JVM
9
- #
10
- # client.cluster.node_stats clear: true, jvm: true
11
- #
12
- # @option arguments [List] :metric Limit the information returned for `indices` family to a specific metric
13
- # (options: docs, fielddata, filter_cache, flush, get, id_cache, indexing, merges,
14
- # refresh, search, store, warmer)
15
- # @option arguments [List] :node_id A comma-separated list of node IDs or names to limit the returned information;
16
- # use `_local` to return information from the node you're connecting to, leave
17
- # empty to get information from all nodes
18
- # @option arguments [Boolean] :all Return all available information
19
- # @option arguments [Boolean] :clear Reset the default level of detail
20
- # @option arguments [List] :fields A comma-separated list of fields for `fielddata` metric (supports wildcards)
21
- # @option arguments [Boolean] :fs Return information about the filesystem
22
- # @option arguments [Boolean] :http Return information about HTTP
23
- # @option arguments [Boolean] :indices Return information about indices
24
- # @option arguments [Boolean] :jvm Return information about the JVM
25
- # @option arguments [Boolean] :network Return information about network
26
- # @option arguments [Boolean] :os Return information about the operating system
27
- # @option arguments [Boolean] :process Return information about the Elasticsearch process
28
- # @option arguments [Boolean] :thread_pool Return information about the thread pool
29
- # @option arguments [Boolean] :transport Return information about transport
30
- #
31
- # @see http://elasticsearch.org/guide/reference/api/admin-cluster-nodes-stats/
32
- #
33
- def node_stats(arguments={})
34
- valid_params = [
35
- :all,
36
- :clear,
37
- :fields,
38
- :fs,
39
- :http,
40
- :indices,
41
- :jvm,
42
- :network,
43
- :os,
44
- :process,
45
- :thread_pool,
46
- :transport ]
47
-
48
- method = 'GET'
49
-
50
- case
51
- # Field data metric for the `indices` metric family
52
- when arguments[:indices] && arguments[:metric] == 'fielddata'
53
- path = Utils.__pathify '_nodes', Utils.__listify(arguments[:node_id]), 'stats/indices/fielddata'
54
- params = { :fields => Utils.__listify(arguments[:fields]) }
55
-
56
- # `indices` metric family incl. a metric
57
- when arguments[:indices] && arguments[:metric]
58
- path = Utils.__pathify( '_nodes', Utils.__listify(arguments[:node_id]), 'stats/indices', arguments[:metric] )
59
- params = {}
60
-
61
- else
62
- path = Utils.__pathify( '_nodes', Utils.__listify(arguments[:node_id]), 'stats' )
63
-
64
- params = Utils.__validate_and_extract_params arguments, valid_params
65
- params[:fields] = Utils.__listify(params[:fields]) if params[:fields]
66
- end
67
-
68
- body = nil
69
-
70
- perform_request(method, path, params, body).body
71
- end
72
- end
73
- end
74
- end
75
- end