{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/cockroach-labs/main/json-schema/cockroach-labs-list-node-ranges-response-schema.json",
  "title": "ListNodeRangesResponse",
  "description": "Range information for a specific node with pagination metadata.",
  "x-generated": "2026-10-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cockroach-labs-ranges-api-openapi.yml#/components/schemas/ListNodeRangesResponse",
  "type": "object",
  "properties": {
    "ranges": {
      "type": "array",
      "description": "Array of range information objects for the node.",
      "items": {
        "$ref": "#/$defs/RangeInfo"
      }
    },
    "next": {
      "type": "integer",
      "description": "Offset for retrieving the next page of results."
    }
  },
  "$defs": {
    "RangeDescriptor": {
      "type": "object",
      "description": "Describes a range's identity, key bounds, and replica set.",
      "properties": {
        "range_id": {
          "type": "integer",
          "format": "int64",
          "description": "Unique identifier of the range."
        },
        "start_key": {
          "type": "string",
          "description": "Base64-encoded start key of the range."
        },
        "end_key": {
          "type": "string",
          "description": "Base64-encoded end key of the range."
        },
        "internal_replicas": {
          "type": "array",
          "description": "List of replicas for this range.",
          "items": {
            "type": "object",
            "properties": {
              "node_id": {
                "type": "integer",
                "description": "Node hosting this replica."
              },
              "store_id": {
                "type": "integer",
                "description": "Store on the node hosting this replica."
              },
              "replica_id": {
                "type": "integer",
                "description": "Unique identifier of this replica within the range."
              }
            }
          }
        }
      }
    },
    "RangeInfo": {
      "type": "object",
      "description": "Information about a single range, including span, replica placement, lease holder, and per-replica statistics.",
      "properties": {
        "desc": {
          "$ref": "#/$defs/RangeDescriptor"
        },
        "span": {
          "type": "object",
          "description": "Key span covered by this range."
        },
        "source_node_id": {
          "type": "integer",
          "description": "Node ID that provided this range information."
        },
        "source_store_id": {
          "type": "integer",
          "description": "Store ID on the source node that holds this range."
        },
        "error_message": {
          "type": "string",
          "description": "Error message if range information could not be retrieved."
        },
        "lease_holder": {
          "type": "integer",
          "description": "Store ID of the current leaseholder replica."
        },
        "raft_state": {
          "type": "string",
          "description": "Raft consensus state of this range (e.g. Leader, Follower)."
        },
        "stats": {
          "type": "object",
          "description": "Aggregate statistics for the range including key/value counts."
        }
      }
    }
  }
}