Module: OpenSearch::API

Included in:
Client
Defined in:
lib/opensearch/api.rb,
lib/opensearch/api/utils.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/namespace/http.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/actions/http/get.rb,
lib/opensearch/api/actions/http/put.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/http/head.rb,
lib/opensearch/api/actions/http/post.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/http/patch.rb,
lib/opensearch/api/actions/http/trace.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/http/delete.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/http/connect.rb,
lib/opensearch/api/actions/http/options.rb,
lib/opensearch/api/actions/http/request.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/namespace/remote_store.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/security/health.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/security/get_role.rb,
lib/opensearch/api/actions/security/get_user.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/actions/security/get_roles.rb,
lib/opensearch/api/actions/security/get_users.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/security/get_tenant.rb,
lib/opensearch/api/actions/security/patch_role.rb,
lib/opensearch/api/actions/security/patch_user.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/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/remote_store/restore.rb,
lib/opensearch/api/actions/security/create_role.rb,
lib/opensearch/api/actions/security/create_user.rb,
lib/opensearch/api/actions/security/delete_role.rb,
lib/opensearch/api/actions/security/delete_user.rb,
lib/opensearch/api/actions/security/flush_cache.rb,
lib/opensearch/api/actions/security/get_tenants.rb,
lib/opensearch/api/actions/security/patch_roles.rb,
lib/opensearch/api/actions/security/patch_users.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/security/patch_tenant.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/security/create_tenant.rb,
lib/opensearch/api/actions/security/delete_tenant.rb,
lib/opensearch/api/actions/security/patch_tenants.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/security/change_password.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/security/get_action_group.rb,
lib/opensearch/api/actions/security/get_certificates.rb,
lib/opensearch/api/actions/security/get_role_mapping.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/security/get_action_groups.rb,
lib/opensearch/api/actions/security/get_configuration.rb,
lib/opensearch/api/actions/security/get_role_mappings.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/security/patch_action_group.rb,
lib/opensearch/api/actions/security/patch_role_mapping.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/security/create_action_group.rb,
lib/opensearch/api/actions/security/create_role_mapping.rb,
lib/opensearch/api/actions/security/delete_action_group.rb,
lib/opensearch/api/actions/security/delete_role_mapping.rb,
lib/opensearch/api/actions/security/get_account_details.rb,
lib/opensearch/api/actions/security/patch_action_groups.rb,
lib/opensearch/api/actions/security/patch_configuration.rb,
lib/opensearch/api/actions/security/patch_role_mappings.rb,
lib/opensearch/api/actions/indices/delete_index_template.rb,
lib/opensearch/api/actions/indices/exists_index_template.rb,
lib/opensearch/api/actions/security/update_configuration.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/security/get_audit_configuration.rb,
lib/opensearch/api/actions/security/get_distinguished_names.rb,
lib/opensearch/api/actions/cluster/delete_component_template.rb,
lib/opensearch/api/actions/cluster/exists_component_template.rb,
lib/opensearch/api/actions/security/reload_http_certificates.rb,
lib/opensearch/api/actions/security/patch_audit_configuration.rb,
lib/opensearch/api/actions/security/patch_distinguished_names.rb,
lib/opensearch/api/actions/security/delete_distinguished_names.rb,
lib/opensearch/api/actions/security/update_audit_configuration.rb,
lib/opensearch/api/actions/security/update_distinguished_names.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/security/reload_transport_certificates.rb,
lib/opensearch/api/actions/cluster/delete_voting_config_exclusions.rb

Defined Under Namespace

Modules: Actions, Cat, Cluster, Common, DanglingIndices, Features, Http, Indices, Ingest, Nodes, Remote, RemoteStore, 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'
HTTP_HEAD =
'HEAD'
HTTP_PATCH =
'PATCH'
HTTP_POST =
'POST'
HTTP_PUT =
'PUT'
HTTP_DELETE =
'DELETE'
UNDERSCORE_SEARCH =
'_search'
UNDERSCORE_ALL =
'_all'
DEFAULT_DOC =
'_doc'

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

Auto-include all namespaces in the receiver



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/opensearch/api.rb', line 74

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

.serializerObject

The serializer class



95
96
97
# File 'lib/opensearch/api.rb', line 95

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

.settingsObject

Access the module settings



100
101
102
# File 'lib/opensearch/api.rb', line 100

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