{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/Database",
  "title": "Database",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "description": "The unique ID of this database."
    },
    "label": {
      "type": "string",
      "description": "The label of this database."
    },
    "engine": {
      "type": "string",
      "description": "The database engine and version."
    },
    "type": {
      "type": "string",
      "description": "The Linode type for database nodes."
    },
    "region": {
      "type": "string",
      "description": "The region where this database is located."
    },
    "status": {
      "type": "string",
      "enum": [
        "provisioning",
        "active",
        "suspending",
        "suspended",
        "resuming",
        "restoring",
        "failed",
        "degraded",
        "updating",
        "backing_up"
      ],
      "description": "The current status of this database."
    },
    "cluster_size": {
      "type": "integer",
      "enum": [
        1,
        3
      ],
      "description": "The number of nodes in the database cluster."
    },
    "hosts": {
      "type": "object",
      "properties": {
        "primary": {
          "type": "string",
          "description": "The primary host for this database."
        },
        "secondary": {
          "type": "string",
          "description": "The secondary host for this database."
        }
      },
      "description": "The connection endpoints for this database."
    },
    "port": {
      "type": "integer",
      "description": "The port for database connections."
    },
    "ssl_connection": {
      "type": "boolean",
      "description": "Whether SSL is required for connections."
    },
    "allow_list": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "IP addresses or CIDRs allowed to connect."
    },
    "created": {
      "type": "string",
      "format": "date-time",
      "description": "When this database was created."
    },
    "updated": {
      "type": "string",
      "format": "date-time",
      "description": "When this database was last updated."
    }
  }
}