Spec-Zone.ru › Elasticsearch 8
›Elasticsearch Guide [8.17] ›REST APIs ›Cross-cluster replication APIs

Get auto-follow pattern API

New API reference

For the most up-to-date API details, refer to Cross-cluster replication APIs.

Get cross-cluster replication auto-follow patterns.

Request

resp = client.ccr.get_auto_follow_pattern()
print(resp)
response = client.ccr.get_auto_follow_pattern
puts response
const response = await client.ccr.getAutoFollowPattern();
console.log(response);
GET /_ccr/auto_follow/
resp = client.ccr.get_auto_follow_pattern(
    name="<auto_follow_pattern_name>",
)
print(resp)
const response = await client.ccr.getAutoFollowPattern({
  name: "<auto_follow_pattern_name>",
});
console.log(response);
GET /_ccr/auto_follow/<auto_follow_pattern_name>

Prerequisites

  • If the Elasticsearch security features are enabled, you must have manage_ccr cluster privileges on the cluster that contains the follower index. For more information, see Security privileges.

Description

This API gets configured auto-follow patterns. This API will return the specified auto-follow pattern collection.

Path parameters

<auto_follow_pattern_name>
(Optional, string) Specifies the auto-follow pattern collection that you want to retrieve. If you do not specify a name, the API returns information for all collections.

Query parameters

master_timeout
(Optional, time units) Period to wait for the master node. If the master node is not available before the timeout expires, the request fails and returns an error. Defaults to 30s. Can also be set to -1 to indicate that the request should never timeout.

Examples

This example retrieves information about an auto-follow pattern collection named my_auto_follow_pattern:

resp = client.ccr.get_auto_follow_pattern(
    name="my_auto_follow_pattern",
)
print(resp)
response = client.ccr.get_auto_follow_pattern(
  name: 'my_auto_follow_pattern'
)
puts response
const response = await client.ccr.getAutoFollowPattern({
  name: "my_auto_follow_pattern",
});
console.log(response);
GET /_ccr/auto_follow/my_auto_follow_pattern

The API returns the following result:

{
  "patterns": [
    {
      "name": "my_auto_follow_pattern",
      "pattern": {
        "active": true,
        "remote_cluster" : "remote_cluster",
        "leader_index_patterns" :
        [
          "leader_index*"
        ],
        "leader_index_exclusion_patterns":
        [
          "leader_index_001"
        ],
        "follow_index_pattern" : "{{leader_index}}-follower"
      }
    }
  ]
}

© 2023-2025 Elasticsearch
As of September 2024, Elasticsearch is available under a choice of three licenses: the Server Side Public License (SSPL), the Elastic License, or the AGPLv3 (OSI approved).
Elasticsearch and the Elasticsearch logo are trademarks of Elasticsearch B.V., registered in the U.S. and in other countries.
https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ccr-get-auto-follow-pattern.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API