{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/elastic/json-schema/elastic-ccr-stats-auto-follow-stats-schema.json",
  "title": "ccr.stats.AutoFollowStats",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/elastic-ccr-api-openapi.yml#/components/schemas/ccr.stats.AutoFollowStats",
  "type": "object",
  "properties": {
    "auto_followed_clusters": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ccr.stats.AutoFollowedCluster"
      }
    },
    "number_of_failed_follow_indices": {
      "description": "The number of indices that the auto-follow coordinator failed to automatically follow.\nThe causes of recent failures are captured in the logs of the elected master node and in the `auto_follow_stats.recent_auto_follow_errors` field.",
      "type": "number"
    },
    "number_of_failed_remote_cluster_state_requests": {
      "description": "The number of times that the auto-follow coordinator failed to retrieve the cluster state from a remote cluster registered in a collection of auto-follow patterns.",
      "type": "number"
    },
    "number_of_successful_follow_indices": {
      "description": "The number of indices that the auto-follow coordinator successfully followed.",
      "type": "number"
    },
    "recent_auto_follow_errors": {
      "description": "An array of objects representing failures by the auto-follow coordinator.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/_types.ErrorCause"
      }
    }
  },
  "required": [
    "auto_followed_clusters",
    "number_of_failed_follow_indices",
    "number_of_failed_remote_cluster_state_requests",
    "number_of_successful_follow_indices",
    "recent_auto_follow_errors"
  ],
  "$defs": {
    "_types.DurationValueUnitMillis": {
      "allOf": [
        {
          "$ref": "#/$defs/_types.UnitMillis"
        }
      ]
    },
    "_types.ErrorCause": {
      "description": "Cause and details about a request failure. This class defines the properties common to all error types.\nAdditional details are also provided, that depend on the error type.",
      "type": "object",
      "properties": {
        "type": {
          "description": "The type of error",
          "type": "string"
        },
        "reason": {
          "description": "A human-readable explanation of the error, in English.",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": [
                "string",
                "null"
              ]
            }
          ]
        },
        "stack_trace": {
          "description": "The server stack trace. Present only if the `error_trace=true` parameter was sent with the request.",
          "type": "string"
        },
        "caused_by": {
          "allOf": [
            {
              "$ref": "#/$defs/_types.ErrorCause"
            }
          ]
        },
        "root_cause": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/_types.ErrorCause"
          }
        },
        "suppressed": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/_types.ErrorCause"
          }
        }
      },
      "required": [
        "type"
      ]
    },
    "_types.Name": {
      "type": "string"
    },
    "_types.UnitMillis": {
      "description": "Time unit for milliseconds",
      "type": "number"
    },
    "_types.VersionNumber": {
      "type": "number"
    },
    "ccr.stats.AutoFollowedCluster": {
      "type": "object",
      "properties": {
        "cluster_name": {
          "allOf": [
            {
              "$ref": "#/$defs/_types.Name"
            }
          ]
        },
        "last_seen_metadata_version": {
          "allOf": [
            {
              "$ref": "#/$defs/_types.VersionNumber"
            }
          ]
        },
        "time_since_last_check_millis": {
          "allOf": [
            {
              "$ref": "#/$defs/_types.DurationValueUnitMillis"
            }
          ]
        }
      },
      "required": [
        "cluster_name",
        "last_seen_metadata_version",
        "time_since_last_check_millis"
      ]
    }
  }
}