{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/yunqi/json-schema/yunqi-data-source-create-request-schema.json",
  "title": "DataSourceCreateRequest",
  "x-generated": "2026-11-06",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/yunqi-datasource-api-openapi.yml#/components/schemas/DataSourceCreateRequest",
  "type": "object",
  "properties": {
    "instance": {
      "type": "string"
    },
    "workspace": {
      "type": "string"
    },
    "dsType": {
      "type": "string",
      "enum": [
        "LAKEHOUSE",
        "KAFKA",
        "HIVE",
        "CLICKHOUSE",
        "MYSQL",
        "POSTGRE_SQL",
        "SQL_SERVER",
        "OSS",
        "HBASE",
        "ODPS",
        "MONGO_DB",
        "ES",
        "DORIS",
        "STAR_ROCKS",
        "SELECT_DB",
        "TI_DB",
        "MARIA_DB",
        "POLAR_DB",
        "HOLOGRES",
        "DB2",
        "GREENPLUM",
        "ANALYTIC_DB_MYSQL",
        "ANALYTIC_DB_POSTGRESQL",
        "ORACLE",
        "DM",
        "COS",
        "LOGHUB",
        "CUSTOM_JDBC",
        "SENSORS_API",
        "MIRROR_JDBC",
        "POSTGRE_SQL_CDC",
        "MYSQL_CDC",
        "RESTFUL_API",
        "MS_CDC",
        "AMQP"
      ]
    },
    "dsName": {
      "type": "string"
    },
    "dsDesc": {
      "type": "string"
    },
    "connectionParams": {
      "anyOf": [
        {
          "$ref": "#/$defs/JdbcConnectionParams"
        },
        {
          "$ref": "#/$defs/OssConnectionParams"
        },
        {
          "$ref": "#/$defs/OdpsConnectionParams"
        },
        {
          "$ref": "#/$defs/AmqpConnectionParams"
        },
        {
          "$ref": "#/$defs/CosConnectionParams"
        },
        {
          "$ref": "#/$defs/DorisConnectionParams"
        },
        {
          "$ref": "#/$defs/ElasticSearchConnectionParams"
        },
        {
          "$ref": "#/$defs/HbaseConnectionParams"
        },
        {
          "$ref": "#/$defs/HiveConnectionParams"
        },
        {
          "$ref": "#/$defs/KafkaConnectionParams"
        },
        {
          "$ref": "#/$defs/LoghubConnectionParams"
        },
        {
          "$ref": "#/$defs/MongodbConnectionParams"
        },
        {
          "type": "string"
        },
        {
          "$ref": "#/$defs/CreateMark"
        }
      ]
    }
  },
  "required": [
    "workspace",
    "dsName",
    "instance",
    "connectionParams"
  ],
  "$defs": {
    "AmqpConnectionParams": {
      "type": "object",
      "properties": {
        "accessKeyId": {
          "type": "string"
        },
        "accessKeySecret": {
          "type": "string",
          "x-is-encrypted": true,
          "description": "官方 SDK 在发送前使用服务端公钥做 RSA PKCS#1 v1.5 加密并 Base64 编码；此处描述的是线上传输字段，不应直接提交明文。",
          "x-client-transform": {
            "encryption": "RSAES-PKCS1-v1_5",
            "encoding": "base64",
            "keySourceOperationId": "getPublicKey"
          }
        },
        "consumerGroupId": {
          "type": "string"
        },
        "iotInstanceId": {
          "type": "string"
        },
        "authType": {
          "type": "string"
        },
        "host": {
          "type": "string"
        },
        "endpoint": {
          "type": "string"
        },
        "roleArn": {
          "type": "string"
        }
      },
      "required": [
        "accessKeyId",
        "accessKeySecret",
        "consumerGroupId",
        "iotInstanceId",
        "authType",
        "host",
        "endpoint",
        "roleArn"
      ]
    },
    "CosConnectionParams": {
      "type": "object",
      "properties": {
        "regionName": {
          "type": "string"
        },
        "bucket": {
          "type": "string"
        },
        "secretId": {
          "type": "string"
        },
        "secretKey": {
          "type": "string",
          "x-is-encrypted": true,
          "description": "官方 SDK 在发送前使用服务端公钥做 RSA PKCS#1 v1.5 加密并 Base64 编码；此处描述的是线上传输字段，不应直接提交明文。",
          "x-client-transform": {
            "encryption": "RSAES-PKCS1-v1_5",
            "encoding": "base64",
            "keySourceOperationId": "getPublicKey"
          }
        }
      },
      "required": [
        "regionName",
        "bucket",
        "secretId",
        "secretKey"
      ]
    },
    "CreateMark": {
      "type": "object",
      "properties": {
        "createMark": {
          "type": "string"
        }
      },
      "required": [
        "createMark"
      ]
    },
    "DorisConnectionParams": {
      "type": "object",
      "properties": {
        "jdbcUrl": {
          "type": "string"
        },
        "externalCatalog": {
          "type": "string"
        },
        "schema": {
          "type": "string"
        },
        "username": {
          "type": "string"
        },
        "password": {
          "type": "string",
          "x-is-encrypted": true,
          "description": "官方 SDK 在发送前使用服务端公钥做 RSA PKCS#1 v1.5 加密并 Base64 编码；此处描述的是线上传输字段，不应直接提交明文。",
          "x-client-transform": {
            "encryption": "RSAES-PKCS1-v1_5",
            "encoding": "base64",
            "keySourceOperationId": "getPublicKey"
          }
        },
        "sshEnabled": {
          "type": "boolean"
        },
        "sshHost": {
          "type": "string"
        },
        "sshPort": {
          "type": "integer"
        },
        "sshUsername": {
          "type": "string"
        },
        "sshPassword": {
          "type": "string",
          "x-is-encrypted": true,
          "description": "官方 SDK 在发送前使用服务端公钥做 RSA PKCS#1 v1.5 加密并 Base64 编码；此处描述的是线上传输字段，不应直接提交明文。",
          "x-client-transform": {
            "encryption": "RSAES-PKCS1-v1_5",
            "encoding": "base64",
            "keySourceOperationId": "getPublicKey"
          }
        },
        "feNodes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "beNodes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "batchSize": {
          "type": "integer"
        },
        "supportRead": {
          "type": "boolean"
        },
        "supportWrite": {
          "type": "boolean"
        }
      },
      "required": [
        "jdbcUrl",
        "externalCatalog",
        "schema",
        "username",
        "password",
        "sshEnabled",
        "sshHost",
        "sshPort",
        "sshUsername",
        "sshPassword",
        "feNodes",
        "beNodes",
        "batchSize",
        "supportRead",
        "supportWrite"
      ]
    },
    "ElasticSearchConnectionParams": {
      "type": "object",
      "properties": {
        "hosts": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "username": {
          "type": "string"
        },
        "password": {
          "type": "string",
          "x-is-encrypted": true,
          "description": "官方 SDK 在发送前使用服务端公钥做 RSA PKCS#1 v1.5 加密并 Base64 编码；此处描述的是线上传输字段，不应直接提交明文。",
          "x-client-transform": {
            "encryption": "RSAES-PKCS1-v1_5",
            "encoding": "base64",
            "keySourceOperationId": "getPublicKey"
          }
        },
        "tlsVerifyCertificate": {
          "type": "boolean"
        },
        "tlsVerifyHostnames": {
          "type": "boolean"
        },
        "keystorePath": {
          "type": "string"
        },
        "keystorePassword": {
          "type": "string",
          "x-is-encrypted": true,
          "description": "官方 SDK 在发送前使用服务端公钥做 RSA PKCS#1 v1.5 加密并 Base64 编码；此处描述的是线上传输字段，不应直接提交明文。",
          "x-client-transform": {
            "encryption": "RSAES-PKCS1-v1_5",
            "encoding": "base64",
            "keySourceOperationId": "getPublicKey"
          }
        },
        "truststorePath": {
          "type": "string"
        },
        "truststorePassword": {
          "type": "string",
          "x-is-encrypted": true,
          "description": "官方 SDK 在发送前使用服务端公钥做 RSA PKCS#1 v1.5 加密并 Base64 编码；此处描述的是线上传输字段，不应直接提交明文。",
          "x-client-transform": {
            "encryption": "RSAES-PKCS1-v1_5",
            "encoding": "base64",
            "keySourceOperationId": "getPublicKey"
          }
        }
      },
      "required": [
        "hosts",
        "username",
        "password",
        "tlsVerifyCertificate",
        "tlsVerifyHostnames",
        "keystorePath",
        "keystorePassword",
        "truststorePath",
        "truststorePassword"
      ]
    },
    "HbaseConnectionParams": {
      "type": "object",
      "properties": {
        "zookeeperQuorum": {
          "type": "string"
        },
        "rootDir": {
          "type": "string"
        },
        "znodeParent": {
          "type": "string"
        },
        "extraConfig": {
          "type": [
            "object",
            "null"
          ],
          "properties": {},
          "additionalProperties": {
            "type": "string"
          }
        },
        "authenticationMode": {
          "type": "string"
        },
        "principal": {
          "type": "string"
        },
        "keytabLocation": {
          "type": "string"
        },
        "krb5ConfLocation": {
          "type": "string"
        }
      },
      "required": [
        "zookeeperQuorum",
        "rootDir",
        "znodeParent",
        "authenticationMode",
        "principal",
        "keytabLocation",
        "krb5ConfLocation"
      ]
    },
    "HiveConnectionParams": {
      "type": "object",
      "properties": {
        "jdbcUrl": {
          "type": "string"
        },
        "username": {
          "type": "string"
        },
        "password": {
          "type": "string",
          "x-is-encrypted": true,
          "description": "官方 SDK 在发送前使用服务端公钥做 RSA PKCS#1 v1.5 加密并 Base64 编码；此处描述的是线上传输字段，不应直接提交明文。",
          "x-client-transform": {
            "encryption": "RSAES-PKCS1-v1_5",
            "encoding": "base64",
            "keySourceOperationId": "getPublicKey"
          }
        },
        "db": {
          "type": "string"
        },
        "loginMode": {
          "type": "string"
        },
        "defaultFS": {
          "type": "string"
        },
        "hiveVersion": {
          "type": "string"
        },
        "hiveMetaStoreUri": {
          "type": "string"
        },
        "extraConfig": {
          "type": "string"
        },
        "hadoopConfig": {
          "type": "object",
          "properties": {},
          "additionalProperties": {
            "type": "string"
          }
        },
        "authenticationMode": {
          "type": "string"
        },
        "principal": {
          "type": "string"
        },
        "keytabLocation": {
          "type": "string"
        },
        "krb5ConfLocation": {
          "type": "string"
        },
        "sshEnabled": {
          "type": "boolean"
        },
        "sshHost": {
          "type": "string"
        },
        "sshPort": {
          "type": "integer"
        },
        "sshUsername": {
          "type": "string"
        },
        "sshPassword": {
          "type": "string",
          "x-is-encrypted": true,
          "description": "官方 SDK 在发送前使用服务端公钥做 RSA PKCS#1 v1.5 加密并 Base64 编码；此处描述的是线上传输字段，不应直接提交明文。",
          "x-client-transform": {
            "encryption": "RSAES-PKCS1-v1_5",
            "encoding": "base64",
            "keySourceOperationId": "getPublicKey"
          }
        }
      },
      "required": [
        "jdbcUrl",
        "username",
        "password",
        "db",
        "loginMode",
        "defaultFS",
        "hiveVersion",
        "hiveMetaStoreUri",
        "extraConfig",
        "hadoopConfig",
        "principal",
        "keytabLocation",
        "krb5ConfLocation",
        "sshEnabled",
        "sshHost",
        "sshPort",
        "sshUsername",
        "sshPassword",
        "authenticationMode"
      ]
    },
    "JdbcConnectionParams": {
      "type": "object",
      "properties": {
        "jdbcUrl": {
          "type": "string"
        },
        "username": {
          "type": "string"
        },
        "password": {
          "type": "string",
          "x-is-encrypted": true,
          "description": "官方 SDK 在发送前使用服务端公钥做 RSA PKCS#1 v1.5 加密并 Base64 编码；此处描述的是线上传输字段，不应直接提交明文。",
          "x-client-transform": {
            "encryption": "RSAES-PKCS1-v1_5",
            "encoding": "base64",
            "keySourceOperationId": "getPublicKey"
          }
        },
        "supportCrossNamespace": {
          "type": "boolean",
          "default": false
        },
        "sshEnabled": {
          "type": "boolean",
          "default": false
        },
        "sshHost": {
          "type": "string"
        },
        "sshPort": {
          "type": "string"
        },
        "sshUsername": {
          "type": "string"
        },
        "sshPassword": {
          "type": "string",
          "x-is-encrypted": true,
          "description": "官方 SDK 在发送前使用服务端公钥做 RSA PKCS#1 v1.5 加密并 Base64 编码；此处描述的是线上传输字段，不应直接提交明文。",
          "x-client-transform": {
            "encryption": "RSAES-PKCS1-v1_5",
            "encoding": "base64",
            "keySourceOperationId": "getPublicKey"
          }
        },
        "serverTimezone": {
          "type": "string"
        }
      },
      "required": [
        "jdbcUrl",
        "username",
        "password"
      ]
    },
    "KafkaConnectionParams": {
      "type": "object",
      "properties": {
        "bootstrapServers": {
          "type": "string"
        },
        "securityProtocol": {
          "type": "string"
        },
        "saslJaasConfig": {
          "type": "string"
        },
        "saslMechanism": {
          "type": "string"
        },
        "sslTruststoreLocation": {
          "type": "string"
        },
        "sslTruststorePassword": {
          "type": "string",
          "x-is-encrypted": true,
          "description": "官方 SDK 在发送前使用服务端公钥做 RSA PKCS#1 v1.5 加密并 Base64 编码；此处描述的是线上传输字段，不应直接提交明文。",
          "x-client-transform": {
            "encryption": "RSAES-PKCS1-v1_5",
            "encoding": "base64",
            "keySourceOperationId": "getPublicKey"
          }
        },
        "sslKeystoreLocation": {
          "type": "string"
        },
        "sslKeystorePassword": {
          "type": "string",
          "x-is-encrypted": true,
          "description": "官方 SDK 在发送前使用服务端公钥做 RSA PKCS#1 v1.5 加密并 Base64 编码；此处描述的是线上传输字段，不应直接提交明文。",
          "x-client-transform": {
            "encryption": "RSAES-PKCS1-v1_5",
            "encoding": "base64",
            "keySourceOperationId": "getPublicKey"
          }
        }
      },
      "required": [
        "bootstrapServers",
        "securityProtocol",
        "saslJaasConfig",
        "saslMechanism",
        "sslTruststoreLocation",
        "sslTruststorePassword",
        "sslKeystoreLocation",
        "sslKeystorePassword"
      ]
    },
    "LoghubConnectionParams": {
      "type": "object",
      "properties": {
        "endpoint": {
          "type": "string"
        },
        "project": {
          "type": "string"
        },
        "accessKeyId": {
          "type": "string"
        },
        "accessKeySecret": {
          "type": "string",
          "x-is-encrypted": true,
          "description": "官方 SDK 在发送前使用服务端公钥做 RSA PKCS#1 v1.5 加密并 Base64 编码；此处描述的是线上传输字段，不应直接提交明文。",
          "x-client-transform": {
            "encryption": "RSAES-PKCS1-v1_5",
            "encoding": "base64",
            "keySourceOperationId": "getPublicKey"
          }
        }
      },
      "required": [
        "endpoint",
        "project",
        "accessKeyId",
        "accessKeySecret"
      ]
    },
    "MongodbConnectionParams": {
      "type": "object",
      "properties": {
        "deployMode": {
          "type": "string"
        },
        "username": {
          "type": "string"
        },
        "password": {
          "type": "string",
          "x-is-encrypted": true,
          "description": "官方 SDK 在发送前使用服务端公钥做 RSA PKCS#1 v1.5 加密并 Base64 编码；此处描述的是线上传输字段，不应直接提交明文。",
          "x-client-transform": {
            "encryption": "RSAES-PKCS1-v1_5",
            "encoding": "base64",
            "keySourceOperationId": "getPublicKey"
          }
        },
        "authDatabase": {
          "type": "string"
        },
        "database": {
          "type": "string"
        },
        "hostPortList": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "readPreference": {
          "type": "string"
        },
        "replicaSetName": {
          "type": "string"
        },
        "directConnection": {
          "type": "boolean"
        }
      },
      "required": [
        "deployMode",
        "username",
        "password",
        "authDatabase",
        "database",
        "hostPortList",
        "readPreference",
        "replicaSetName",
        "directConnection"
      ]
    },
    "OdpsConnectionParams": {
      "type": "object",
      "properties": {
        "accessId": {
          "type": "string"
        },
        "accessKey": {
          "type": "string",
          "x-is-encrypted": true,
          "description": "官方 SDK 在发送前使用服务端公钥做 RSA PKCS#1 v1.5 加密并 Base64 编码；此处描述的是线上传输字段，不应直接提交明文。",
          "x-client-transform": {
            "encryption": "RSAES-PKCS1-v1_5",
            "encoding": "base64",
            "keySourceOperationId": "getPublicKey"
          }
        },
        "endpoint": {
          "type": "string"
        },
        "tunnelEndpoint": {
          "type": "string"
        },
        "project": {
          "type": "string"
        }
      },
      "required": [
        "accessId",
        "accessKey",
        "endpoint",
        "tunnelEndpoint",
        "project"
      ]
    },
    "OssConnectionParams": {
      "type": "object",
      "properties": {
        "endpoint": {
          "type": "string"
        },
        "bucket": {
          "type": "string"
        },
        "accessKeyId": {
          "type": "string"
        },
        "accessKeySecret": {
          "type": "string",
          "x-is-encrypted": true,
          "description": "官方 SDK 在发送前使用服务端公钥做 RSA PKCS#1 v1.5 加密并 Base64 编码；此处描述的是线上传输字段，不应直接提交明文。",
          "x-client-transform": {
            "encryption": "RSAES-PKCS1-v1_5",
            "encoding": "base64",
            "keySourceOperationId": "getPublicKey"
          }
        }
      },
      "required": [
        "endpoint",
        "accessKeyId",
        "accessKeySecret",
        "bucket"
      ]
    }
  }
}