Module: Elasticsearch::API

Defined in:
lib/elasticsearch/api.rb,
lib/elasticsearch/api/utils.rb,
lib/elasticsearch/api/version.rb,
lib/elasticsearch/api/actions/get.rb,
lib/elasticsearch/api/actions/bulk.rb,
lib/elasticsearch/api/actions/info.rb,
lib/elasticsearch/api/actions/mget.rb,
lib/elasticsearch/api/actions/ping.rb,
lib/elasticsearch/api/actions/count.rb,
lib/elasticsearch/api/actions/index.rb,
lib/elasticsearch/api/namespace/cat.rb,
lib/elasticsearch/api/actions/create.rb,
lib/elasticsearch/api/actions/delete.rb,
lib/elasticsearch/api/actions/exists.rb,
lib/elasticsearch/api/actions/scroll.rb,
lib/elasticsearch/api/actions/search.rb,
lib/elasticsearch/api/actions/update.rb,
lib/elasticsearch/api/actions/explain.rb,
lib/elasticsearch/api/actions/msearch.rb,
lib/elasticsearch/api/actions/reindex.rb,
lib/elasticsearch/api/namespace/nodes.rb,
lib/elasticsearch/api/namespace/tasks.rb,
lib/elasticsearch/api/actions/cat/help.rb,
lib/elasticsearch/api/namespace/common.rb,
lib/elasticsearch/api/namespace/ingest.rb,
lib/elasticsearch/api/namespace/remote.rb,
lib/elasticsearch/api/actions/benchmark.rb,
lib/elasticsearch/api/actions/cat/count.rb,
lib/elasticsearch/api/actions/cat/nodes.rb,
lib/elasticsearch/api/actions/cat/tasks.rb,
lib/elasticsearch/api/actions/rank_eval.rb,
lib/elasticsearch/api/actions/tasks/get.rb,
lib/elasticsearch/api/namespace/cluster.rb,
lib/elasticsearch/api/namespace/indices.rb,
lib/elasticsearch/api/actions/cat/health.rb,
lib/elasticsearch/api/actions/cat/master.rb,
lib/elasticsearch/api/actions/cat/shards.rb,
lib/elasticsearch/api/actions/field_caps.rb,
lib/elasticsearch/api/actions/get_script.rb,
lib/elasticsearch/api/actions/get_source.rb,
lib/elasticsearch/api/actions/nodes/info.rb,
lib/elasticsearch/api/actions/put_script.rb,
lib/elasticsearch/api/actions/tasks/list.rb,
lib/elasticsearch/api/namespace/features.rb,
lib/elasticsearch/api/namespace/shutdown.rb,
lib/elasticsearch/api/namespace/snapshot.rb,
lib/elasticsearch/api/actions/cat/aliases.rb,
lib/elasticsearch/api/actions/cat/indices.rb,
lib/elasticsearch/api/actions/cat/plugins.rb,
lib/elasticsearch/api/actions/indices/get.rb,
lib/elasticsearch/api/actions/nodes/stats.rb,
lib/elasticsearch/api/actions/nodes/usage.rb,
lib/elasticsearch/api/actions/remote/info.rb,
lib/elasticsearch/api/actions/termvectors.rb,
lib/elasticsearch/api/actions/cat/recovery.rb,
lib/elasticsearch/api/actions/cat/segments.rb,
lib/elasticsearch/api/actions/clear_scroll.rb,
lib/elasticsearch/api/actions/indices/open.rb,
lib/elasticsearch/api/actions/mtermvectors.rb,
lib/elasticsearch/api/actions/snapshot/get.rb,
lib/elasticsearch/api/actions/tasks/cancel.rb,
lib/elasticsearch/api/actions/cat/fielddata.rb,
lib/elasticsearch/api/actions/cat/nodeattrs.rb,
lib/elasticsearch/api/actions/cat/snapshots.rb,
lib/elasticsearch/api/actions/cat/templates.rb,
lib/elasticsearch/api/actions/cluster/state.rb,
lib/elasticsearch/api/actions/cluster/stats.rb,
lib/elasticsearch/api/actions/delete_script.rb,
lib/elasticsearch/api/actions/exists_source.rb,
lib/elasticsearch/api/actions/indices/clone.rb,
lib/elasticsearch/api/actions/indices/close.rb,
lib/elasticsearch/api/actions/indices/flush.rb,
lib/elasticsearch/api/actions/indices/split.rb,
lib/elasticsearch/api/actions/indices/stats.rb,
lib/elasticsearch/api/actions/search_shards.rb,
lib/elasticsearch/api/actions/cat/allocation.rb,
lib/elasticsearch/api/actions/cluster/health.rb,
lib/elasticsearch/api/actions/indices/create.rb,
lib/elasticsearch/api/actions/indices/delete.rb,
lib/elasticsearch/api/actions/indices/exists.rb,
lib/elasticsearch/api/actions/indices/shrink.rb,
lib/elasticsearch/api/actions/nodes/shutdown.rb,
lib/elasticsearch/api/actions/snapshot/clone.rb,
lib/elasticsearch/api/actions/abort_benchmark.rb,
lib/elasticsearch/api/actions/cat/thread_pool.rb,
lib/elasticsearch/api/actions/cluster/reroute.rb,
lib/elasticsearch/api/actions/delete_by_query.rb,
lib/elasticsearch/api/actions/indices/analyze.rb,
lib/elasticsearch/api/actions/indices/refresh.rb,
lib/elasticsearch/api/actions/indices/upgrade.rb,
lib/elasticsearch/api/actions/ingest/simulate.rb,
lib/elasticsearch/api/actions/params_registry.rb,
lib/elasticsearch/api/actions/search_template.rb,
lib/elasticsearch/api/actions/snapshot/create.rb,
lib/elasticsearch/api/actions/snapshot/delete.rb,
lib/elasticsearch/api/actions/snapshot/status.rb,
lib/elasticsearch/api/actions/update_by_query.rb,
lib/elasticsearch/api/actions/cat/repositories.rb,
lib/elasticsearch/api/actions/indices/recovery.rb,
lib/elasticsearch/api/actions/indices/rollover.rb,
lib/elasticsearch/api/actions/indices/segments.rb,
lib/elasticsearch/api/actions/msearch_template.rb,
lib/elasticsearch/api/actions/snapshot/restore.rb,
lib/elasticsearch/api/actions/cat/pending_tasks.rb,
lib/elasticsearch/api/actions/indices/add_block.rb,
lib/elasticsearch/api/actions/indices/get_alias.rb,
lib/elasticsearch/api/actions/indices/put_alias.rb,
lib/elasticsearch/api/actions/nodes/hot_threads.rb,
lib/elasticsearch/api/actions/shutdown/get_node.rb,
lib/elasticsearch/api/actions/shutdown/put_node.rb,
lib/elasticsearch/api/actions/get_script_context.rb,
lib/elasticsearch/api/actions/indices/forcemerge.rb,
lib/elasticsearch/api/actions/open_point_in_time.rb,
lib/elasticsearch/api/actions/reindex_rethrottle.rb,
lib/elasticsearch/api/namespace/dangling_indices.rb,
lib/elasticsearch/api/actions/cat/params_registry.rb,
lib/elasticsearch/api/actions/close_point_in_time.rb,
lib/elasticsearch/api/actions/cluster/remote_info.rb,
lib/elasticsearch/api/actions/indices/clear_cache.rb,
lib/elasticsearch/api/actions/indices/exists_type.rb,
lib/elasticsearch/api/actions/indices/get_mapping.rb,
lib/elasticsearch/api/actions/indices/get_upgrade.rb,
lib/elasticsearch/api/actions/indices/put_mapping.rb,
lib/elasticsearch/api/actions/ingest/geo_ip_stats.rb,
lib/elasticsearch/api/actions/ingest/get_pipeline.rb,
lib/elasticsearch/api/actions/ingest/put_pipeline.rb,
lib/elasticsearch/api/actions/cluster/get_settings.rb,
lib/elasticsearch/api/actions/cluster/put_settings.rb,
lib/elasticsearch/api/actions/delete_by_rethrottle.rb,
lib/elasticsearch/api/actions/get_script_languages.rb,
lib/elasticsearch/api/actions/indices/delete_alias.rb,
lib/elasticsearch/api/actions/indices/exists_alias.rb,
lib/elasticsearch/api/actions/indices/flush_synced.rb,
lib/elasticsearch/api/actions/indices/get_settings.rb,
lib/elasticsearch/api/actions/indices/get_template.rb,
lib/elasticsearch/api/actions/indices/put_settings.rb,
lib/elasticsearch/api/actions/indices/put_template.rb,
lib/elasticsearch/api/actions/indices/shard_stores.rb,
lib/elasticsearch/api/actions/shutdown/delete_node.rb,
lib/elasticsearch/api/actions/cluster/pending_tasks.rb,
lib/elasticsearch/api/actions/features/get_features.rb,
lib/elasticsearch/api/actions/indices/resolve_index.rb,
lib/elasticsearch/api/actions/ingest/processor_grok.rb,
lib/elasticsearch/api/actions/nodes/params_registry.rb,
lib/elasticsearch/api/actions/snapshot/get_features.rb,
lib/elasticsearch/api/actions/tasks/params_registry.rb,
lib/elasticsearch/api/actions/indices/update_aliases.rb,
lib/elasticsearch/api/actions/indices/validate_query.rb,
lib/elasticsearch/api/actions/ingest/delete_pipeline.rb,
lib/elasticsearch/api/actions/ingest/params_registry.rb,
lib/elasticsearch/api/actions/render_search_template.rb,
lib/elasticsearch/api/actions/cluster/params_registry.rb,
lib/elasticsearch/api/actions/features/reset_features.rb,
lib/elasticsearch/api/actions/indices/delete_template.rb,
lib/elasticsearch/api/actions/indices/exists_template.rb,
lib/elasticsearch/api/actions/indices/params_registry.rb,
lib/elasticsearch/api/actions/snapshot/get_repository.rb,
lib/elasticsearch/api/actions/features/params_registry.rb,
lib/elasticsearch/api/actions/scripts_painless_execute.rb,
lib/elasticsearch/api/actions/shutdown/params_registry.rb,
lib/elasticsearch/api/actions/snapshot/params_registry.rb,
lib/elasticsearch/api/actions/indices/get_field_mapping.rb,
lib/elasticsearch/api/actions/indices/simulate_template.rb,
lib/elasticsearch/api/actions/cluster/allocation_explain.rb,
lib/elasticsearch/api/actions/delete_by_query_rethrottle.rb,
lib/elasticsearch/api/actions/indices/get_index_template.rb,
lib/elasticsearch/api/actions/indices/put_index_template.rb,
lib/elasticsearch/api/actions/snapshot/create_repository.rb,
lib/elasticsearch/api/actions/snapshot/delete_repository.rb,
lib/elasticsearch/api/actions/snapshot/verify_repository.rb,
lib/elasticsearch/api/actions/update_by_query_rethrottle.rb,
lib/elasticsearch/api/actions/snapshot/cleanup_repository.rb,
lib/elasticsearch/api/actions/nodes/reload_secure_settings.rb,
lib/elasticsearch/api/actions/indices/delete_index_template.rb,
lib/elasticsearch/api/actions/indices/exists_index_template.rb,
lib/elasticsearch/api/actions/cluster/get_component_template.rb,
lib/elasticsearch/api/actions/cluster/put_component_template.rb,
lib/elasticsearch/api/actions/indices/simulate_index_template.rb,
lib/elasticsearch/api/actions/dangling_indices/params_registry.rb,
lib/elasticsearch/api/actions/cluster/delete_component_template.rb,
lib/elasticsearch/api/actions/cluster/exists_component_template.rb,
lib/elasticsearch/api/actions/cluster/post_voting_config_exclusions.rb,
lib/elasticsearch/api/actions/dangling_indices/delete_dangling_index.rb,
lib/elasticsearch/api/actions/dangling_indices/import_dangling_index.rb,
lib/elasticsearch/api/actions/dangling_indices/list_dangling_indices.rb,
lib/elasticsearch/api/actions/cluster/delete_voting_config_exclusions.rb

Defined Under Namespace

Modules: Actions, Cat, Cluster, Common, DanglingIndices, Features, Indices, Ingest, Nodes, Remote, Shutdown, Snapshot, Tasks, Utils

Constant Summary collapse

DEFAULT_SERIALIZER =
MultiJson
COMMON_PARAMS =
[
  :ignore,                        # Client specific parameters
  :index, :type, :id,             # :index/:type/:id
  :body,                          # Request body
  :node_id,                       # Cluster
  :name,                          # Alias, template, settings, warmer, ...
  :field                          # Get field mapping
]
COMMON_QUERY_PARAMS =
[
  :ignore,                        # Client specific parameters
  :format,                        # Search, Cat, ...
  :pretty,                        # Pretty-print the response
  :human,                         # Return numeric values in human readable format
  :filter_path,                   # Filter the JSON response
  :opaque_id                      # Use X-Opaque-Id
]
HTTP_GET =
'GET'.freeze
HTTP_HEAD =
'HEAD'.freeze
HTTP_POST =
'POST'.freeze
HTTP_PUT =
'PUT'.freeze
HTTP_DELETE =
'DELETE'.freeze
UNDERSCORE_SEARCH =
'_search'.freeze
UNDERSCORE_ALL =
'_all'.freeze
DEFAULT_DOC =
'_doc'.freeze
VERSION =
'7.13.3'.freeze

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

Auto-include all namespaces in the receiver


63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/elasticsearch/api.rb', line 63

def self.included(base)
  base.send :include,
            Elasticsearch::API::Common,
            Elasticsearch::API::Actions,
            Elasticsearch::API::Cluster,
            Elasticsearch::API::Nodes,
            Elasticsearch::API::Indices,
            Elasticsearch::API::Ingest,
            Elasticsearch::API::Snapshot,
            Elasticsearch::API::Tasks,
            Elasticsearch::API::Cat,
            Elasticsearch::API::Remote,
            Elasticsearch::API::DanglingIndices,
            Elasticsearch::API::Features,
            Elasticsearch::API::Shutdown
end

.serializerObject

The serializer class


82
83
84
# File 'lib/elasticsearch/api.rb', line 82

def self.serializer
  settings[:serializer] || DEFAULT_SERIALIZER
end

.settingsObject

Access the module settings


88
89
90
# File 'lib/elasticsearch/api.rb', line 88

def self.settings
  @settings ||= {}
end