Method: OpenSearch::API::Snapshot::Actions#get_repository

Defined in:
lib/opensearch/api/actions/snapshot/get_repository.rb

#get_repository(arguments = {}) ⇒ Object

Returns information about a repository.

Options Hash (arguments):

  • :repository (List)

    A comma-separated list of repository names

  • :master_timeout (Time)

    Explicit operation timeout for connection to master node

  • :local (Boolean)

    Return local information, do not retrieve the state from master node (default: false)

  • :headers (Hash)

    Custom HTTP headers



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/opensearch/api/actions/snapshot/get_repository.rb', line 39

def get_repository(arguments = {})
  headers = arguments.delete(:headers) || {}

  arguments = arguments.clone

  _repository = arguments.delete(:repository)

  method = OpenSearch::API::HTTP_GET
  path   = if _repository
             "_snapshot/#{Utils.__listify(_repository)}"
           else
             "_snapshot"
           end
  params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

  body = nil
  if Array(arguments[:ignore]).include?(404)
    Utils.__rescue_from_not_found { perform_request(method, path, params, body, headers).body }
  else
    perform_request(method, path, params, body, headers).body
  end
end