Method: OpenSearch::API::Indices::Actions#get_template

Defined in:
lib/opensearch/api/actions/indices/get_template.rb

#get_template(arguments = {}) ⇒ Object

Returns an index template.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :name (List)

    The comma separated names of the index templates

  • :flat_settings (Boolean)

    Return settings in flat format (default: false)

  • :master_timeout (Time) — default: DEPRECATED: use cluster_manager_timeout instead

    Explicit operation timeout for connection to master node

  • :cluster_manager_timeout (Time)

    Explicit operation timeout for connection to cluster_manager node

  • :local (Boolean)

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

  • :headers (Hash)

    Custom HTTP headers



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/opensearch/api/actions/indices/get_template.rb', line 41

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

  arguments = arguments.clone

  _name = arguments.delete(:name)

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

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