{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/elastic/json-schema/elastic-cluster-health-health-response-body-schema.json",
  "title": "cluster.health.HealthResponseBody",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/elastic-cluster-api-openapi.yml#/components/schemas/cluster.health.HealthResponseBody",
  "type": "object",
  "properties": {
    "active_primary_shards": {
      "description": "The number of active primary shards.",
      "type": "number"
    },
    "active_shards": {
      "description": "The total number of active primary and replica shards.",
      "type": "number"
    },
    "active_shards_percent": {
      "description": "The ratio of active shards in the cluster expressed as a string formatted percentage.",
      "type": "string"
    },
    "active_shards_percent_as_number": {
      "description": "The ratio of active shards in the cluster expressed as a percentage.",
      "type": "number"
    },
    "cluster_name": {
      "description": "The name of the cluster.",
      "allOf": [
        {
          "$ref": "#/$defs/_types.Name"
        }
      ]
    },
    "delayed_unassigned_shards": {
      "description": "The number of shards whose allocation has been delayed by the timeout settings.",
      "type": "number"
    },
    "indices": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/cluster.health.IndexHealthStats"
      }
    },
    "initializing_shards": {
      "description": "The number of shards that are under initialization.",
      "type": "number"
    },
    "number_of_data_nodes": {
      "description": "The number of nodes that are dedicated data nodes.",
      "type": "number"
    },
    "number_of_in_flight_fetch": {
      "description": "The number of unfinished fetches.",
      "type": "number"
    },
    "number_of_nodes": {
      "description": "The number of nodes within the cluster.",
      "type": "number"
    },
    "number_of_pending_tasks": {
      "description": "The number of cluster-level changes that have not yet been executed.",
      "type": "number"
    },
    "relocating_shards": {
      "description": "The number of shards that are under relocation.",
      "type": "number"
    },
    "status": {
      "description": "\n\nSupported values include:\n  - `green` (or `GREEN`): All shards are assigned.\n  - `yellow` (or `YELLOW`): All primary shards are assigned, but one or more replica shards are unassigned. If a node in the cluster fails, some data could be unavailable until that node is repaired.\n  - `red` (or `RED`): One or more primary shards are unassigned, so some data is unavailable. This can occur briefly during cluster startup as primary shards are assigned.\n  - `unknown`\n  - `unavailable`\n\n",
      "allOf": [
        {
          "$ref": "#/$defs/_types.HealthStatus"
        }
      ]
    },
    "task_max_waiting_in_queue": {
      "description": "The time since the earliest initiated task is waiting for being performed.",
      "allOf": [
        {
          "$ref": "#/$defs/_types.Duration"
        }
      ]
    },
    "task_max_waiting_in_queue_millis": {
      "description": "The time expressed in milliseconds since the earliest initiated task is waiting for being performed.",
      "allOf": [
        {
          "$ref": "#/$defs/_types.DurationValueUnitMillis"
        }
      ]
    },
    "timed_out": {
      "description": "If false the response returned within the period of time that is specified by the timeout parameter (30s by default)",
      "type": "boolean"
    },
    "unassigned_primary_shards": {
      "description": "The number of primary shards that are not allocated.",
      "type": "number"
    },
    "unassigned_shards": {
      "description": "The number of shards that are not allocated.",
      "type": "number"
    }
  },
  "required": [
    "active_primary_shards",
    "active_shards",
    "active_shards_percent_as_number",
    "cluster_name",
    "delayed_unassigned_shards",
    "initializing_shards",
    "number_of_data_nodes",
    "number_of_in_flight_fetch",
    "number_of_nodes",
    "number_of_pending_tasks",
    "relocating_shards",
    "status",
    "task_max_waiting_in_queue_millis",
    "timed_out",
    "unassigned_primary_shards",
    "unassigned_shards"
  ],
  "$defs": {
    "_types.Duration": {
      "description": "A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and\n`d` (days). Also accepts \"0\" without a unit and \"-1\" to indicate an unspecified value.",
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "string",
          "enum": [
            "-1"
          ]
        },
        {
          "type": "string",
          "enum": [
            "0"
          ]
        }
      ]
    },
    "_types.DurationValueUnitMillis": {
      "allOf": [
        {
          "$ref": "#/$defs/_types.UnitMillis"
        }
      ]
    },
    "_types.HealthStatus": {
      "type": "string",
      "enum": [
        "green",
        "GREEN",
        "yellow",
        "YELLOW",
        "red",
        "RED",
        "unknown",
        "unavailable"
      ]
    },
    "_types.Name": {
      "type": "string"
    },
    "_types.UnitMillis": {
      "description": "Time unit for milliseconds",
      "type": "number"
    },
    "cluster.health.IndexHealthStats": {
      "type": "object",
      "properties": {
        "active_primary_shards": {
          "type": "number"
        },
        "active_shards": {
          "type": "number"
        },
        "initializing_shards": {
          "type": "number"
        },
        "number_of_replicas": {
          "type": "number"
        },
        "number_of_shards": {
          "type": "number"
        },
        "relocating_shards": {
          "type": "number"
        },
        "shards": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/cluster.health.ShardHealthStats"
          }
        },
        "status": {
          "description": "\n\nSupported values include:\n  - `green` (or `GREEN`): All shards are assigned.\n  - `yellow` (or `YELLOW`): All primary shards are assigned, but one or more replica shards are unassigned. If a node in the cluster fails, some data could be unavailable until that node is repaired.\n  - `red` (or `RED`): One or more primary shards are unassigned, so some data is unavailable. This can occur briefly during cluster startup as primary shards are assigned.\n  - `unknown`\n  - `unavailable`\n\n",
          "allOf": [
            {
              "$ref": "#/$defs/_types.HealthStatus"
            }
          ]
        },
        "unassigned_shards": {
          "type": "number"
        },
        "unassigned_primary_shards": {
          "type": "number"
        }
      },
      "required": [
        "active_primary_shards",
        "active_shards",
        "initializing_shards",
        "number_of_replicas",
        "number_of_shards",
        "relocating_shards",
        "status",
        "unassigned_shards",
        "unassigned_primary_shards"
      ]
    },
    "cluster.health.ShardHealthStats": {
      "type": "object",
      "properties": {
        "active_shards": {
          "type": "number"
        },
        "initializing_shards": {
          "type": "number"
        },
        "primary_active": {
          "type": "boolean"
        },
        "relocating_shards": {
          "type": "number"
        },
        "status": {
          "description": "\n\nSupported values include:\n  - `green` (or `GREEN`): All shards are assigned.\n  - `yellow` (or `YELLOW`): All primary shards are assigned, but one or more replica shards are unassigned. If a node in the cluster fails, some data could be unavailable until that node is repaired.\n  - `red` (or `RED`): One or more primary shards are unassigned, so some data is unavailable. This can occur briefly during cluster startup as primary shards are assigned.\n  - `unknown`\n  - `unavailable`\n\n",
          "allOf": [
            {
              "$ref": "#/$defs/_types.HealthStatus"
            }
          ]
        },
        "unassigned_shards": {
          "type": "number"
        },
        "unassigned_primary_shards": {
          "type": "number"
        }
      },
      "required": [
        "active_shards",
        "initializing_shards",
        "primary_active",
        "relocating_shards",
        "status",
        "unassigned_shards",
        "unassigned_primary_shards"
      ]
    }
  }
}