Method: Elasticsearch::API::CrossClusterReplication::Actions#put_auto_follow_pattern

Defined in:
lib/elasticsearch/api/actions/cross_cluster_replication/put_auto_follow_pattern.rb

#put_auto_follow_pattern(arguments = {}) ⇒ Object

Creates a new named collection of auto-follow patterns against a specified remote cluster. Newly created indices on the remote cluster matching any of the specified patterns will be automatically configured as follower indices.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :name (String)

    The name of the auto follow pattern.

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The specification of the auto follow pattern (Required)

Raises:

  • (ArgumentError)

See Also:



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/elasticsearch/api/actions/cross_cluster_replication/put_auto_follow_pattern.rb', line 33

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

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = arguments.delete(:body)

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_ccr/auto_follow/#{Utils.__listify(_name)}"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers)
  )
end