{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/wavehouse-cloud/json-schema/wavehouse-cloud-external-click-house-config-view-schema.json",
  "title": "ExternalClickHouseConfigView",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/wavehouse-cloud-openapi.json#/components/schemas/ExternalClickHouseConfigView",
  "additionalProperties": false,
  "properties": {
    "addr": {
      "description": "host:port of the native protocol; switch-clickhouse changes it",
      "minLength": 1,
      "type": "string"
    },
    "database": {
      "description": "the database the engine reads and writes; it must already exist; switch-clickhouse changes it",
      "minLength": 1,
      "type": "string"
    },
    "header_names": {
      "description": "the names of the headers set, sorted; their values are never returned",
      "items": {
        "type": "string"
      },
      "readOnly": true,
      "type": "array"
    },
    "headers": {
      "additionalProperties": {
        "type": "string"
      },
      "description": "HTTP headers sent with every request to it, such as a proxy's credential; Authorization and X-ClickHouse-User/Key are refused, since username and password are the credential. Write-only, every value: omitted leaves them unchanged, {} clears them, and any other set replaces them",
      "type": "object",
      "writeOnly": true
    },
    "headers_set_at": {
      "format": "date-time",
      "readOnly": true,
      "type": "string"
    },
    "http_port": {
      "description": "the HTTP interface's port",
      "format": "int64",
      "maximum": 65535,
      "minimum": 1,
      "type": "integer"
    },
    "http_scheme": {
      "description": "the HTTP interface's scheme",
      "enum": [
        "http",
        "https"
      ],
      "type": "string"
    },
    "managed_data_deleted_after": {
      "description": "while the WaveHouse-managed database this project left is still kept: when it is deleted; switching back before then serves it again",
      "format": "date-time",
      "readOnly": true,
      "type": "string"
    },
    "max_idle_conns": {
      "description": "the most idle connections it keeps; at most max_open_conns",
      "format": "int64",
      "type": "integer"
    },
    "max_open_conns": {
      "description": "the most connections the engine holds open to ClickHouse",
      "format": "int64",
      "type": "integer"
    },
    "mode": {
      "description": "external: the project reads and writes a ClickHouse you run",
      "enum": [
        "external"
      ],
      "type": "string"
    },
    "password": {
      "description": "write-only; omitted leaves it unchanged",
      "type": "string",
      "writeOnly": true
    },
    "password_set": {
      "readOnly": true,
      "type": "boolean"
    },
    "password_set_at": {
      "format": "date-time",
      "readOnly": true,
      "type": "string"
    },
    "query_timeout": {
      "description": "seconds a query may run",
      "format": "int64",
      "type": "integer"
    },
    "revision": {
      "description": "the settings revision this resource last changed in",
      "format": "int64",
      "readOnly": true,
      "type": "integer"
    },
    "tls": {
      "$ref": "#/$defs/ClickHouseTLSView"
    },
    "username": {
      "description": "a user that holds the required grants on that database",
      "minLength": 1,
      "type": "string"
    }
  },
  "required": [
    "mode",
    "addr",
    "http_port",
    "http_scheme",
    "database",
    "username",
    "tls",
    "query_timeout",
    "max_open_conns",
    "max_idle_conns",
    "revision"
  ],
  "type": "object",
  "$defs": {
    "ClickHouseTLSView": {
      "additionalProperties": false,
      "properties": {
        "ca_pem": {
          "description": "not supported yet: the system CA store verifies the server",
          "type": "string"
        },
        "cert_pem": {
          "description": "not supported yet",
          "type": "string"
        },
        "enabled": {
          "description": "speak TLS on the native protocol",
          "type": "boolean"
        },
        "insecure_skip_verify": {
          "description": "skip verifying the server's certificate",
          "type": "boolean"
        },
        "key_pem": {
          "description": "not supported yet; write-only",
          "type": "string",
          "writeOnly": true
        },
        "key_pem_set": {
          "readOnly": true,
          "type": "boolean"
        },
        "key_pem_set_at": {
          "format": "date-time",
          "readOnly": true,
          "type": "string"
        },
        "server_name": {
          "description": "the name the server's certificate is verified against; empty is addr's host",
          "type": "string"
        }
      },
      "required": [
        "enabled"
      ],
      "type": "object"
    }
  }
}