Module: OpenSearch::API::RemoteStore::Actions

Included in:
RemoteStoreClient
Defined in:
lib/opensearch/api/namespace/remote_store.rb,
lib/opensearch/api/actions/remote_store/restore.rb

Constant Summary collapse

RESTORE_QUERY_PARAMS =
Set.new(%i[
  cluster_manager_timeout
  wait_for_completion
]).freeze

Instance Method Summary collapse

Instance Method Details

#restore(arguments = {}) ⇒ Object

Restores from remote store.

API Reference

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :cluster_manager_timeout (Time)

    Operation timeout for connection to cluster-manager node.

  • :wait_for_completion (Boolean)

    Should this request wait until the operation has completed before returning.

  • :body (Hash)

    Required Comma-separated list of index IDs

Raises:

  • (ArgumentError)


28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/opensearch/api/actions/remote_store/restore.rb', line 28

def restore(arguments = {})
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}
  body    = arguments.delete(:body)
  url     = Utils.__pathify '_remotestore', '_restore'
  method  = OpenSearch::API::HTTP_POST
  params  = Utils.__validate_and_extract_params arguments, RESTORE_QUERY_PARAMS

  perform_request(method, url, params, body, headers).body
end