Add DataSource
Interface Overview
Add datasource information.
Interface Address
/cloudcanal/console/api/v1/openapi/datasource/addds
Request Manner
POST
Request Parameters
| ParameterName | Parameter Description | RequestType | Whether Required | DataType |
|---|---|---|---|---|
| dataSourceAddData | Data source configuration in standard JSON format | Body | True | String |
| securityFile | Security file, such as the truststore file for SSL or the krb5 file for Kerberos | Body | False | MultipartFile |
| secretFile | Secret file, such as the username/password file for jaas or the keytab file for Kerberos | Body | False | MultipartFile |
DataSourceAddData Indicates the parameter description
| ParameterName | Parameter Description | Type(Java) | NotNull |
|---|---|---|---|
| deployType | Data source deployment type SELF_MAINTENANCE (self-built) ALIBABA_CLOUD_HOSTED (Alibaba Cloud) | String | True |
| region | Data source region hangzhou shanghai beijing shenzhen qingdao zhangjiakou huhehaote hongkong singapore silicon_valley london mq_internet_access customer | String | True |
| type | Data source type MySQL PolarDbMySQL PolarDbX PostgreSQL Greenplum Oracle SQLServer Redis MongoDB Kafka RocketMQ RabbitMQ Hive ElasticSearch DRDS AdbForMySQL TiDB ClickHouse Kudu | String | True |
| hostType | Default network type PRIVATE (intranet) PUBLIC (public network) | String | True |
| privateHost | Intranet host | String | Depending on hostType |
| publicHost | Public network host | String | Depending on hostType |
| securityType | Security key type KERBEROS USER_PASSWD_WITH_TLS USER_PASSWD ONLY_USER ONLY_PASSWD NONE | String | True |
| account | Account | String | Depending on securityType |
| password | Password | String | Depending on securityType |
| instanceDesc | Data source description | String | False |
| instanceId | Alibaba Cloud instance ID | String | False |
| accessKey | Alibaba Cloud access key | String | False |
| secretKey | Alibaba Cloud secret key | String | False |
| clientTrustStorePassword | Truststore file password when security key type is USER_PASSWD_WITH_TLS | String | False |
| version | Database version | String | False |
| connectType | Connection type, currently only valid for Oracle ORACLE_SID ORACLE_SERVICE ORACLE_TNS ORACLE_PDB | String | False |
Public Response Results
| ParameterName | Parameter Description | Type(Java) | NotNull |
|---|---|---|---|
| code | 1: Success 0: Failure | String | True |
| data | Object | False | |
| msg | String | False | |
| requestId | String | True |
Data Parameters
The data is a number that indicates the data source id that was successfully added.
Response Example
{
"requestId": "422622b9-2bf5-11ec-8b3e-172e4c81a5c3",
"code": "1",
"msg": "request success",
"data": 123243
}