Method: OpenSearch::API::Cat::Actions#snapshots

Defined in:
lib/opensearch/api/actions/cat/snapshots.rb

#snapshots(arguments = {}) ⇒ Object

Returns all snapshots in a specific repository.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :repository (List)

    Name of repository from which to fetch the snapshot information

  • :format (String)

    a short version of the Accept header, e.g. json, yaml

  • :ignore_unavailable (Boolean)

    Set to true to ignore unavailable snapshots

  • :master_timeout (Time)

    Explicit operation timeout for connection to master node

  • :h (List)

    Comma-separated list of column names to display

  • :help (Boolean)

    Return help information

  • :s (List)

    Comma-separated list of column names or column aliases to sort by

  • :time (String)

    The unit in which to display time values (options: d, h, m, s, ms, micros, nanos)

  • :v (Boolean)

    Verbose mode. Display column headers

  • :headers (Hash)

    Custom HTTP headers



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/opensearch/api/actions/cat/snapshots.rb', line 45

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

  arguments = arguments.clone

  _repository = arguments.delete(:repository)

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

  body = nil
  perform_request(method, path, params, body, headers).body
end