elasticsearch-api 6.8.0 → 7.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +26 -5
- data/LICENSE +202 -0
- data/README.md +24 -21
- data/Rakefile +43 -45
- data/elasticsearch-api.gemspec +56 -55
- data/lib/elasticsearch/api/actions/abort_benchmark.rb +19 -3
- data/lib/elasticsearch/api/actions/benchmark.rb +21 -5
- data/lib/elasticsearch/api/actions/bulk.rb +54 -69
- data/lib/elasticsearch/api/actions/cat/aliases.rb +45 -45
- data/lib/elasticsearch/api/actions/cat/allocation.rb +45 -41
- data/lib/elasticsearch/api/actions/cat/count.rb +38 -39
- data/lib/elasticsearch/api/actions/cat/fielddata.rb +42 -29
- data/lib/elasticsearch/api/actions/cat/health.rb +37 -29
- data/lib/elasticsearch/api/actions/cat/help.rb +31 -9
- data/lib/elasticsearch/api/actions/cat/indices.rb +51 -51
- data/lib/elasticsearch/api/actions/cat/master.rb +36 -26
- data/lib/elasticsearch/api/actions/cat/nodeattrs.rb +36 -14
- data/lib/elasticsearch/api/actions/cat/nodes.rb +43 -39
- data/lib/elasticsearch/api/actions/cat/params_registry.rb +20 -4
- data/lib/elasticsearch/api/actions/cat/pending_tasks.rb +38 -26
- data/lib/elasticsearch/api/actions/cat/plugins.rb +36 -14
- data/lib/elasticsearch/api/actions/cat/recovery.rb +47 -47
- data/lib/elasticsearch/api/actions/cat/repositories.rb +36 -22
- data/lib/elasticsearch/api/actions/cat/segments.rb +42 -19
- data/lib/elasticsearch/api/actions/cat/shards.rb +45 -50
- data/lib/elasticsearch/api/actions/cat/snapshots.rb +44 -25
- data/lib/elasticsearch/api/actions/cat/tasks.rb +40 -16
- data/lib/elasticsearch/api/actions/cat/templates.rb +43 -16
- data/lib/elasticsearch/api/actions/cat/thread_pool.rb +46 -35
- data/lib/elasticsearch/api/actions/clear_scroll.rb +40 -17
- data/lib/elasticsearch/api/actions/cluster/allocation_explain.rb +38 -11
- data/lib/elasticsearch/api/actions/cluster/delete_component_template.rb +62 -0
- data/lib/elasticsearch/api/actions/cluster/delete_voting_config_exclusions.rb +51 -0
- data/lib/elasticsearch/api/actions/cluster/exists_component_template.rb +63 -0
- data/lib/elasticsearch/api/actions/cluster/get_component_template.rb +64 -0
- data/lib/elasticsearch/api/actions/cluster/get_settings.rb +33 -15
- data/lib/elasticsearch/api/actions/cluster/health.rb +46 -27
- data/lib/elasticsearch/api/actions/cluster/params_registry.rb +20 -4
- data/lib/elasticsearch/api/actions/cluster/pending_tasks.rb +32 -14
- data/lib/elasticsearch/api/actions/cluster/post_voting_config_exclusions.rb +55 -0
- data/lib/elasticsearch/api/actions/cluster/put_component_template.rb +66 -0
- data/lib/elasticsearch/api/actions/cluster/put_settings.rb +35 -15
- data/lib/elasticsearch/api/actions/cluster/remote_info.rb +27 -12
- data/lib/elasticsearch/api/actions/cluster/reroute.rb +38 -33
- data/lib/elasticsearch/api/actions/cluster/state.rb +53 -44
- data/lib/elasticsearch/api/actions/cluster/stats.rb +38 -19
- data/lib/elasticsearch/api/actions/count.rb +60 -36
- data/lib/elasticsearch/api/actions/create.rb +37 -25
- data/lib/elasticsearch/api/actions/dangling_indices/delete_dangling_index.rb +60 -0
- data/lib/elasticsearch/api/actions/dangling_indices/import_dangling_index.rb +60 -0
- data/lib/elasticsearch/api/actions/dangling_indices/list_dangling_indices.rb +43 -0
- data/lib/elasticsearch/api/actions/dangling_indices/params_registry.rb +60 -0
- data/lib/elasticsearch/api/actions/delete.rb +62 -47
- data/lib/elasticsearch/api/actions/delete_by_query.rb +82 -57
- data/lib/elasticsearch/api/actions/delete_by_query_rethrottle.rb +36 -11
- data/lib/elasticsearch/api/actions/delete_by_rethrottle.rb +47 -0
- data/lib/elasticsearch/api/actions/delete_script.rb +37 -12
- data/lib/elasticsearch/api/actions/exists.rb +61 -34
- data/lib/elasticsearch/api/actions/exists_source.rb +60 -24
- data/lib/elasticsearch/api/actions/explain.rb +68 -44
- data/lib/elasticsearch/api/actions/field_caps.rb +49 -19
- data/lib/elasticsearch/api/actions/get.rb +60 -40
- data/lib/elasticsearch/api/actions/get_script.rb +37 -13
- data/lib/elasticsearch/api/actions/get_script_context.rb +45 -0
- data/lib/elasticsearch/api/actions/get_script_languages.rb +45 -0
- data/lib/elasticsearch/api/actions/get_source.rb +57 -38
- data/lib/elasticsearch/api/actions/index.rb +67 -74
- data/lib/elasticsearch/api/actions/indices/add_block.rb +68 -0
- data/lib/elasticsearch/api/actions/indices/analyze.rb +41 -34
- data/lib/elasticsearch/api/actions/indices/clear_cache.rb +44 -41
- data/lib/elasticsearch/api/actions/indices/clone.rb +65 -0
- data/lib/elasticsearch/api/actions/indices/close.rb +41 -21
- data/lib/elasticsearch/api/actions/indices/create.rb +39 -69
- data/lib/elasticsearch/api/actions/indices/delete.rb +41 -34
- data/lib/elasticsearch/api/actions/indices/delete_alias.rb +41 -19
- data/lib/elasticsearch/api/actions/indices/delete_index_template.rb +62 -0
- data/lib/elasticsearch/api/actions/indices/delete_template.rb +36 -20
- data/lib/elasticsearch/api/actions/indices/exists.rb +43 -21
- data/lib/elasticsearch/api/actions/indices/exists_alias.rb +46 -18
- data/lib/elasticsearch/api/actions/indices/exists_index_template.rb +65 -0
- data/lib/elasticsearch/api/actions/indices/exists_template.rb +37 -14
- data/lib/elasticsearch/api/actions/indices/exists_type.rb +42 -17
- data/lib/elasticsearch/api/actions/indices/flush.rb +41 -19
- data/lib/elasticsearch/api/actions/indices/flush_synced.rb +45 -11
- data/lib/elasticsearch/api/actions/indices/forcemerge.rb +42 -40
- data/lib/elasticsearch/api/actions/indices/freeze.rb +24 -7
- data/lib/elasticsearch/api/actions/indices/get.rb +42 -18
- data/lib/elasticsearch/api/actions/indices/get_alias.rb +47 -22
- data/lib/elasticsearch/api/actions/indices/get_field_mapping.rb +59 -37
- data/lib/elasticsearch/api/actions/indices/get_index_template.rb +66 -0
- data/lib/elasticsearch/api/actions/indices/get_mapping.rb +57 -32
- data/lib/elasticsearch/api/actions/indices/get_settings.rb +50 -36
- data/lib/elasticsearch/api/actions/indices/get_template.rb +40 -22
- data/lib/elasticsearch/api/actions/indices/get_upgrade.rb +62 -0
- data/lib/elasticsearch/api/actions/indices/open.rb +40 -20
- data/lib/elasticsearch/api/actions/indices/params_registry.rb +20 -4
- data/lib/elasticsearch/api/actions/indices/put_alias.rb +43 -26
- data/lib/elasticsearch/api/actions/indices/put_index_template.rb +66 -0
- data/lib/elasticsearch/api/actions/indices/put_mapping.rb +58 -40
- data/lib/elasticsearch/api/actions/indices/put_settings.rb +46 -36
- data/lib/elasticsearch/api/actions/indices/put_template.rb +40 -24
- data/lib/elasticsearch/api/actions/indices/recovery.rb +38 -22
- data/lib/elasticsearch/api/actions/indices/refresh.rb +39 -25
- data/lib/elasticsearch/api/actions/indices/resolve_index.rb +60 -0
- data/lib/elasticsearch/api/actions/indices/rollover.rb +47 -18
- data/lib/elasticsearch/api/actions/indices/segments.rb +40 -16
- data/lib/elasticsearch/api/actions/indices/shard_stores.rb +41 -13
- data/lib/elasticsearch/api/actions/indices/shrink.rb +40 -17
- data/lib/elasticsearch/api/actions/indices/simulate_index_template.rb +65 -0
- data/lib/elasticsearch/api/actions/indices/simulate_template.rb +67 -0
- data/lib/elasticsearch/api/actions/indices/split.rb +40 -18
- data/lib/elasticsearch/api/actions/indices/stats.rb +68 -104
- data/lib/elasticsearch/api/actions/indices/unfreeze.rb +24 -7
- data/lib/elasticsearch/api/actions/indices/update_aliases.rb +33 -31
- data/lib/elasticsearch/api/actions/indices/upgrade.rb +42 -14
- data/lib/elasticsearch/api/actions/indices/validate_query.rb +64 -57
- data/lib/elasticsearch/api/actions/info.rb +29 -13
- data/lib/elasticsearch/api/actions/ingest/delete_pipeline.rb +36 -11
- data/lib/elasticsearch/api/actions/ingest/get_pipeline.rb +37 -9
- data/lib/elasticsearch/api/actions/ingest/params_registry.rb +20 -4
- data/lib/elasticsearch/api/actions/ingest/processor_grok.rb +27 -13
- data/lib/elasticsearch/api/actions/ingest/put_pipeline.rb +37 -13
- data/lib/elasticsearch/api/actions/ingest/simulate.rb +39 -10
- data/lib/elasticsearch/api/actions/mget.rb +55 -43
- data/lib/elasticsearch/api/actions/msearch.rb +67 -50
- data/lib/elasticsearch/api/actions/msearch_template.rb +62 -29
- data/lib/elasticsearch/api/actions/mtermvectors.rb +59 -32
- data/lib/elasticsearch/api/actions/nodes/hot_threads.rb +46 -22
- data/lib/elasticsearch/api/actions/nodes/info.rb +43 -40
- data/lib/elasticsearch/api/actions/nodes/params_registry.rb +20 -4
- data/lib/elasticsearch/api/actions/nodes/reload_secure_settings.rb +37 -21
- data/lib/elasticsearch/api/actions/nodes/shutdown.rb +22 -5
- data/lib/elasticsearch/api/actions/nodes/stats.rb +53 -33
- data/lib/elasticsearch/api/actions/nodes/usage.rb +46 -12
- data/lib/elasticsearch/api/actions/params_registry.rb +20 -4
- data/lib/elasticsearch/api/actions/ping.rb +30 -18
- data/lib/elasticsearch/api/actions/put_script.rb +44 -31
- data/lib/elasticsearch/api/actions/rank_eval.rb +49 -16
- data/lib/elasticsearch/api/actions/reindex.rb +45 -48
- data/lib/elasticsearch/api/actions/reindex_rethrottle.rb +36 -11
- data/lib/elasticsearch/api/actions/remote/info.rb +18 -2
- data/lib/elasticsearch/api/actions/render_search_template.rb +41 -15
- data/lib/elasticsearch/api/actions/scripts_painless_execute.rb +38 -14
- data/lib/elasticsearch/api/actions/scroll.rb +51 -51
- data/lib/elasticsearch/api/actions/search.rb +96 -121
- data/lib/elasticsearch/api/actions/search_shards.rb +43 -15
- data/lib/elasticsearch/api/actions/search_template.rb +64 -37
- data/lib/elasticsearch/api/actions/snapshot/cleanup_repository.rb +58 -0
- data/lib/elasticsearch/api/actions/snapshot/clone.rb +66 -0
- data/lib/elasticsearch/api/actions/snapshot/create.rb +39 -26
- data/lib/elasticsearch/api/actions/snapshot/create_repository.rb +37 -23
- data/lib/elasticsearch/api/actions/snapshot/delete.rb +38 -21
- data/lib/elasticsearch/api/actions/snapshot/delete_repository.rb +35 -17
- data/lib/elasticsearch/api/actions/snapshot/get.rb +40 -29
- data/lib/elasticsearch/api/actions/snapshot/get_repository.rb +38 -20
- data/lib/elasticsearch/api/actions/snapshot/params_registry.rb +20 -4
- data/lib/elasticsearch/api/actions/snapshot/restore.rb +39 -31
- data/lib/elasticsearch/api/actions/snapshot/status.rb +41 -21
- data/lib/elasticsearch/api/actions/snapshot/verify_repository.rb +36 -12
- data/lib/elasticsearch/api/actions/tasks/cancel.rb +39 -12
- data/lib/elasticsearch/api/actions/tasks/get.rb +34 -12
- data/lib/elasticsearch/api/actions/tasks/list.rb +35 -16
- data/lib/elasticsearch/api/actions/tasks/params_registry.rb +20 -4
- data/lib/elasticsearch/api/actions/termvectors.rb +71 -65
- data/lib/elasticsearch/api/actions/update.rb +68 -72
- data/lib/elasticsearch/api/actions/update_by_query.rb +84 -62
- data/lib/elasticsearch/api/actions/update_by_query_rethrottle.rb +36 -11
- data/lib/elasticsearch/api/namespace/cat.rb +17 -1
- data/lib/elasticsearch/api/namespace/cluster.rb +17 -0
- data/lib/elasticsearch/api/namespace/common.rb +17 -0
- data/lib/elasticsearch/api/namespace/dangling_indices.rb +35 -0
- data/lib/elasticsearch/api/namespace/indices.rb +17 -0
- data/lib/elasticsearch/api/namespace/ingest.rb +17 -0
- data/lib/elasticsearch/api/namespace/nodes.rb +17 -0
- data/lib/elasticsearch/api/namespace/remote.rb +17 -0
- data/lib/elasticsearch/api/namespace/snapshot.rb +17 -0
- data/lib/elasticsearch/api/namespace/tasks.rb +17 -0
- data/lib/elasticsearch/api/utils.rb +17 -0
- data/lib/elasticsearch/api/version.rb +18 -1
- data/lib/elasticsearch/api.rb +22 -2
- data/lib/elasticsearch-api.rb +17 -0
- data/spec/elasticsearch/api/actions/abort_benchmark_spec.rb +17 -0
- data/spec/elasticsearch/api/actions/benchmark_spec.rb +17 -0
- data/spec/elasticsearch/api/actions/bulk_spec.rb +17 -0
- data/spec/elasticsearch/api/actions/cat/aliases_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/cat/allocation_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/cat/count_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/cat/fielddata_spec.rb +19 -2
- data/spec/elasticsearch/api/actions/cat/health_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/cat/help_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/cat/indices_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/cat/master_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/cat/nodeattrs_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/cat/nodes_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/cat/pending_tasks_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/cat/plugins_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/cat/recovery_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/cat/repositories_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/cat/segments_spec.rb +36 -5
- data/spec/elasticsearch/api/actions/cat/shards_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/cat/snapshot_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/cat/tasks_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/cat/templates_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/cat/thread_pool_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/clear_scroll_spec.rb +21 -2
- data/spec/elasticsearch/api/actions/cluster/allocation_explain_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/cluster/get_settings_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/cluster/health_spec.rb +20 -3
- data/spec/elasticsearch/api/actions/cluster/pending_tasks_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/cluster/put_settings_spec.rb +19 -2
- data/spec/elasticsearch/api/actions/cluster/remote_info_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/cluster/reroute_spec.rb +19 -2
- data/spec/elasticsearch/api/actions/cluster/state_spec.rb +19 -2
- data/spec/elasticsearch/api/actions/cluster/stats_spec.rb +18 -18
- data/spec/elasticsearch/api/actions/count_spec.rb +30 -10
- data/spec/elasticsearch/api/actions/create_document_spec.rb +25 -4
- data/spec/elasticsearch/api/actions/dangling_indices/delete_dangling_indices_spec.rb +48 -0
- data/spec/elasticsearch/api/actions/dangling_indices/import_dangling_indices_spec.rb +48 -0
- data/spec/elasticsearch/api/actions/dangling_indices/list_dangling_indices_spec.rb +36 -0
- data/spec/elasticsearch/api/actions/delete_by_query_spec.rb +33 -8
- data/spec/elasticsearch/api/actions/delete_document_spec.rb +21 -8
- data/spec/elasticsearch/api/actions/delete_script_spec.rb +19 -15
- data/spec/elasticsearch/api/actions/exists_document_spec.rb +20 -2
- data/spec/elasticsearch/api/actions/explain_document_spec.rb +26 -15
- data/spec/elasticsearch/api/actions/field_caps_spec.rb +19 -1
- data/spec/elasticsearch/api/actions/get_document_source_spec.rb +24 -4
- data/spec/elasticsearch/api/actions/get_document_spec.rb +20 -2
- data/spec/elasticsearch/api/actions/get_script_spec.rb +25 -14
- data/spec/elasticsearch/api/actions/hashie_spec.rb +17 -0
- data/spec/elasticsearch/api/actions/index_document_spec.rb +25 -22
- data/spec/elasticsearch/api/actions/indices/add_block_spec.rb +63 -0
- data/spec/elasticsearch/api/actions/indices/analyze_spec.rb +24 -12
- data/spec/elasticsearch/api/actions/indices/clear_cache_spec.rb +8 -8
- data/spec/elasticsearch/api/actions/indices/clone_spec.rb +122 -0
- data/spec/elasticsearch/api/actions/indices/close_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/indices/create_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/indices/delete_alias_spec.rb +20 -3
- data/spec/elasticsearch/api/actions/indices/delete_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/indices/delete_template_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/indices/exists_alias_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/indices/exists_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/indices/exists_template_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/indices/exists_type_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/indices/flush_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/indices/flush_synced_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/indices/forcemerge_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/indices/freeze_spec.rb +85 -0
- data/spec/elasticsearch/api/actions/indices/get_alias_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/indices/get_field_mapping_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/indices/get_mapping_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/indices/get_settings_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/indices/get_spec.rb +18 -12
- data/spec/elasticsearch/api/actions/indices/open_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/indices/put_alias_spec.rb +21 -4
- data/spec/elasticsearch/api/actions/indices/put_mapping_spec.rb +21 -4
- data/spec/elasticsearch/api/actions/indices/put_settings_spec.rb +33 -1
- data/spec/elasticsearch/api/actions/indices/put_template_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/indices/recovery_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/indices/refresh_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/indices/rollover_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/indices/segments_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/indices/shard_stores_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/indices/shrink_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/indices/split_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/indices/stats_spec.rb +124 -0
- data/spec/elasticsearch/api/actions/indices/unfreeze_spec.rb +85 -0
- data/spec/elasticsearch/api/actions/indices/update_aliases_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/indices/upgrade_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/indices/validate_query_spec.rb +24 -13
- data/spec/elasticsearch/api/actions/info_spec.rb +19 -1
- data/spec/elasticsearch/api/actions/ingest/delete_pipeline_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/ingest/get_pipeline_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/ingest/put_pipeline_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/ingest/simulate_spec.rb +23 -7
- data/spec/elasticsearch/api/actions/json_builders_spec.rb +27 -11
- data/spec/elasticsearch/api/actions/mget_spec.rb +22 -5
- data/spec/elasticsearch/api/actions/msearch_spec.rb +38 -39
- data/spec/elasticsearch/api/actions/msearch_template_spec.rb +22 -6
- data/spec/elasticsearch/api/actions/mtermvectors_spec.rb +24 -6
- data/spec/elasticsearch/api/actions/nodes/hot_threads_spec.rb +21 -4
- data/spec/elasticsearch/api/actions/nodes/info_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/nodes/reload_secure_settings_spec.rb +24 -10
- data/spec/elasticsearch/api/actions/nodes/shutdown_spec.rb +17 -0
- data/spec/elasticsearch/api/actions/nodes/stats_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/ping_spec.rb +20 -2
- data/spec/elasticsearch/api/actions/put_script_spec.rb +39 -15
- data/spec/elasticsearch/api/actions/reindex_spec.rb +20 -2
- data/spec/elasticsearch/api/actions/remote/info_spec.rb +17 -0
- data/spec/elasticsearch/api/actions/render_search_template_spec.rb +44 -9
- data/spec/elasticsearch/api/actions/scroll_spec.rb +52 -0
- data/spec/elasticsearch/api/actions/search_shards_spec.rb +20 -2
- data/spec/elasticsearch/api/actions/search_spec.rb +24 -6
- data/spec/elasticsearch/api/actions/search_template_spec.rb +22 -5
- data/spec/elasticsearch/api/actions/snapshot/clone_spec.rb +67 -0
- data/spec/elasticsearch/api/actions/snapshot/create_repository_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/snapshot/create_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/snapshot/delete_repository_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/snapshot/delete_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/snapshot/get_repository_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/snapshot/get_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/snapshot/restore_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/snapshot/status_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/snapshot/verify_repository_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/tasks/cancel_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/tasks/get_spec.rb +18 -1
- data/spec/elasticsearch/api/actions/tasks/list_spec.rb +18 -12
- data/spec/elasticsearch/api/actions/termvectors_spec.rb +22 -12
- data/spec/elasticsearch/api/actions/update_by_query_spec.rb +20 -2
- data/spec/elasticsearch/api/actions/update_document_spec.rb +22 -14
- data/spec/elasticsearch/api/api_spec.rb +17 -0
- data/spec/elasticsearch/api/client_spec.rb +17 -0
- data/spec/elasticsearch/api/rest_api_yaml_spec.rb +138 -0
- data/spec/elasticsearch/api/utils_spec.rb +18 -1
- data/spec/rest_yaml_tests_helper.rb +107 -0
- data/spec/spec_helper.rb +33 -34
- data/utils/Gemfile +18 -0
- data/utils/README.md +41 -0
- data/utils/Thorfile +4 -1
- data/utils/thor/.rubocop.yml +2 -0
- data/utils/thor/generate_source.rb +248 -81
- data/utils/thor/generator/endpoint_specifics.rb +181 -0
- data/utils/thor/generator/files_helper.rb +60 -0
- data/utils/thor/lister.rb +20 -4
- data/utils/thor/templates/_documentation_top.erb +39 -0
- data/utils/thor/templates/_method_setup.erb +35 -0
- data/utils/thor/templates/_params_registry.erb +12 -0
- data/utils/thor/templates/_perform_request.erb +38 -0
- data/utils/thor/templates/method.erb +73 -0
- data/utils/thor/templates/{ruby/test.erb → test.erb} +4 -0
- data/utils/thor/templates/{ruby/test_helper.rb → test_helper.rb} +17 -1
- metadata +123 -124
- data/LICENSE.txt +0 -13
- data/lib/elasticsearch/api/actions/count_percolate.rb +0 -82
- data/lib/elasticsearch/api/actions/delete_template.rb +0 -21
- data/lib/elasticsearch/api/actions/field_stats.rb +0 -36
- data/lib/elasticsearch/api/actions/get_template.rb +0 -27
- data/lib/elasticsearch/api/actions/indices/delete_mapping.rb +0 -26
- data/lib/elasticsearch/api/actions/indices/delete_warmer.rb +0 -32
- data/lib/elasticsearch/api/actions/indices/get_aliases.rb +0 -37
- data/lib/elasticsearch/api/actions/indices/get_warmer.rb +0 -62
- data/lib/elasticsearch/api/actions/indices/optimize.rb +0 -77
- data/lib/elasticsearch/api/actions/indices/put_warmer.rb +0 -65
- data/lib/elasticsearch/api/actions/indices/seal.rb +0 -24
- data/lib/elasticsearch/api/actions/indices/snapshot_index.rb +0 -44
- data/lib/elasticsearch/api/actions/indices/status.rb +0 -63
- data/lib/elasticsearch/api/actions/list_benchmarks.rb +0 -27
- data/lib/elasticsearch/api/actions/mlt.rb +0 -130
- data/lib/elasticsearch/api/actions/mpercolate.rb +0 -62
- data/lib/elasticsearch/api/actions/percolate.rb +0 -73
- data/lib/elasticsearch/api/actions/put_template.rb +0 -25
- data/lib/elasticsearch/api/actions/search_exists.rb +0 -63
- data/lib/elasticsearch/api/actions/suggest.rb +0 -49
- data/spec/elasticsearch/api/actions/count_percolate_spec.rb +0 -17
- data/spec/elasticsearch/api/actions/delete_template_spec.rb +0 -17
- data/spec/elasticsearch/api/actions/field_stats_spec.rb +0 -17
- data/spec/elasticsearch/api/actions/get_template_spec.rb +0 -52
- data/spec/elasticsearch/api/actions/indices/delete_mapping_spec.rb +0 -77
- data/spec/elasticsearch/api/actions/indices/delete_warmer_spec.rb +0 -86
- data/spec/elasticsearch/api/actions/indices/get_aliases_spec.rb +0 -55
- data/spec/elasticsearch/api/actions/indices/get_template_spec.rb +0 -59
- data/spec/elasticsearch/api/actions/indices/get_warmer_spec.rb +0 -48
- data/spec/elasticsearch/api/actions/indices/optimize_spec.rb +0 -63
- data/spec/elasticsearch/api/actions/indices/put_warmer_spec.rb +0 -101
- data/spec/elasticsearch/api/actions/indices/seal_spec.rb +0 -18
- data/spec/elasticsearch/api/actions/indices/snapshot_index_spec.rb +0 -89
- data/spec/elasticsearch/api/actions/indices/status_spec.rb +0 -92
- data/spec/elasticsearch/api/actions/list_benchmarks_spec.rb +0 -17
- data/spec/elasticsearch/api/actions/mlt_spec.rb +0 -130
- data/spec/elasticsearch/api/actions/mpercolate_spec.rb +0 -49
- data/spec/elasticsearch/api/actions/percolate_spec.rb +0 -67
- data/spec/elasticsearch/api/actions/put_template_spec.rb +0 -17
- data/spec/elasticsearch/api/actions/scoll_spec.rb +0 -17
- data/spec/elasticsearch/api/actions/search_exists_spec.rb +0 -63
- data/spec/elasticsearch/api/actions/suggest_spec.rb +0 -77
- data/test/integration/yaml_test_runner.rb +0 -546
- data/test/test_helper.rb +0 -42
- data/utils/thor/generate_api.rb +0 -189
- data/utils/thor/templates/ruby/method.erb +0 -60
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dac714c804304eb3c6adb6f684f36a12ac20e434295f9e4112e0688ab7383c07
|
4
|
+
data.tar.gz: 410db64ed13aa2944052ec1cd49f8db3e1ca72ad48b4c1c876f2972a94cd3f93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e56ad971f9768d8ed1e75719cb006ace904b04d132d18a9eebb45678ef4f04d8b286e6326fff427170eae3b912647a43e4d98f3e5d5612e8031c574bbbd57104
|
7
|
+
data.tar.gz: c63a0490e3061f259c8222ea4724bc1c5c711fa1d1608c5c9171a15c222289ac71fa41043f377e2be53bceae9568459f234e733a436b9cc3376510dc393a86b4
|
data/Gemfile
CHANGED
@@ -1,22 +1,43 @@
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
1
18
|
source 'https://rubygems.org'
|
2
19
|
|
3
20
|
# Specify your gem's dependencies in elasticsearch-api.gemspec
|
4
21
|
gemspec
|
5
22
|
|
6
23
|
if File.exist? File.expand_path("../../elasticsearch/elasticsearch.gemspec", __FILE__)
|
7
|
-
gem 'elasticsearch', :
|
24
|
+
gem 'elasticsearch', path: File.expand_path("../../elasticsearch", __FILE__), require: false
|
8
25
|
end
|
9
26
|
|
10
27
|
if File.exist? File.expand_path("../../elasticsearch-transport", __FILE__)
|
11
|
-
gem 'elasticsearch-transport', :
|
28
|
+
gem 'elasticsearch-transport', path: File.expand_path("../../elasticsearch-transport", __FILE__), require: true
|
12
29
|
end
|
13
30
|
|
14
31
|
if File.exist? File.expand_path("../../elasticsearch-extensions", __FILE__)
|
15
|
-
gem 'elasticsearch-extensions', :
|
32
|
+
gem 'elasticsearch-extensions', path: File.expand_path("../../elasticsearch-extensions", __FILE__), require: false
|
16
33
|
end
|
17
34
|
|
18
|
-
|
19
35
|
group :development do
|
20
36
|
gem 'rspec'
|
21
|
-
gem '
|
37
|
+
gem 'rspec_junit_formatter'
|
38
|
+
if defined?(JRUBY_VERSION)
|
39
|
+
gem 'pry-nav'
|
40
|
+
else
|
41
|
+
gem 'pry-byebug'
|
42
|
+
end
|
22
43
|
end
|
data/LICENSE
ADDED
@@ -0,0 +1,202 @@
|
|
1
|
+
|
2
|
+
Apache License
|
3
|
+
Version 2.0, January 2004
|
4
|
+
http://www.apache.org/licenses/
|
5
|
+
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
7
|
+
|
8
|
+
1. Definitions.
|
9
|
+
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
12
|
+
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
14
|
+
the copyright owner that is granting the License.
|
15
|
+
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
17
|
+
other entities that control, are controlled by, or are under common
|
18
|
+
control with that entity. For the purposes of this definition,
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
20
|
+
direction or management of such entity, whether by contract or
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
23
|
+
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
25
|
+
exercising permissions granted by this License.
|
26
|
+
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
28
|
+
including but not limited to software source code, documentation
|
29
|
+
source, and configuration files.
|
30
|
+
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
32
|
+
transformation or translation of a Source form, including but
|
33
|
+
not limited to compiled object code, generated documentation,
|
34
|
+
and conversions to other media types.
|
35
|
+
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
37
|
+
Object form, made available under the License, as indicated by a
|
38
|
+
copyright notice that is included in or attached to the work
|
39
|
+
(an example is provided in the Appendix below).
|
40
|
+
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
47
|
+
the Work and Derivative Works thereof.
|
48
|
+
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
50
|
+
the original version of the Work and any modifications or additions
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
62
|
+
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
65
|
+
subsequently incorporated within the Work.
|
66
|
+
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
73
|
+
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
79
|
+
where such license applies only to those patent claims licensable
|
80
|
+
by such Contributor that are necessarily infringed by their
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
83
|
+
institute patent litigation against any entity (including a
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
86
|
+
or contributory patent infringement, then any patent licenses
|
87
|
+
granted to You under this License for that Work shall terminate
|
88
|
+
as of the date such litigation is filed.
|
89
|
+
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
92
|
+
modifications, and in Source or Object form, provided that You
|
93
|
+
meet the following conditions:
|
94
|
+
|
95
|
+
(a) You must give any other recipients of the Work or
|
96
|
+
Derivative Works a copy of this License; and
|
97
|
+
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
99
|
+
stating that You changed the files; and
|
100
|
+
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
103
|
+
attribution notices from the Source form of the Work,
|
104
|
+
excluding those notices that do not pertain to any part of
|
105
|
+
the Derivative Works; and
|
106
|
+
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
109
|
+
include a readable copy of the attribution notices contained
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
112
|
+
of the following places: within a NOTICE text file distributed
|
113
|
+
as part of the Derivative Works; within the Source form or
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
115
|
+
within a display generated by the Derivative Works, if and
|
116
|
+
wherever such third-party notices normally appear. The contents
|
117
|
+
of the NOTICE file are for informational purposes only and
|
118
|
+
do not modify the License. You may add Your own attribution
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
121
|
+
that such additional attribution notices cannot be construed
|
122
|
+
as modifying the License.
|
123
|
+
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
125
|
+
may provide additional or different license terms and conditions
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
129
|
+
the conditions stated in this License.
|
130
|
+
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
134
|
+
this License, without any additional terms or conditions.
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
136
|
+
the terms of any separate license agreement you may have executed
|
137
|
+
with Licensor regarding such Contributions.
|
138
|
+
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
141
|
+
except as required for reasonable and customary use in describing the
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
143
|
+
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
153
|
+
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
159
|
+
incidental, or consequential damages of any character arising as a
|
160
|
+
result of this License or out of the use or inability to use the
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
163
|
+
other commercial damages or losses), even if such Contributor
|
164
|
+
has been advised of the possibility of such damages.
|
165
|
+
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
169
|
+
or other liability obligations and/or rights consistent with this
|
170
|
+
License. However, in accepting such obligations, You may act only
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
175
|
+
of your accepting any such warranty or additional liability.
|
176
|
+
|
177
|
+
END OF TERMS AND CONDITIONS
|
178
|
+
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
180
|
+
|
181
|
+
To apply the Apache License to your work, attach the following
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
183
|
+
replaced with your own identifying information. (Don't include
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
185
|
+
comment syntax for the file format. We also recommend that a
|
186
|
+
file or class name and description of purpose be included on the
|
187
|
+
same "printed page" as the copyright notice for easier
|
188
|
+
identification within third-party archives.
|
189
|
+
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
191
|
+
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
193
|
+
you may not use this file except in compliance with the License.
|
194
|
+
You may obtain a copy of the License at
|
195
|
+
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
197
|
+
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
201
|
+
See the License for the specific language governing permissions and
|
202
|
+
limitations under the License.
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@ please refer to it, unless you want to use this library standalone.**
|
|
6
6
|
----
|
7
7
|
|
8
8
|
The `elasticsearch-api` library provides a Ruby implementation of
|
9
|
-
the [Elasticsearch](http://elasticsearch.
|
9
|
+
the [Elasticsearch](http://elasticsearch.com) REST API.
|
10
10
|
|
11
11
|
It does not provide an Elasticsearch client; see the
|
12
12
|
[`elasticsearch-transport`](https://github.com/elasticsearch/elasticsearch-ruby/tree/master/elasticsearch-transport) library.
|
@@ -23,6 +23,7 @@ just use a release matching major version of Elasticsearch.
|
|
23
23
|
| 2.x | → | 2.x |
|
24
24
|
| 5.x | → | 5.x |
|
25
25
|
| 6.x | → | 6.x |
|
26
|
+
| 7.x | → | 7.x |
|
26
27
|
| master | → | master |
|
27
28
|
|
28
29
|
## Installation
|
@@ -71,30 +72,46 @@ and available online at <http://rubydoc.info/gems/elasticsearch-api>.
|
|
71
72
|
|
72
73
|
When you want to mix the library into your own client, it must conform to a following _contract_:
|
73
74
|
|
74
|
-
* It responds to a `perform_request(method, path, params, body)` method,
|
75
|
+
* It responds to a `perform_request(method, path, params, body, headers)` method,
|
75
76
|
* the method returns an object with `status`, `body` and `headers` methods.
|
76
77
|
|
77
|
-
A simple client could look like this:
|
78
|
+
A simple client could look like this (_with a dependency on `active_support` to parse the query params_):
|
78
79
|
|
79
80
|
```ruby
|
80
81
|
require 'multi_json'
|
81
82
|
require 'faraday'
|
82
83
|
require 'elasticsearch/api'
|
84
|
+
require 'active_support'
|
83
85
|
|
84
86
|
class MySimpleClient
|
85
87
|
include Elasticsearch::API
|
86
88
|
|
87
89
|
CONNECTION = ::Faraday::Connection.new url: 'http://localhost:9200'
|
88
90
|
|
89
|
-
def perform_request(method, path, params, body)
|
90
|
-
puts "--> #{method.upcase} #{path} #{params} #{body}"
|
91
|
+
def perform_request(method, path, params, body, headers = nil)
|
92
|
+
puts "--> #{method.upcase} #{path} #{params} #{body} #{headers}"
|
91
93
|
|
92
94
|
CONNECTION.run_request \
|
93
95
|
method.downcase.to_sym,
|
94
|
-
path,
|
96
|
+
path_with_params(path, params),
|
95
97
|
( body ? MultiJson.dump(body): nil ),
|
96
98
|
{'Content-Type' => 'application/json'}
|
97
99
|
end
|
100
|
+
|
101
|
+
private
|
102
|
+
|
103
|
+
def path_with_params(path, params)
|
104
|
+
return path if params.blank?
|
105
|
+
|
106
|
+
case params
|
107
|
+
when String
|
108
|
+
"#{path}?#{params}"
|
109
|
+
when Hash
|
110
|
+
"#{path}?#{params.to_query}"
|
111
|
+
else
|
112
|
+
raise ArgumentError, "Cannot parse params: '#{params}'"
|
113
|
+
end
|
114
|
+
end
|
98
115
|
end
|
99
116
|
|
100
117
|
client = MySimpleClient.new
|
@@ -189,18 +206,4 @@ can use Ruby 2.x syntax and features.
|
|
189
206
|
|
190
207
|
## License
|
191
208
|
|
192
|
-
This software is licensed under the Apache 2 license
|
193
|
-
|
194
|
-
Copyright (c) 2013 Elasticsearch <http://www.elasticsearch.org>
|
195
|
-
|
196
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
197
|
-
you may not use this file except in compliance with the License.
|
198
|
-
You may obtain a copy of the License at
|
199
|
-
|
200
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
201
|
-
|
202
|
-
Unless required by applicable law or agreed to in writing, software
|
203
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
204
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
205
|
-
See the License for the specific language governing permissions and
|
206
|
-
limitations under the License.
|
209
|
+
This software is licensed under the [Apache 2 license](./LICENSE).
|
data/Rakefile
CHANGED
@@ -1,4 +1,21 @@
|
|
1
|
-
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
18
|
+
require 'bundler/gem_tasks'
|
2
19
|
|
3
20
|
def __current__
|
4
21
|
Pathname( File.expand_path('..', __FILE__) )
|
@@ -8,8 +25,8 @@ def git_specs(command, options={})
|
|
8
25
|
sh "git --git-dir=#{__current__.join('../tmp/elasticsearch/.git')} --work-tree=#{__current__.join('../tmp/elasticsearch')} #{command}", options
|
9
26
|
end
|
10
27
|
|
11
|
-
task(:default) { system
|
12
|
-
task
|
28
|
+
task(:default) { system 'rake --tasks' }
|
29
|
+
task test: 'test:unit'
|
13
30
|
|
14
31
|
# ----- Test tasks ------------------------------------------------------------
|
15
32
|
|
@@ -17,29 +34,30 @@ require 'rake/testtask'
|
|
17
34
|
require 'rspec/core/rake_task'
|
18
35
|
|
19
36
|
namespace :test do
|
37
|
+
desc 'Wait for Elasticsearch to be in a green state'
|
38
|
+
task :wait_for_green do
|
39
|
+
sh '../scripts/wait-cluster.sh'
|
40
|
+
end
|
20
41
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
42
|
+
# Unit tests - rake test:unit
|
43
|
+
#
|
44
|
+
task unit: :spec
|
45
|
+
RSpec::Core::RakeTask.new(:spec) do |t|
|
46
|
+
t.exclude_pattern = 'spec/**{,/*/**}/rest_api_yaml_spec.rb'
|
26
47
|
end
|
27
48
|
|
28
|
-
|
29
|
-
|
30
|
-
|
49
|
+
# Rest API Spec tests - rake test:rest_api
|
50
|
+
RSpec::Core::RakeTask.new(:rest_api) do |t|
|
51
|
+
t.pattern = 'spec/**{,/*/**}/rest_api_yaml_spec.rb'
|
31
52
|
end
|
32
53
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
test.deps = [ :spec ]
|
37
|
-
# test.verbose = true
|
38
|
-
# test.warning = true
|
54
|
+
desc 'Update the repository with YAML tests'
|
55
|
+
task :update do
|
56
|
+
git_specs 'fetch origin', verbose: true
|
39
57
|
end
|
40
58
|
|
41
59
|
desc "Run integration tests"
|
42
|
-
task :
|
60
|
+
task integration: :update do
|
43
61
|
require 'elasticsearch'
|
44
62
|
|
45
63
|
branches = `git --git-dir=#{__current__.join('../tmp/elasticsearch/.git')} --work-tree=#{__current__.join('../tmp/elasticsearch')} branch --no-color`
|
@@ -56,15 +74,6 @@ namespace :test do
|
|
56
74
|
current_branch = 'master'
|
57
75
|
end
|
58
76
|
|
59
|
-
# Define the task
|
60
|
-
t = Rake::TestTask.new(:integration) do |test|
|
61
|
-
test.deps = [ :wait_for_green ]
|
62
|
-
test.libs << 'lib' << 'test'
|
63
|
-
test.test_files = FileList["test/integration/yaml_test_runner.rb", "test/integration/**/*_test.rb"]
|
64
|
-
test.verbose = false
|
65
|
-
test.warning = false
|
66
|
-
end
|
67
|
-
|
68
77
|
# Check if a test cluster is running
|
69
78
|
begin
|
70
79
|
url = ENV['TEST_CLUSTER_URL'] || ENV['TEST_ES_SERVER']
|
@@ -73,7 +82,7 @@ namespace :test do
|
|
73
82
|
es_version_info = client.info['version']
|
74
83
|
build_hash = es_version_info['build_hash']
|
75
84
|
cluster_running = true
|
76
|
-
rescue Faraday::
|
85
|
+
rescue Faraday::ConnectionFailed
|
77
86
|
STDERR.puts "[!] Test cluster not running?"
|
78
87
|
cluster_running = false
|
79
88
|
end
|
@@ -99,23 +108,14 @@ namespace :test do
|
|
99
108
|
git_specs "checkout #{checkout_build_hash} --force --quiet"
|
100
109
|
end
|
101
110
|
|
102
|
-
|
103
|
-
args = [t.ruby_opts_string, t.run_code, t.file_list_string, t.option_list].join(' ')
|
104
|
-
|
105
|
-
ruby args do |ok, status|
|
106
|
-
if !ok && status.respond_to?(:signaled?) && status.signaled?
|
107
|
-
raise SignalException.new(status.termsig)
|
108
|
-
elsif !ok
|
109
|
-
fail "Command failed with status (#{status.exitstatus}): " + "[ruby #{args}]"
|
110
|
-
end
|
111
|
-
end
|
111
|
+
Rake::Task['test:rest_api'].invoke
|
112
112
|
|
113
113
|
ensure
|
114
114
|
git_specs "checkout #{current_branch} --force --quiet" if checkout_specs_version && current_branch
|
115
115
|
end
|
116
116
|
end
|
117
117
|
|
118
|
-
desc
|
118
|
+
desc 'Run unit and integration tests'
|
119
119
|
task :all do
|
120
120
|
Rake::Task['test:unit'].invoke
|
121
121
|
Rake::Task['test:integration'].invoke
|
@@ -147,10 +147,8 @@ end
|
|
147
147
|
|
148
148
|
# ----- Code analysis tasks ---------------------------------------------------
|
149
149
|
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
cane.no_style = true
|
155
|
-
end
|
150
|
+
require 'cane/rake_task'
|
151
|
+
Cane::RakeTask.new(:quality) do |cane|
|
152
|
+
cane.abc_max = 15
|
153
|
+
cane.no_style = true
|
156
154
|
end
|
data/elasticsearch-api.gemspec
CHANGED
@@ -1,75 +1,76 @@
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
1
18
|
# coding: utf-8
|
2
19
|
lib = File.expand_path('../lib', __FILE__)
|
3
20
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
21
|
require 'elasticsearch/api/version'
|
5
22
|
|
6
23
|
Gem::Specification.new do |s|
|
7
|
-
s.name =
|
24
|
+
s.name = 'elasticsearch-api'
|
8
25
|
s.version = Elasticsearch::API::VERSION
|
9
|
-
s.authors = [
|
10
|
-
s.email = [
|
11
|
-
s.summary =
|
12
|
-
s.homepage =
|
13
|
-
s.license =
|
14
|
-
|
26
|
+
s.authors = ['Karel Minarik']
|
27
|
+
s.email = ['karel.minarik@elasticsearch.org']
|
28
|
+
s.summary = 'Ruby API for Elasticsearch.'
|
29
|
+
s.homepage = 'https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/7.x/index.html'
|
30
|
+
s.license = 'Apache-2.0'
|
31
|
+
s.metadata = {
|
32
|
+
'homepage_uri' => 'https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/7.x/index.html',
|
33
|
+
'changelog_uri' => 'https://github.com/elastic/elasticsearch-ruby/blob/7.x/CHANGELOG.md',
|
34
|
+
'source_code_uri' => 'https://github.com/elastic/elasticsearch-ruby/tree/7.x/elasticsearch-api',
|
35
|
+
'bug_tracker_uri' => 'https://github.com/elastic/elasticsearch-ruby/issues'
|
36
|
+
}
|
15
37
|
s.files = `git ls-files`.split($/)
|
16
38
|
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
39
|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
18
|
-
s.require_paths = [
|
19
|
-
|
20
|
-
s.extra_rdoc_files = [ "README.md", "LICENSE.txt" ]
|
21
|
-
s.rdoc_options = [ "--charset=UTF-8" ]
|
22
|
-
|
23
|
-
s.required_ruby_version = '>= 1.9'
|
40
|
+
s.require_paths = ['lib']
|
24
41
|
|
25
|
-
s.
|
42
|
+
s.extra_rdoc_files = [ 'README.md', 'LICENSE' ]
|
43
|
+
s.rdoc_options = [ '--charset=UTF-8' ]
|
26
44
|
|
27
|
-
s.
|
45
|
+
s.required_ruby_version = '>= 2.4'
|
28
46
|
|
29
|
-
|
30
|
-
s.add_development_dependency "rake", "~> 11.1"
|
31
|
-
else
|
32
|
-
s.add_development_dependency "rake", "< 11.0"
|
33
|
-
end
|
47
|
+
s.add_dependency 'multi_json'
|
34
48
|
|
35
|
-
s.add_development_dependency
|
36
|
-
s.add_development_dependency
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
s.add_development_dependency
|
44
|
-
s.add_development_dependency
|
45
|
-
s.add_development_dependency
|
46
|
-
s.add_development_dependency
|
47
|
-
s.add_development_dependency "yard"
|
48
|
-
s.add_development_dependency "pry"
|
49
|
+
s.add_development_dependency 'ansi'
|
50
|
+
s.add_development_dependency 'bundler'
|
51
|
+
s.add_development_dependency 'elasticsearch'
|
52
|
+
s.add_development_dependency 'elasticsearch-extensions'
|
53
|
+
s.add_development_dependency 'elasticsearch-transport'
|
54
|
+
s.add_development_dependency 'minitest'
|
55
|
+
s.add_development_dependency 'minitest-reporters'
|
56
|
+
s.add_development_dependency 'mocha'
|
57
|
+
s.add_development_dependency 'pry'
|
58
|
+
s.add_development_dependency 'rake', '~> 11.1'
|
59
|
+
s.add_development_dependency 'shoulda-context'
|
60
|
+
s.add_development_dependency 'yard'
|
49
61
|
|
50
62
|
# Gems for testing integrations
|
51
|
-
s.add_development_dependency
|
52
|
-
s.add_development_dependency
|
53
|
-
|
54
|
-
# Prevent unit test failures on Ruby 1.8
|
55
|
-
if defined?(RUBY_VERSION) && RUBY_VERSION < '1.9'
|
56
|
-
s.add_development_dependency "test-unit", '~> 2'
|
57
|
-
s.add_development_dependency "json", '~> 1.8'
|
58
|
-
end
|
59
|
-
|
60
|
-
if defined?(RUBY_VERSION) && RUBY_VERSION > '1.9'
|
61
|
-
s.add_development_dependency "ruby-prof" unless defined?(JRUBY_VERSION) || defined?(Rubinius)
|
62
|
-
s.add_development_dependency "jbuilder"
|
63
|
-
s.add_development_dependency "escape_utils" unless defined? JRUBY_VERSION
|
64
|
-
s.add_development_dependency "simplecov"
|
65
|
-
s.add_development_dependency "simplecov-rcov"
|
66
|
-
s.add_development_dependency "cane"
|
67
|
-
s.add_development_dependency "require-prof" unless defined?(JRUBY_VERSION) || defined?(Rubinius)
|
68
|
-
end
|
63
|
+
s.add_development_dependency 'jsonify'
|
64
|
+
s.add_development_dependency 'hashie'
|
69
65
|
|
70
|
-
|
71
|
-
|
72
|
-
|
66
|
+
s.add_development_dependency 'cane'
|
67
|
+
s.add_development_dependency 'escape_utils' unless defined? JRUBY_VERSION
|
68
|
+
s.add_development_dependency 'jbuilder'
|
69
|
+
s.add_development_dependency 'require-prof' unless defined?(JRUBY_VERSION) || defined?(Rubinius)
|
70
|
+
s.add_development_dependency 'simplecov', '~> 0.17', '< 0.18'
|
71
|
+
s.add_development_dependency 'simplecov-rcov'
|
72
|
+
s.add_development_dependency 'test-unit', '~> 2'
|
73
|
+
s.add_development_dependency 'ruby-prof' unless defined?(JRUBY_VERSION) || defined?(Rubinius)
|
73
74
|
|
74
75
|
s.description = <<-DESC.gsub(/^ /, '')
|
75
76
|
Ruby API for Elasticsearch. See the `elasticsearch` gem for full integration.
|
@@ -1,7 +1,23 @@
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
1
18
|
module Elasticsearch
|
2
19
|
module API
|
3
20
|
module Actions
|
4
|
-
|
5
21
|
# Abort a running benchmark
|
6
22
|
#
|
7
23
|
# @example
|
@@ -10,9 +26,9 @@ module Elasticsearch
|
|
10
26
|
#
|
11
27
|
# @option arguments [String] :name A benchmark name
|
12
28
|
#
|
13
|
-
# @see
|
29
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/search-benchmark.html
|
14
30
|
#
|
15
|
-
def abort_benchmark(arguments={})
|
31
|
+
def abort_benchmark(arguments = {})
|
16
32
|
method = HTTP_POST
|
17
33
|
path = "_bench/abort/#{arguments[:name]}"
|
18
34
|
params = {}
|