{
  "swagger": "2.0",
  "info": {
    "title": "Serverless Changefeed APIs for TiDB Cloud",
    "version": "alpha"
  },
  "tags": [
    {
      "name": "ChangefeedService"
    }
  ],
  "schemes": [
    "https"
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/api/v1/serverless/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/changefeeds": {
      "get": {
        "operationId": "ChangefeedService_ListChangefeeds",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/Changefeeds"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Status"
            }
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "description": "The organize ID",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "project_id",
            "description": "The project ID",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "cluster_id",
            "description": "The ID of the cluster.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "page_size",
            "description": "The maximum number of changefeeds to return. Default is 10.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "page_token",
            "description": "The page token from the previous response for pagination.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "changefeed_type",
            "description": "The type of the changefeed. DEFAULT is all.\n\n - KAFKA: Kafka changefeed type.\n - MYSQL: MySQL changefeed type.\n - CLOUD_STORAGE: Cloud storage changefeed type, such as S3, GCS, Azure Blob Storage and OSS.",
            "in": "query",
            "required": false,
            "type": "string",
            "enum": [
              "KAFKA",
              "MYSQL",
              "CLOUD_STORAGE"
            ]
          }
        ],
        "tags": [
          "ChangefeedService"
        ]
      },
      "post": {
        "operationId": "ChangefeedService_CreateChangefeed",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/Changefeed"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Status"
            }
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "description": "The organize ID",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "project_id",
            "description": "The project ID",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "cluster_id",
            "description": "The ID of the cluster.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ChangefeedService.CreateChangefeedBody"
            }
          }
        ],
        "tags": [
          "ChangefeedService"
        ]
      }
    },
    "/api/v1/serverless/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/changefeeds/{changefeed_id}": {
      "get": {
        "operationId": "ChangefeedService_GetChangefeed",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/Changefeed"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Status"
            }
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "description": "The organize ID",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "project_id",
            "description": "The project ID",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "cluster_id",
            "description": "The ID of the cluster.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "changefeed_id",
            "description": "The ID of the changefeed.",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "ChangefeedService"
        ]
      },
      "delete": {
        "operationId": "ChangefeedService_DeleteChangefeed",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/Changefeed"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Status"
            }
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "description": "The organize ID",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "project_id",
            "description": "The project ID",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "cluster_id",
            "description": "The ID of the cluster.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "changefeed_id",
            "description": "The ID of the changefeed.",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "ChangefeedService"
        ]
      },
      "patch": {
        "operationId": "ChangefeedService_EditChangefeed",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/Changefeed"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Status"
            }
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "description": "The organize ID",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "project_id",
            "description": "The project ID",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "cluster_id",
            "description": "The ID of the cluster.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "changefeed_id",
            "description": "The ID of the changefeed.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ChangefeedService.EditChangefeedBody"
            }
          }
        ],
        "tags": [
          "ChangefeedService"
        ]
      }
    },
    "/api/v1/serverless/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/changefeeds/{changefeed_id}:scale": {
      "post": {
        "operationId": "ChangefeedService_ScaleChangefeed",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/Changefeed"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Status"
            }
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "description": "The organize ID",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "project_id",
            "description": "The project ID",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "cluster_id",
            "description": "The ID of the cluster.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "changefeed_id",
            "description": "The ID of the changefeed.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ChangefeedService.ScaleChangefeedBody"
            }
          }
        ],
        "tags": [
          "ChangefeedService"
        ]
      }
    },
    "/api/v1/serverless/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/changefeeds/{changefeed_id}:start": {
      "post": {
        "operationId": "ChangefeedService_StartChangefeed",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/Changefeed"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Status"
            }
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "description": "The organize ID",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "project_id",
            "description": "The project ID",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "cluster_id",
            "description": "The ID of the cluster.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "changefeed_id",
            "description": "The ID of the changefeed.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ChangefeedService.StartChangefeedBody"
            }
          }
        ],
        "tags": [
          "ChangefeedService"
        ]
      }
    },
    "/api/v1/serverless/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/changefeeds/{changefeed_id}:stop": {
      "post": {
        "operationId": "ChangefeedService_StopChangefeed",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/Changefeed"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Status"
            }
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "description": "The organize ID",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "project_id",
            "description": "The project ID",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "cluster_id",
            "description": "The ID of the cluster.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "changefeed_id",
            "description": "The ID of the changefeed.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ChangefeedService.StopChangefeedBody"
            }
          }
        ],
        "tags": [
          "ChangefeedService"
        ]
      }
    },
    "/api/v1/serverless/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/changefeeds:describeSchemaTable": {
      "post": {
        "operationId": "ChangefeedService_DescribeSchemaTable",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/DescribeSchemaTableResp"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Status"
            }
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "description": "The organize ID",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "project_id",
            "description": "The project ID",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "cluster_id",
            "description": "The ID of the cluster.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ChangefeedService.DescribeSchemaTableBody"
            }
          }
        ],
        "tags": [
          "ChangefeedService"
        ]
      }
    },
    "/api/v1/serverless/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/changefeeds:listSpecifications": {
      "get": {
        "operationId": "ChangefeedService_ListChangefeedSpecifications",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/ListChangefeedSpecificationsResp"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Status"
            }
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "description": "The organize ID",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "project_id",
            "description": "The project ID",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "cluster_id",
            "description": "The ID of the cluster.",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "ChangefeedService"
        ]
      }
    },
    "/api/v1/serverless/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/changefeeds:test": {
      "post": {
        "operationId": "ChangefeedService_TestChangefeed",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/TestChangefeedResp"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Status"
            }
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "description": "The organize ID",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "project_id",
            "description": "The project ID",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "cluster_id",
            "description": "The ID of the cluster.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ChangefeedService.TestChangefeedBody"
            }
          }
        ],
        "tags": [
          "ChangefeedService"
        ]
      }
    }
  },
  "definitions": {
    "Any": {
      "type": "object",
      "properties": {
        "@type": {
          "type": "string"
        }
      },
      "additionalProperties": {}
    },
    "AvroConfig": {
      "type": "object",
      "properties": {
        "decimal_handling_mode": {
          "$ref": "#/definitions/DecimalHandlingMode.Enum"
        },
        "bigint_unsigned_handling_mode": {
          "$ref": "#/definitions/BigintUnsignedHandlingMode.Enum"
        },
        "confluent_schema_registry": {
          "$ref": "#/definitions/ConfluentSchemaRegistry",
          "description": "Confluent Schema Registry."
        },
        "aws_glue_schema_registry": {
          "$ref": "#/definitions/GlueSchemaRegistry",
          "description": "AWS Glue Schema Registry."
        }
      }
    },
    "AzureBlobCloudStorage": {
      "type": "object",
      "properties": {
        "uri": {
          "type": "string",
          "description": "Required. The Azure Blob URI. For example: azure://<account>.blob.core.windows.net/<container>/<path>/ or https://<account>.blob.core.windows.net/<container>/<path>/."
        },
        "auth_type": {
          "$ref": "#/definitions/AzureBlobCloudStorage.AzureBlobAuthType",
          "description": "Required. The auth method of Azure Blob."
        },
        "sas_token": {
          "type": "string",
          "description": "Optional. The sas token."
        }
      },
      "required": [
        "uri",
        "auth_type"
      ]
    },
    "AzureBlobCloudStorage.AzureBlobAuthType": {
      "type": "string",
      "enum": [
        "SAS_TOKEN"
      ],
      "description": " - SAS_TOKEN: The access method is sas token."
    },
    "BaseResp": {
      "type": "object",
      "properties": {
        "tags": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "title": "such as: request_id, trace_id"
        },
        "err_code": {
          "type": "string",
          "format": "int64"
        },
        "err_msg": {
          "type": "string"
        }
      }
    },
    "BigintUnsignedHandlingMode.Enum": {
      "type": "string",
      "enum": [
        "LONG",
        "STRING"
      ],
      "description": " - LONG: Long handling mode for unsigned bigint.\n - STRING: String handling mode for unsigned bigint."
    },
    "Changefeed": {
      "type": "object",
      "properties": {
        "cluster_id": {
          "type": "string",
          "description": "The ID of the cluster."
        },
        "changefeed_id": {
          "type": "string",
          "description": "The ID of the changefeed.",
          "readOnly": true
        },
        "state": {
          "$ref": "#/definitions/ChangefeedState.Enum",
          "description": "The state of the changefeed.\n\nThe name of the changefeed.",
          "readOnly": true
        },
        "display_name": {
          "type": "string",
          "description": "The name of the changefeed."
        },
        "sink": {
          "$ref": "#/definitions/SinkInfo",
          "description": "The sink of the changefeed."
        },
        "filter": {
          "$ref": "#/definitions/ChangefeedFilter",
          "description": "The filter of the changefeed."
        },
        "start_position": {
          "$ref": "#/definitions/StartPosition",
          "description": "The start position of the changefeed."
        },
        "checkpoint": {
          "$ref": "#/definitions/Checkpoint",
          "description": "The current checkpoint for the changefeed.",
          "readOnly": true
        },
        "error": {
          "type": "string",
          "description": "The error message.",
          "readOnly": true
        },
        "arch": {
          "$ref": "#/definitions/ChangefeedArch.Enum",
          "description": "The architecture used by the changefeed.",
          "readOnly": true
        },
        "rcu": {
          "type": "integer",
          "format": "int64",
          "description": "The requested RCU for the changefeed.",
          "readOnly": true
        },
        "create_time": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when the changefeed was created.",
          "readOnly": true
        },
        "update_time": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when the changefeed was updated.",
          "readOnly": true
        },
        "base_resp": {
          "$ref": "#/definitions/BaseResp"
        }
      },
      "required": [
        "cluster_id",
        "sink",
        "filter",
        "start_position"
      ]
    },
    "ChangefeedArch.Enum": {
      "type": "string",
      "enum": [
        "REPLICATION_WORKER",
        "TICDC_NEWARCH"
      ]
    },
    "ChangefeedFilter": {
      "type": "object",
      "properties": {
        "filter_rule": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "mode": {
          "$ref": "#/definitions/TableMode.Enum"
        },
        "event_filter_rule": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/EventFilterRule"
          }
        },
        "case_sensitive": {
          "type": "boolean"
        },
        "ignore_txn_start_ts": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uint64"
          }
        },
        "bdr_mode": {
          "type": "boolean"
        }
      }
    },
    "ChangefeedService.CreateChangefeedBody": {
      "type": "object",
      "properties": {
        "display_name": {
          "type": "string",
          "description": "The name of the changefeed."
        },
        "sink": {
          "$ref": "#/definitions/SinkInfo",
          "description": "The sink of the changefeed."
        },
        "filter": {
          "$ref": "#/definitions/ChangefeedFilter",
          "description": "The filter of the changefeed."
        },
        "start_position": {
          "$ref": "#/definitions/StartPosition",
          "description": "The start position of the changefeed."
        },
        "arch": {
          "$ref": "#/definitions/ChangefeedArch.Enum",
          "description": "The architecture used by this changefeed."
        },
        "rcu": {
          "type": "integer",
          "format": "int64",
          "description": "The requested RCU for this changefeed. Defaults to 3."
        }
      },
      "required": [
        "sink",
        "filter"
      ]
    },
    "ChangefeedService.DescribeSchemaTableBody": {
      "type": "object",
      "properties": {
        "filter_rules": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The filter rules for schema tables."
        },
        "case_sensitive": {
          "type": "boolean",
          "description": "Whether the filter is case sensitive, default is false."
        }
      }
    },
    "ChangefeedService.EditChangefeedBody": {
      "type": "object",
      "properties": {
        "display_name": {
          "type": "string",
          "description": "The name of the changefeed."
        },
        "sink": {
          "$ref": "#/definitions/SinkInfo",
          "description": "The sink of the changefeed."
        },
        "filter": {
          "$ref": "#/definitions/ChangefeedFilter",
          "description": "The filter of the changefeed."
        }
      },
      "required": [
        "sink",
        "filter"
      ]
    },
    "ChangefeedService.ScaleChangefeedBody": {
      "type": "object",
      "properties": {
        "rcu": {
          "type": "integer",
          "format": "int64",
          "description": "The target RCU."
        }
      },
      "required": [
        "rcu"
      ]
    },
    "ChangefeedService.StartChangefeedBody": {
      "type": "object"
    },
    "ChangefeedService.StopChangefeedBody": {
      "type": "object"
    },
    "ChangefeedService.TestChangefeedBody": {
      "type": "object",
      "properties": {
        "sink": {
          "$ref": "#/definitions/SinkInfo",
          "description": "The sink of the changefeed."
        }
      },
      "required": [
        "sink"
      ]
    },
    "ChangefeedSpecification": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Human-readable identifier (e.g. \"3rcu\", \"8rcu\"). Stable id callers\nuse to refer to a tier.",
          "readOnly": true
        },
        "rcu": {
          "type": "integer",
          "format": "int64",
          "description": "The capacity unit for the tier. Matches the `rcu` field on Create /\nScale requests.",
          "readOnly": true
        },
        "rps_limit": {
          "type": "integer",
          "format": "int64",
          "description": "Maximum rows-per-second the kernel will admit on this tier. 0 means\nunspecified.",
          "readOnly": true
        }
      }
    },
    "ChangefeedState.Enum": {
      "type": "string",
      "enum": [
        "RUNNING",
        "CREATE_FAILED",
        "RUNNING_FAILED",
        "CREATING",
        "SCALING",
        "DELETING",
        "PAUSED",
        "DELETED",
        "WARNING"
      ],
      "description": " - RUNNING: The changefeed is running.\n - CREATE_FAILED: The changefeed has failed during creation.\n - RUNNING_FAILED: The changefeed has failed during running.\n - CREATING: The changefeed is being created.\n - SCALING: The changefeed shared TiCDC cluster is scaling.\n - DELETING: The changefeed is being deleted.\n - PAUSED: The changefeed is paused.\n - DELETED: The changefeed is deleted.\n - WARNING: The changefeed has a warning."
    },
    "ChangefeedType.Enum": {
      "type": "string",
      "enum": [
        "KAFKA",
        "MYSQL",
        "CLOUD_STORAGE"
      ],
      "description": " - KAFKA: Kafka changefeed type.\n - MYSQL: MySQL changefeed type.\n - CLOUD_STORAGE: Cloud storage changefeed type, such as S3, GCS, Azure Blob Storage and OSS."
    },
    "Changefeeds": {
      "type": "object",
      "properties": {
        "changefeeds": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/Changefeed"
          },
          "description": "The list of changefeeds."
        },
        "next_page_token": {
          "type": "string",
          "description": "The token provided to retrieve the next page of results."
        },
        "total_size": {
          "type": "integer",
          "format": "int64",
          "description": "The total number of changefeeds."
        },
        "base_resp": {
          "$ref": "#/definitions/BaseResp"
        }
      }
    },
    "Checkpoint": {
      "type": "object",
      "properties": {
        "tso": {
          "type": "string",
          "format": "uint64",
          "description": "The checkpoint TSO.",
          "readOnly": true
        },
        "time": {
          "type": "string",
          "format": "date-time",
          "description": "The checkpoint in time.",
          "readOnly": true
        }
      }
    },
    "CloudStorage.BinaryEncoding.Enum": {
      "type": "string",
      "enum": [
        "BASE64",
        "HEX"
      ],
      "description": " - BASE64: The binary encoding is base64.\n - HEX: The binary encoding is hex\\."
    },
    "CloudStorage.CSVConfig": {
      "type": "object",
      "properties": {
        "delimiter": {
          "type": "string",
          "title": "default to ','"
        },
        "quote": {
          "type": "string",
          "title": "default to '\"'"
        },
        "null_value": {
          "type": "string",
          "title": "default to '\\N'"
        },
        "include_commit_ts": {
          "type": "boolean",
          "title": "default to false"
        },
        "encoding": {
          "$ref": "#/definitions/CloudStorage.BinaryEncoding.Enum",
          "title": "default to BASE64"
        }
      }
    },
    "CloudStorage.CanalJsonConfig": {
      "type": "object",
      "properties": {
        "enable_tidb_extension": {
          "type": "boolean"
        }
      }
    },
    "CloudStorage.ColumnSelector": {
      "type": "object",
      "properties": {
        "matcher": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "columns": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "CloudStorage.DataFormat": {
      "type": "object",
      "properties": {
        "protocol": {
          "$ref": "#/definitions/CloudStorageProtocol.Enum"
        },
        "csv_config": {
          "$ref": "#/definitions/CloudStorage.CSVConfig"
        },
        "canal_json_config": {
          "$ref": "#/definitions/CloudStorage.CanalJsonConfig"
        }
      }
    },
    "CloudStorage.DateSeparator.Enum": {
      "type": "string",
      "enum": [
        "NONE",
        "YEAR",
        "MONTH",
        "DAY"
      ],
      "description": " - NONE: The data separator is none.\n - YEAR: The data separator by year.\n - MONTH: The data separator by month.\n - DAY: The data separator by day, default to this value."
    },
    "CloudStorageProtocol.Enum": {
      "type": "string",
      "enum": [
        "CANAL_JSON",
        "CSV"
      ],
      "description": " - CANAL_JSON: Canal-JSON protocol.\n - CSV: CSV protocol."
    },
    "CloudStorageType.Enum": {
      "type": "string",
      "enum": [
        "TIDB_CLOUD",
        "S3",
        "GCS",
        "AZURE_BLOB",
        "OSS"
      ],
      "description": " - TIDB_CLOUD: TiDB Cloud's own cloud storage.\n - S3: Amazon S3 cloud storage.\n - GCS: Google Cloud Storage.\n - AZURE_BLOB: Azure Blob Storage.\n - OSS: Alibaba Cloud OSS."
    },
    "ConfluentSchemaRegistry": {
      "type": "object",
      "properties": {
        "endpoint": {
          "type": "string",
          "description": "The schema registry endpoint."
        },
        "enable_http_auth": {
          "type": "boolean",
          "description": "Enable HTTP authentication."
        },
        "username": {
          "type": "string",
          "description": "The username for HTTP authentication."
        },
        "password": {
          "type": "string",
          "description": "The password for HTTP authentication."
        }
      },
      "required": [
        "endpoint"
      ]
    },
    "DebeziumConfig": {
      "type": "object",
      "properties": {
        "disable_output_old_value": {
          "type": "boolean",
          "title": "whether disable output old value, default to false"
        },
        "disable_schema": {
          "type": "boolean",
          "title": "disable schema in debezium message, default to false"
        }
      }
    },
    "DecimalHandlingMode.Enum": {
      "type": "string",
      "enum": [
        "PRECISE",
        "STRING"
      ],
      "description": " - PRECISE: Precise handling mode for decimals.\n - STRING: String handling mode for decimals."
    },
    "DescribeSchemaTableResp": {
      "type": "object",
      "properties": {
        "cluster_id": {
          "type": "string",
          "description": "The ID of the cluster."
        },
        "handle_key_tables": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The tables with handle key(pk or not null uk), up to 1000 tables will be returned."
        },
        "non_handle_key_tables": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The tables without handle key(pk or not null uk), up to 1000 tables will be returned."
        },
        "gc_safe_point": {
          "type": "string",
          "format": "date-time",
          "description": "The GC safe point timestamp."
        },
        "base_resp": {
          "$ref": "#/definitions/BaseResp"
        }
      },
      "required": [
        "cluster_id"
      ]
    },
    "EventFilterRule": {
      "type": "object",
      "properties": {
        "matcher": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "ignore_event": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "GCSCloudStorage": {
      "type": "object",
      "properties": {
        "uri": {
          "type": "string",
          "description": "Required. The GCS URI. For example: gs://<bucket>/<path>/."
        },
        "auth_type": {
          "$ref": "#/definitions/GCSCloudStorage.GCSAuthType",
          "description": "Required. The auth method of GCS."
        },
        "service_account_key": {
          "type": "string",
          "description": "Required. The service account key."
        }
      },
      "required": [
        "uri",
        "auth_type"
      ]
    },
    "GCSCloudStorage.GCSAuthType": {
      "type": "string",
      "enum": [
        "SERVICE_ACCOUNT_KEY"
      ],
      "description": " - SERVICE_ACCOUNT_KEY: The access method is service account key."
    },
    "GlueSchemaRegistry": {
      "type": "object",
      "properties": {
        "region": {
          "type": "string",
          "description": "The region of schema registry."
        },
        "name": {
          "type": "string",
          "description": "The name of schema registry."
        },
        "access_key_id": {
          "type": "string",
          "description": "The AWS access key ID."
        },
        "secret_access_key": {
          "type": "string",
          "description": "The AWS secret access key."
        }
      },
      "required": [
        "region",
        "name",
        "access_key_id",
        "secret_access_key"
      ]
    },
    "Kafka": {
      "type": "object",
      "properties": {
        "network": {
          "$ref": "#/definitions/Kafka.Network"
        },
        "broker": {
          "$ref": "#/definitions/Kafka.Broker"
        },
        "authentication": {
          "$ref": "#/definitions/Kafka.Authentication"
        },
        "data_format": {
          "$ref": "#/definitions/Kafka.DataFormat"
        },
        "topic_partition_config": {
          "$ref": "#/definitions/Kafka.TopicPartitionConfig"
        },
        "column_selectors": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/Kafka.ColumnSelector"
          }
        },
        "output_raw_change_event": {
          "type": "boolean"
        }
      }
    },
    "Kafka.Authentication": {
      "type": "object",
      "properties": {
        "auth_type": {
          "$ref": "#/definitions/KafkaAuthType.Enum"
        },
        "username": {
          "type": "string"
        },
        "password": {
          "type": "string"
        },
        "enable_tls": {
          "type": "boolean"
        },
        "server_name": {
          "type": "string",
          "description": "server name for tls verification. Specify this field when your server rely on TLS SNI, for example, Confluent Cloud Dedicated clusters.\nIf you use private link network, you must attach related domain for the server name to work properly."
        }
      }
    },
    "Kafka.Broker": {
      "type": "object",
      "properties": {
        "kafka_version": {
          "$ref": "#/definitions/KafkaVersion.Enum"
        },
        "compression": {
          "$ref": "#/definitions/KafkaCompressionType.Enum"
        }
      }
    },
    "Kafka.ColumnSelector": {
      "type": "object",
      "properties": {
        "matcher": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "columns": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "Kafka.DataFormat": {
      "type": "object",
      "properties": {
        "protocol": {
          "$ref": "#/definitions/KafkaProtocol.Enum"
        },
        "enable_tidb_extension": {
          "type": "boolean",
          "title": "only available when protocol is CANAL_JSON and AVRO"
        },
        "avro_config": {
          "$ref": "#/definitions/AvroConfig"
        },
        "debezium_config": {
          "$ref": "#/definitions/DebeziumConfig"
        }
      }
    },
    "Kafka.Network": {
      "type": "object",
      "properties": {
        "network_type": {
          "$ref": "#/definitions/KafkaNetworkType.Enum"
        },
        "private_link": {
          "$ref": "#/definitions/Kafka.PrivateLink"
        },
        "public_endpoints": {
          "type": "string"
        }
      }
    },
    "Kafka.PartitionDispatcherConfig": {
      "type": "object",
      "properties": {
        "partition_type": {
          "$ref": "#/definitions/PartitionDispatcher.Enum"
        },
        "matcher": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "index_name": {
          "type": "string"
        },
        "columns": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "Kafka.PrivateLink": {
      "type": "object",
      "properties": {
        "private_link_connection_id": {
          "type": "string"
        },
        "port": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "Kafka.TopicPartitionConfig": {
      "type": "object",
      "properties": {
        "dispatch_type": {
          "$ref": "#/definitions/TopicDispatchType.Enum"
        },
        "default_topic": {
          "type": "string"
        },
        "topic_prefix": {
          "type": "string"
        },
        "separator": {
          "type": "string"
        },
        "topic_suffix": {
          "type": "string"
        },
        "replication_factor": {
          "type": "integer",
          "format": "int64"
        },
        "partition_num": {
          "type": "integer",
          "format": "int64"
        },
        "partition_dispatchers": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/Kafka.PartitionDispatcherConfig"
          }
        }
      }
    },
    "KafkaAuthType.Enum": {
      "type": "string",
      "enum": [
        "DISABLE",
        "SASL_PLAIN",
        "SASL_SCRAM_SHA_256",
        "SASL_SCRAM_SHA_512"
      ],
      "description": " - DISABLE: No authentication.\n - SASL_PLAIN: SASL/PLAIN authentication.\n - SASL_SCRAM_SHA_256: SASL/SCRAM-SHA-256 authentication.\n - SASL_SCRAM_SHA_512: SASL/SCRAM-SHA-512 authentication."
    },
    "KafkaCompressionType.Enum": {
      "type": "string",
      "enum": [
        "NONE",
        "GZIP",
        "SNAPPY",
        "LZ4",
        "ZSTD"
      ]
    },
    "KafkaNetworkType.Enum": {
      "type": "string",
      "enum": [
        "PUBLIC",
        "PRIVATE_LINK"
      ],
      "description": " - PUBLIC: Public network.\n - PRIVATE_LINK: Private Link network."
    },
    "KafkaProtocol.Enum": {
      "type": "string",
      "enum": [
        "CANAL_JSON",
        "OPEN_PROTOCOL",
        "AVRO",
        "DEBEZIUM"
      ],
      "description": " - CANAL_JSON: Canal-JSON protocol.\n - OPEN_PROTOCOL: Open Protocol.\n - AVRO: Avro protocol.\n - DEBEZIUM: Debezium protocol."
    },
    "KafkaVersion.Enum": {
      "type": "string",
      "enum": [
        "VERSION_2XX",
        "VERSION_3XX"
      ],
      "description": " - VERSION_2XX: Kafka 2.x.x version.\n - VERSION_3XX: Kafka 3.x.x version."
    },
    "ListChangefeedSpecificationsResp": {
      "type": "object",
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/ChangefeedSpecification"
          }
        },
        "total": {
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "MySQL": {
      "type": "object",
      "properties": {
        "network": {
          "$ref": "#/definitions/MySQL.Network",
          "description": "The network configuration for the MySQL instance."
        },
        "authentication": {
          "$ref": "#/definitions/MySQL.Authentication",
          "description": "The authentication information for the MySQL instance."
        }
      },
      "required": [
        "network",
        "authentication"
      ]
    },
    "MySQL.Authentication": {
      "type": "object",
      "properties": {
        "user_name": {
          "type": "string",
          "description": "The username for the MySQL instance."
        },
        "password": {
          "type": "string",
          "description": "The password for the MySQL instance."
        },
        "enable_tls": {
          "type": "boolean",
          "description": "Enable TLS for the MySQL connection."
        }
      },
      "required": [
        "user_name",
        "password"
      ]
    },
    "MySQL.Network": {
      "type": "object",
      "properties": {
        "network_type": {
          "$ref": "#/definitions/MySQLNetworkType.Enum"
        },
        "public_endpoint": {
          "type": "string"
        },
        "private_link": {
          "$ref": "#/definitions/MySQL.PrivateLink"
        }
      },
      "required": [
        "network_type"
      ]
    },
    "MySQL.PrivateLink": {
      "type": "object",
      "properties": {
        "private_link_connection_id": {
          "type": "string"
        },
        "port": {
          "type": "integer",
          "format": "int32"
        }
      },
      "required": [
        "private_link_connection_id",
        "port"
      ]
    },
    "MySQLNetworkType.Enum": {
      "type": "string",
      "enum": [
        "PUBLIC",
        "PRIVATE_LINK"
      ],
      "description": " - PUBLIC: Public network.\n - PRIVATE_LINK: Private network."
    },
    "OSSCloudStorage": {
      "type": "object",
      "properties": {
        "uri": {
          "type": "string",
          "description": "Required. The OSS URI. For example: oss://<bucket>/<path>/."
        },
        "auth_type": {
          "$ref": "#/definitions/OSSCloudStorage.OSSAuthType",
          "description": "Required. The auth method of OSS."
        },
        "access_key": {
          "$ref": "#/definitions/OSSCloudStorage.AccessKey",
          "description": "Optional. The access key."
        },
        "role_arn": {
          "type": "string",
          "description": "Optional. The role arn."
        }
      },
      "required": [
        "uri",
        "auth_type"
      ]
    },
    "OSSCloudStorage.AccessKey": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Required. The access key id."
        },
        "secret": {
          "type": "string",
          "description": "Required. The access key secret. This field is input-only."
        }
      },
      "required": [
        "id",
        "secret"
      ]
    },
    "OSSCloudStorage.OSSAuthType": {
      "type": "string",
      "enum": [
        "ACCESS_KEY",
        "ROLE_ARN"
      ],
      "description": " - ACCESS_KEY: The access method is access key.\n - ROLE_ARN: The access method is role arn."
    },
    "PartitionDispatcher.Enum": {
      "type": "string",
      "enum": [
        "TABLE",
        "INDEX_VALUE",
        "TS",
        "COLUMNS"
      ],
      "description": " - TABLE: Partition by table.\n - INDEX_VALUE: Partition by index value.\n - TS: Partition by timestamp.\n - COLUMNS: Partition by columns."
    },
    "S3CloudStorage": {
      "type": "object",
      "properties": {
        "uri": {
          "type": "string",
          "description": "Required. The URI of the S3 folder. For example: s3://<bucket>/<path>/."
        },
        "auth_type": {
          "$ref": "#/definitions/S3CloudStorage.S3AuthType",
          "description": "Required. The auth method of S3."
        },
        "access_key": {
          "$ref": "#/definitions/S3CloudStorage.AccessKey",
          "description": "Optional. The access key of the S3."
        },
        "role_arn": {
          "type": "string",
          "description": "Optional. The role arn of the S3."
        }
      },
      "required": [
        "uri",
        "auth_type"
      ]
    },
    "S3CloudStorage.AccessKey": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Required. The access key id of the S3."
        },
        "secret": {
          "type": "string",
          "description": "Required. The secret access key of the S3."
        }
      },
      "required": [
        "id",
        "secret"
      ]
    },
    "S3CloudStorage.S3AuthType": {
      "type": "string",
      "enum": [
        "ROLE_ARN",
        "ACCESS_KEY"
      ],
      "description": " - ROLE_ARN: The access method is role arn.\n - ACCESS_KEY: The access method is access key."
    },
    "SinkInfo": {
      "type": "object",
      "properties": {
        "type": {
          "$ref": "#/definitions/ChangefeedType.Enum",
          "description": "The type of the sink."
        },
        "kafka": {
          "$ref": "#/definitions/Kafka",
          "description": "The Kafka sink information."
        },
        "mysql": {
          "$ref": "#/definitions/MySQL",
          "description": "The MySQL sink information."
        },
        "cloud_storage": {
          "$ref": "#/definitions/console.CloudStorage",
          "description": "The cloud storage sink information."
        }
      },
      "required": [
        "type"
      ]
    },
    "StartMode.Enum": {
      "type": "string",
      "enum": [
        "FROM_NOW",
        "FROM_TSO",
        "FROM_TIME"
      ],
      "description": " - FROM_NOW: Start from now.\n - FROM_TSO: Start from TSO.\n - FROM_TIME: Start from Time."
    },
    "StartPosition": {
      "type": "object",
      "properties": {
        "mode": {
          "$ref": "#/definitions/StartMode.Enum"
        },
        "tso": {
          "type": "string",
          "format": "uint64",
          "title": "The start position in TSO"
        },
        "time": {
          "type": "string",
          "format": "date-time",
          "title": "The start position in time"
        }
      }
    },
    "Status": {
      "type": "object",
      "properties": {
        "code": {
          "type": "integer",
          "format": "int32"
        },
        "message": {
          "type": "string"
        },
        "details": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/Any"
          }
        }
      }
    },
    "TableMode.Enum": {
      "type": "string",
      "enum": [
        "IGNORE_NOT_SUPPORT_TABLE",
        "FORCE_SYNC"
      ],
      "description": " - IGNORE_NOT_SUPPORT_TABLE: Ignore tables that are not supported.\n - FORCE_SYNC: Force synchronize all tables."
    },
    "TestChangefeedResp": {
      "type": "object",
      "properties": {
        "base_resp": {
          "$ref": "#/definitions/BaseResp"
        }
      }
    },
    "TopicDispatchType.Enum": {
      "type": "string",
      "enum": [
        "ONE_TOPIC",
        "BY_TABLE",
        "BY_DATABASE"
      ],
      "description": " - ONE_TOPIC: One topic for all data.\n - BY_TABLE: Dispatch by table.\n - BY_DATABASE: Dispatch by database."
    },
    "common.CloudStorage": {
      "type": "object",
      "properties": {
        "type": {
          "$ref": "#/definitions/CloudStorageType.Enum",
          "description": "Required. The type of cloud storage."
        },
        "s3": {
          "$ref": "#/definitions/S3CloudStorage"
        },
        "gcs": {
          "$ref": "#/definitions/GCSCloudStorage"
        },
        "azure_blob": {
          "$ref": "#/definitions/AzureBlobCloudStorage"
        },
        "oss": {
          "$ref": "#/definitions/OSSCloudStorage"
        }
      },
      "description": "Message for cloud storage.",
      "required": [
        "type"
      ]
    },
    "console.CloudStorage": {
      "type": "object",
      "properties": {
        "storage": {
          "$ref": "#/definitions/common.CloudStorage"
        },
        "data_format": {
          "$ref": "#/definitions/CloudStorage.DataFormat"
        },
        "date_separator": {
          "$ref": "#/definitions/CloudStorage.DateSeparator.Enum",
          "title": "default to DAY"
        },
        "interval_in_seconds": {
          "type": "integer",
          "format": "int64",
          "title": "default to 5"
        },
        "size_in_mib": {
          "type": "integer",
          "format": "int64",
          "title": "default to 64"
        },
        "output_raw_change_event": {
          "type": "boolean"
        },
        "output_column_id": {
          "type": "boolean",
          "description": "output_column_id adds the source column ID to the schema files of a CSV\ncloud-storage sink. This lets a downstream consumer map columns by ID\nacross DDL changes (add/drop/reorder). Default value is `false`."
        },
        "column_selectors": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/CloudStorage.ColumnSelector"
          },
          "description": "Selects the columns emitted for matching tables. The first matching\nselector takes precedence."
        }
      },
      "required": [
        "storage"
      ]
    }
  },
  "securityDefinitions": {
    "bearer": {
      "type": "apiKey",
      "description": "Authentication token, prefixed by Bearer: 'Bearer token'",
      "name": "Authorization",
      "in": "header"
    }
  }
}
