Module: Elasticsearch::XPack::API::CrossClusterReplication::Actions

Included in:
CrossClusterReplicationClient
Defined in:
lib/elasticsearch/xpack/api/namespace/cross_cluster_replication.rb,
lib/elasticsearch/xpack/api/actions/cross_cluster_replication/stats.rb,
lib/elasticsearch/xpack/api/actions/cross_cluster_replication/follow.rb,
lib/elasticsearch/xpack/api/actions/cross_cluster_replication/unfollow.rb,
lib/elasticsearch/xpack/api/actions/cross_cluster_replication/follow_info.rb,
lib/elasticsearch/xpack/api/actions/cross_cluster_replication/follow_stats.rb,
lib/elasticsearch/xpack/api/actions/cross_cluster_replication/pause_follow.rb,
lib/elasticsearch/xpack/api/actions/cross_cluster_replication/resume_follow.rb,
lib/elasticsearch/xpack/api/actions/cross_cluster_replication/forget_follower.rb,
lib/elasticsearch/xpack/api/actions/cross_cluster_replication/params_registry.rb,
lib/elasticsearch/xpack/api/actions/cross_cluster_replication/get_auto_follow_pattern.rb,
lib/elasticsearch/xpack/api/actions/cross_cluster_replication/put_auto_follow_pattern.rb,
lib/elasticsearch/xpack/api/actions/cross_cluster_replication/pause_auto_follow_pattern.rb,
lib/elasticsearch/xpack/api/actions/cross_cluster_replication/delete_auto_follow_pattern.rb,
lib/elasticsearch/xpack/api/actions/cross_cluster_replication/resume_auto_follow_pattern.rb

Defined Under Namespace

Modules: ParamsRegistry

Instance Method Summary collapse

Instance Method Details

#delete_auto_follow_pattern(arguments = {}) ⇒ Object

Deletes auto-follow patterns.

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

Raises:

  • (ArgumentError)

See Also:



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/elasticsearch/xpack/api/actions/cross_cluster_replication/delete_auto_follow_pattern.rb', line 30

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

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

  arguments = arguments.clone

  _name = arguments.delete(:name)

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

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

#follow(arguments = {}) ⇒ Object

Creates a new follower index configured to follow the referenced leader index.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :index (String)

    The name of the follower index

  • :wait_for_active_shards (String)

    Sets the number of shard copies that must be active before returning. Defaults to 0. Set to ‘all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The name of the leader index and other optional ccr related parameters (Required)

Raises:

  • (ArgumentError)

See Also:



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

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

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

  arguments = arguments.clone

  _index = arguments.delete(:index)

  method = Elasticsearch::API::HTTP_PUT
  path   = "#{Elasticsearch::API::Utils.__listify(_index)}/_ccr/follow"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

  body = arguments[:body]
  perform_request(method, path, params, body, headers).body
end

#follow_info(arguments = {}) ⇒ Object

Retrieves information about all follower indices, including parameters and status for each follower index

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :index (List)

    A comma-separated list of index patterns; use ‘_all` to perform the operation on all indices

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/elasticsearch/xpack/api/actions/cross_cluster_replication/follow_info.rb', line 30

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

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

  arguments = arguments.clone

  _index = arguments.delete(:index)

  method = Elasticsearch::API::HTTP_GET
  path   = "#{Elasticsearch::API::Utils.__listify(_index)}/_ccr/info"
  params = {}

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

#follow_stats(arguments = {}) ⇒ Object

Retrieves follower stats. return shard-level stats about the following tasks associated with each shard for the specified indices.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :index (List)

    A comma-separated list of index patterns; use ‘_all` to perform the operation on all indices

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/elasticsearch/xpack/api/actions/cross_cluster_replication/follow_stats.rb', line 30

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

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

  arguments = arguments.clone

  _index = arguments.delete(:index)

  method = Elasticsearch::API::HTTP_GET
  path   = "#{Elasticsearch::API::Utils.__listify(_index)}/_ccr/stats"
  params = {}

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

#forget_follower(arguments = {}) ⇒ Object

Removes the follower retention leases from the leader.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :index (String)

    the name of the leader index for which specified follower retention leases should be removed

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    the name and UUID of the follower index, the name of the cluster containing the follower index, and the alias from the perspective of that cluster for the remote cluster containing the leader index (Required)

Raises:

  • (ArgumentError)

See Also:



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/elasticsearch/xpack/api/actions/cross_cluster_replication/forget_follower.rb', line 31

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

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

  arguments = arguments.clone

  _index = arguments.delete(:index)

  method = Elasticsearch::API::HTTP_POST
  path   = "#{Elasticsearch::API::Utils.__listify(_index)}/_ccr/forget_follower"
  params = {}

  body = arguments[:body]
  perform_request(method, path, params, body, headers).body
end

#get_auto_follow_pattern(arguments = {}) ⇒ Object

Gets configured auto-follow patterns. Returns the specified auto-follow pattern collection.

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

See Also:



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/elasticsearch/xpack/api/actions/cross_cluster_replication/get_auto_follow_pattern.rb', line 30

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

  arguments = arguments.clone

  _name = arguments.delete(:name)

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

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

#pause_auto_follow_pattern(arguments = {}) ⇒ Object

Pauses an auto-follow pattern

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :name (String)

    The name of the auto follow pattern that should pause discovering new indices to follow.

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/elasticsearch/xpack/api/actions/cross_cluster_replication/pause_auto_follow_pattern.rb', line 30

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

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

  arguments = arguments.clone

  _name = arguments.delete(:name)

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

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

#pause_follow(arguments = {}) ⇒ Object

Pauses a follower index. The follower index will not fetch any additional operations from the leader index.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :index (String)

    The name of the follower index that should pause following its leader index.

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/elasticsearch/xpack/api/actions/cross_cluster_replication/pause_follow.rb', line 30

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

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

  arguments = arguments.clone

  _index = arguments.delete(:index)

  method = Elasticsearch::API::HTTP_POST
  path   = "#{Elasticsearch::API::Utils.__listify(_index)}/_ccr/pause_follow"
  params = {}

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

#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:



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

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

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

  arguments = arguments.clone

  _name = arguments.delete(:name)

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

  body = arguments[:body]
  perform_request(method, path, params, body, headers).body
end

#resume_auto_follow_pattern(arguments = {}) ⇒ Object

Resumes an auto-follow pattern that has been paused

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :name (String)

    The name of the auto follow pattern to resume discovering new indices to follow.

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/elasticsearch/xpack/api/actions/cross_cluster_replication/resume_auto_follow_pattern.rb', line 30

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

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

  arguments = arguments.clone

  _name = arguments.delete(:name)

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

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

#resume_follow(arguments = {}) ⇒ Object

Resumes a follower index that has been paused

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :index (String)

    The name of the follow index to resume following.

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The name of the leader index and other optional ccr related parameters

Raises:

  • (ArgumentError)

See Also:



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/elasticsearch/xpack/api/actions/cross_cluster_replication/resume_follow.rb', line 31

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

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

  arguments = arguments.clone

  _index = arguments.delete(:index)

  method = Elasticsearch::API::HTTP_POST
  path   = "#{Elasticsearch::API::Utils.__listify(_index)}/_ccr/resume_follow"
  params = {}

  body = arguments[:body]
  perform_request(method, path, params, body, headers).body
end

#stats(arguments = {}) ⇒ Object

Gets all stats related to cross-cluster replication.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :headers (Hash)

    Custom HTTP headers

See Also:



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/elasticsearch/xpack/api/actions/cross_cluster_replication/stats.rb', line 29

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

  arguments = arguments.clone

  method = Elasticsearch::API::HTTP_GET
  path   = "_ccr/stats"
  params = {}

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

#unfollow(arguments = {}) ⇒ Object

Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :index (String)

    The name of the follower index that should be turned into a regular index.

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/elasticsearch/xpack/api/actions/cross_cluster_replication/unfollow.rb', line 30

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

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

  arguments = arguments.clone

  _index = arguments.delete(:index)

  method = Elasticsearch::API::HTTP_POST
  path   = "#{Elasticsearch::API::Utils.__listify(_index)}/_ccr/unfollow"
  params = {}

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