Module: OpenSearch::API

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

Defined Under Namespace

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

Constant Summary collapse

DEFAULT_SERIALIZER =
MultiJson
COMMON_PARAMS =
[
  :ignore,                        # Client specific parameters
  :index, :id,                    # :index/: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 =
'2.2.0'.freeze

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

Auto-include all namespaces in the receiver



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/opensearch/api.rb', line 72

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

.serializerObject

The serializer class



91
92
93
# File 'lib/opensearch/api.rb', line 91

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

.settingsObject

Access the module settings



97
98
99
# File 'lib/opensearch/api.rb', line 97

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