Create connector¶
Save the connection information of external data sources in the current workspace. This operation does not start importing or exporting data or verifying network connectivity.
POST $CLOUDSIGMA_API_BASE/connectors
Before you call¶
Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region.
Prepare personal access token and target workspace ID that can access the target workspace.
Determine the data source type and purpose according to Data source type description.
Click the request body below to prepare the connection information for the data source. A request only fills in a set of config objects corresponding to the selected data source.
Request body¶
The example uses jq to construct the JSON request body. Install jq first and set the required environment variables. Do not JSON encode the variable values again.
Replace the connection information in $CLOUDSIGMA_API_KEY, $WORKSPACE_ID, and examples with actual values.
Local
Local’s configuration object does not have a fixed path field. The local path is not checked when saving, and connectivity verification always fails. Successful creation does not prove that the file is accessible.
Kafka
config.kafka.bootstrap_servers and security_protocol are used for Worker connection. The agreement accepts PLAINTEXT, SSL, SASL_PLAINTEXT, SASL_SSL. When using SASL, configure the authentication mechanism, username and password.
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Required when connecting |
Kafka address list. |
|
string |
Required when connecting |
One of the four protocols mentioned above. |
|
string |
No |
PEM CA certificate, only available for SSL or SASL_SSL. |
|
string |
Conditional |
Under the SASL protocol, fill in PLAIN, SCRAM-SHA-256 or SCRAM-SHA-512. |
|
string |
Conditional |
SASL username. |
|
string |
Conditional |
SASL password to protect submissions and connection configuration. |
|
string |
No |
Schema Registry address. |
|
string |
No |
Schema Registry API Key。 |
|
string |
No |
Schema Registry API Secret。 |
The following example saves the PLAINTEXT connection configuration without checking connectivity.
curl -X POST "$CLOUDSIGMA_API_BASE/connectors" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"name": "kafka-orders",
"source_type": 15,
"usage_type": [1],
"config": {
"kafka": {
"bootstrap_servers": "kafka.example.com:9092",
"security_protocol": "PLAINTEXT"
}
}
}'
Doris
Doris only supports import. Check host, SQL port, HTTP port, user, password and protocol when creating. Save without accessing the database.
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Doris host. |
|
integer |
Yes |
SQL port, 1–65535. |
|
string |
Yes |
DISABLED or REQUIRED. |
|
string |
Yes |
HTTP or HTTPS. |
|
integer |
Yes |
FE HTTP port, 1–65535. |
|
integer |
No |
FE Flight SQL port. |
|
string |
Yes |
Doris username. |
|
string |
Yes |
Doris password to protect submissions and connection configurations. |
|
string |
No |
Database name. |
Replace $DORIS_PASSWORD with the database password held by the caller. Do not write the full request body to the public log.
curl -X POST "$CLOUDSIGMA_API_BASE/connectors" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
--data-binary @- <<JSON
{
"name": "doris-orders",
"source_type": 16,
"usage_type": [1],
"config": {
"doris": {
"host": "doris.example.com",
"port": 9030,
"ssl_mode": "DISABLED",
"fe_http_protocol": "HTTP",
"fe_http_port": 8030,
"username": "reader",
"password": "${DORIS_PASSWORD}"
}
}
}
JSON
data source |
source_type |
Object in config. |
|---|---|---|
Local |
|
Open configuration object, currently there is no dedicated path configuration verification. |
Kafka |
|
|
Doris |
|
|
Fill in the network and authentication configuration of Kafka and Doris according to the target service. Configuration fields not listed in the field table are not automatically discarded.
Standard S3
curl -X POST "$CLOUDSIGMA_API_BASE/connectors" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
--data-binary "$(jq -n --arg S3_ACCESS_KEY_ID "$S3_ACCESS_KEY_ID" --arg S3_ACCESS_KEY_SECRET "$S3_ACCESS_KEY_SECRET" '
{
"name": "s3-orders-import",
"source_type": 5,
"usage_type": [
1
],
"config": {
"s3": {
"endpoint": "https://s3.example.com",
"access_key_id": $S3_ACCESS_KEY_ID,
"access_key_secret": $S3_ACCESS_KEY_SECRET,
"bucket_name": "orders/import",
"region": "us-east-1",
"path_style": false
}
}
}
')"
Alibaba Cloud OSS
curl -X POST "$CLOUDSIGMA_API_BASE/connectors" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
--data-binary "$(jq -n --arg OSS_ACCESS_KEY_ID "$OSS_ACCESS_KEY_ID" --arg OSS_ACCESS_KEY_SECRET "$OSS_ACCESS_KEY_SECRET" '
{
"name": "oss-orders-import",
"source_type": 4,
"usage_type": [
1
],
"config": {
"oss": {
"endpoint": "https://oss-cn-hangzhou.aliyuncs.com",
"access_key_id": $OSS_ACCESS_KEY_ID,
"access_key_secret": $OSS_ACCESS_KEY_SECRET,
"bucket_name": "orders/import"
}
}
}
')"
OmniFabric
curl -X POST "$CLOUDSIGMA_API_BASE/connectors" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
--data-binary "$(jq -n --arg MO_PASSWORD "$MO_PASSWORD" '
{
"name": "matrixone-analytics",
"source_type": 3,
"usage_type": [
2
],
"config": {
"mo": {
"host": "mo.example.com",
"port": 6001,
"username": "admin",
"password": $MO_PASSWORD,
"database": "analytics"
}
}
}
')"
HDFS Simple
curl -X POST "$CLOUDSIGMA_API_BASE/connectors" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"name": "hdfs-orders-import",
"source_type": 7,
"usage_type": [1],
"config": {
"hdfs": {
"address": "hdfs://namenode.example.com:8020",
"auth_type": 0,
"username": "hdfs",
"file_path": "/data/orders"
}
}
}'
HDFS Kerberos
curl -X POST "$CLOUDSIGMA_API_BASE/connectors" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
--data-binary "$(jq -n --arg HDFS_KEYTAB_BASE64 "$HDFS_KEYTAB_BASE64" --arg HDFS_KRB5_CONF_BASE64 "$HDFS_KRB5_CONF_BASE64" '
{
"name": "hdfs-kerberos-orders-import",
"source_type": 7,
"usage_type": [
1
],
"config": {
"hdfs": {
"address": "hdfs://namenode.example.com:8020",
"auth_type": 1,
"kerberos_principal": "hdfs-client@EXAMPLE.COM",
"service_principal": "hdfs/hdfs-1.example.com@EXAMPLE.COM",
"keytab_content": $HDFS_KEYTAB_BASE64,
"krb5_conf_content": $HDFS_KRB5_CONF_BASE64,
"proxy_user": "hdfs",
"file_path": "/data/orders"
}
}
}
')"
Hive LDAP
curl -X POST "$CLOUDSIGMA_API_BASE/connectors" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
--data-binary "$(jq -n --arg HIVE_PASSWORD "$HIVE_PASSWORD" '
{
"name": "hive-orders-import",
"source_type": 8,
"usage_type": [
1
],
"config": {
"hive": {
"addresses": [
"hive-1.example.com:10000"
],
"auth_type": 0,
"username": "hive_user",
"password": $HIVE_PASSWORD
}
}
}
')"
Hive Kerberos
curl -X POST "$CLOUDSIGMA_API_BASE/connectors" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
--data-binary "$(jq -n --arg HIVE_KEYTAB_BASE64 "$HIVE_KEYTAB_BASE64" --arg HIVE_KRB5_CONF_BASE64 "$HIVE_KRB5_CONF_BASE64" '
{
"name": "hive-kerberos-orders-import",
"source_type": 8,
"usage_type": [
1
],
"config": {
"hive": {
"addresses": [
"hive-1.example.com:10000"
],
"auth_type": 1,
"client_principal": "hive-client@EXAMPLE.COM",
"service_principal": "hive/hive-1.example.com@EXAMPLE.COM",
"keytab_data": $HIVE_KEYTAB_BASE64,
"krb5_conf_data": $HIVE_KRB5_CONF_BASE64
}
}
}
')"
MySQL
curl -X POST "$CLOUDSIGMA_API_BASE/connectors" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
--data-binary "$(jq -n --arg MYSQL_PASSWORD "$MYSQL_PASSWORD" '
{
"name": "mysql-orders-import",
"source_type": 9,
"usage_type": [
1
],
"config": {
"mysql": {
"host": "mysql.example.com",
"port": 3306,
"username": "reader",
"password": $MYSQL_PASSWORD,
"database": "orders"
}
}
}
')"
SQL Server
curl -X POST "$CLOUDSIGMA_API_BASE/connectors" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
--data-binary "$(jq -n --arg SQLSERVER_PASSWORD "$SQLSERVER_PASSWORD" '
{
"name": "sqlserver-orders-import",
"source_type": 10,
"usage_type": [
1
],
"config": {
"sqlserver": {
"host": "sqlserver.example.com",
"port": 1433,
"username": "reader",
"password": $SQLSERVER_PASSWORD,
"database": "orders"
}
}
}
')"
Oracle
curl -X POST "$CLOUDSIGMA_API_BASE/connectors" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
--data-binary "$(jq -n --arg ORACLE_PASSWORD "$ORACLE_PASSWORD" '
{
"name": "oracle-orders-import",
"source_type": 11,
"usage_type": [
1
],
"config": {
"oracle": {
"host": "oracle.example.com",
"port": 1521,
"username": "reader",
"password": $ORACLE_PASSWORD,
"service_name": "ORCLPDB1"
}
}
}
')"
PostgreSQL
curl -X POST "$CLOUDSIGMA_API_BASE/connectors" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
--data-binary "$(jq -n --arg POSTGRESQL_PASSWORD "$POSTGRESQL_PASSWORD" '
{
"name": "postgresql-orders-import",
"source_type": 12,
"usage_type": [
1
],
"config": {
"postgresql": {
"host": "postgresql.example.com",
"port": 5432,
"username": "reader",
"password": $POSTGRESQL_PASSWORD,
"database": "orders"
}
}
}
')"
MongoDB
curl -X POST "$CLOUDSIGMA_API_BASE/connectors" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
--data-binary "$(jq -n --arg MONGODB_PASSWORD "$MONGODB_PASSWORD" '
{
"name": "mongodb-orders-import",
"source_type": 13,
"usage_type": [
1
],
"config": {
"mongodb": {
"host": "mongodb.example.com",
"port": 27017,
"authMode": "userpass",
"user": "reader",
"password": $MONGODB_PASSWORD,
"authSource": "admin",
"readPreference": "primary",
"readConcern": "majority"
}
}
}
')"
The name cannot contain leading and trailing spaces, half-width spaces, tab characters, carriage returns, line feeds, and <, >. The service does not automatically remove these characters.
When using Kerberos with HDFS, supply service_principal and retain file_path. Provide the keytab and krb5 configuration contents or trusted server files, and ensure the service can read them. File names alone do not establish a usable configuration.
Purpose 1 means import, 2 means export, 3 or [1,2] means both.
OmniFabric and Dify only support export.
HDFS, Oracle, PostgreSQL, MongoDB, Kafka, and Doris only support import.
OSS, S3 and other valid types support
1,2,3.
The currently createable types are 1, 3–13, 15, and 16, including Local, Kafka, and Doris. Although Baidu Netdisk 2 and Langfuse 14 are retained in the type list, creation is currently not supported.
Only the connection configuration is verified when creating, and the status after saving is active. When connectivity needs to be checked, the verification interface is called separately. If the creation fails, an error will be returned directly, and the connector with status failed will not be saved.
Standard S3
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Connector name. It cannot have leading or trailing blanks and cannot be empty. Cannot contain half-width spaces, |
|
integer |
Yes |
Data source type code. Standard S3 fills in |
|
integer or array of integer |
Yes |
Connector purpose. |
|
object |
Yes |
Connection information. Only fill in a set of configuration objects corresponding to |
|
string |
No |
S3 service address. If not filled in, the default address of the S3 service is used. |
|
string |
Yes |
Access key ID. |
|
string |
Yes |
Access key. |
|
string |
Yes |
Bucket name. Can be written as bucket name/prefix, such as |
|
string |
No |
The region where the bucket is located. |
|
string |
No |
The session token filled in when using temporary credentials. |
|
boolean |
No |
Use the path style address when filling in |
|
string |
Yes |
OSS service address. |
|
string |
Yes |
AccessKey ID。 |
|
string |
Yes |
AccessKey Secret。 |
|
string |
Yes |
Bucket name. Can be written as bucket name/prefix, such as |
|
string |
Yes |
OmniFabric service address. |
|
integer |
Yes |
OmniFabric service port. |
|
string |
Yes |
Login username. |
|
string |
Yes |
Login password. |
|
string |
No |
Default database name. |
|
string |
Yes |
NameNode address, can be prefixed with |
|
integer |
Yes |
Authentication type: Simple for |
|
string |
Required when Simple |
HDFS username used for Simple authentication. |
|
string |
Yes |
An HDFS base directory accessible to the connector, for example |
|
string |
Yes |
Kerberos client principal. |
|
string |
Yes |
HDFS service principal. |
|
string (Base64 encoding) |
Conditional |
During Kerberos authentication, the required Keytab content when |
|
string (Base64 encoding) |
Conditional |
During Kerberos authentication, the required |
|
string |
No |
The proxy user to use after logging in. |
|
array of string |
Yes |
HiveServer2 address list. Fill in at least one |
|
integer |
Yes |
Authentication type: |
|
string |
Required for LDAP |
LDAP username. |
|
string |
Required for LDAP |
LDAP password. |
|
string |
Yes |
The user principal used to log in. |
|
string |
Yes |
HiveServer2 service principal. |
|
string |
Yes |
Keytab content. |
|
string |
Yes |
|
|
string |
Yes |
MySQL database host address. |
|
integer |
Yes |
MySQL database port. |
|
string |
Yes |
Login username. |
|
string |
Yes |
Login password. |
|
string |
Yes |
The name of the database to connect to. The connector only browses and imports the database after it is created. |
|
string |
Yes |
SQL Server database host address. |
|
integer |
Yes |
SQL Server database port. |
|
string |
Yes |
Login username. |
|
string |
Yes |
Login password. |
|
string |
No |
The name of the database to open when connecting. If omitted, connect to the SQL Server instance first, and then browse the accessible databases. |
|
string |
Yes |
Oracle host address. |
|
integer |
Yes |
Oracle port. |
|
string |
Yes |
Login username. |
|
string |
Yes |
Login password. |
|
string |
Yes |
Oracle service name to connect to. |
|
string |
Yes |
PostgreSQL host address. |
|
integer |
Yes |
PostgreSQL port. |
|
string |
Yes |
Login username. |
|
string |
Yes |
Login password. |
|
string |
Yes |
The name of the database to connect to. The connector only browses and imports the database after it is created. |
|
string |
Yes |
MongoDB host address. |
|
integer |
Yes |
MongoDB port. |
|
string |
Yes |
Authentication method: |
|
string |
Required when authMode is userpass |
|
|
string |
No |
|
|
string |
Required when authMode is userpass |
When |
|
string |
No |
Replica set name. |
|
string |
No |
Read node preference, optional |
|
string |
No |
Read consistency level, optional |
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": {
"id": "conn_01",
"name": "s3-orders-import",
"source_type": 5,
"created_at": 1735632000,
"updated_at": 1735632000,
"status": "active",
"username": "user_01",
"related_task_ids": [],
"usage_type": [
1
],
"config": {
"s3": {
"endpoint": "https://s3.example.com",
"bucket_name": "orders",
"region": "us-east-1"
}
}
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
object |
Saved connector. |
|
string |
New connector ID. |
|
string |
Saved connector name. |
|
integer |
Saved data source type code. |
|
integer |
Unix timestamp of creation time. |
|
integer |
Unix timestamp of the time of update. |
|
string |
Current connector status. After creation, it is |
|
string |
The name of the user who created this connector. |
|
array of string |
Associated import task ID list. It is an empty array when creating a new connector. |
|
integer (integer array) |
List of saved uses: |
|
object |
Saved connection configuration object. The object structure is determined by |
Error response¶
{
"code": "ErrParamInvalid",
"msg": "invalid connector parameters"
}
Field |
Type |
Description |
|---|---|---|
|
string |
error code. |
|
string |
Readable error message. |
Common HTTP errors¶
HTTP status |
Error code |
Common cause |
Recommended action |
|---|---|---|---|
400 |
|
Invalid request field, workspace, or operation precondition. |
Fix the request parameters and submit again. |
401 |
|
Missing or invalid authentication credentials. |
Check the credential type, expiration, and authentication header. |
403 |
|
The current identity or active role does not have permission for this operation. |
Use an authorized identity or contact an administrator to grant access. |
404 |
|
The target object or required reference was not found. |
Verify the object identifier, workspace, and current status. |
409 |
|
Conflict in resource state, request payload, or concurrent modification. |
Re-read the current state and version, then handle according to the latest result. |
500 |
|
Internal processing failed; write operations may have been partially applied. |
Retain request and trace details, and verify the current state before retrying. |
503 |
|
A business, runtime, or authorization dependency is temporarily unavailable. |
After the dependency recovers, check existing results first instead of blindly repeating writes. |