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.

HTTP
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.

  1. Prepare personal access token and target workspace ID that can access the target workspace.

  2. Determine the data source type and purpose according to Data source type description.

  3. 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

config.kafka.bootstrap_servers

string

Required when connecting

Kafka address list.

config.kafka.security_protocol

string

Required when connecting

One of the four protocols mentioned above.

config.kafka.ssl_ca_certificate

string

No

PEM CA certificate, only available for SSL or SASL_SSL.

config.kafka.sasl_mechanism

string

Conditional

Under the SASL protocol, fill in PLAIN, SCRAM-SHA-256 or SCRAM-SHA-512.

config.kafka.sasl_username

string

Conditional

SASL username.

config.kafka.sasl_password

string

Conditional

SASL password to protect submissions and connection configuration.

config.kafka.schema_registry_url

string

No

Schema Registry address.

config.kafka.schema_registry_api_key

string

No

Schema Registry API Key。

config.kafka.schema_registry_api_secret

string

No

Schema Registry API Secret。

The following example saves the PLAINTEXT connection configuration without checking connectivity.

Shell
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

config.doris.host

string

Yes

Doris host.

config.doris.port

integer

Yes

SQL port, 1–65535.

config.doris.ssl_mode

string

Yes

DISABLED or REQUIRED.

config.doris.fe_http_protocol

string

Yes

HTTP or HTTPS.

config.doris.fe_http_port

integer

Yes

FE HTTP port, 1–65535.

config.doris.fe_flight_sql_port

integer

No

FE Flight SQL port.

config.doris.username

string

Yes

Doris username.

config.doris.password

string

Yes

Doris password to protect submissions and connection configurations.

config.doris.database

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.

Shell
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

1

Open configuration object, currently there is no dedicated path configuration verification.

Kafka

15

kafka

Doris

16

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

Shell
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

Shell
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

Shell
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

Shell
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

Shell
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

Shell
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

Shell
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

Shell
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

Shell
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

Shell
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

Shell
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

Shell
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

name

string

Yes

Connector name. It cannot have leading or trailing blanks and cannot be empty. Cannot contain half-width spaces, < or >.

source_type

integer

Yes

Data source type code. Standard S3 fills in 5, and the configuration is written in config.s3. Data source type code. Alibaba Cloud OSS fills in 4, and the configuration is written in config.oss. Data source type code. OmniFabric fills in 3, and the configuration is written in config.mo. Data source type code. Fill in 7 for HDFS, and write the configuration in config.hdfs. Data source type code. Hive fills in 8, and the configuration is written in config.hive. Data source type code. For MySQL, fill in 9, and write the configuration in config.mysql. Data source type code. Fill in 10 for SQL Server and config.sqlserver for configuration. Data source type code. Oracle fills in 11, and the configuration is written in config.oracle. Data source type code. For PostgreSQL, fill in 12, and write the configuration in config.postgresql. Data source type code. For MongoDB, fill in 13, and write the configuration in config.mongodb.

usage_type

integer or array of integer

Yes

Connector purpose. [1] only imports, [2] only exports, and [1, 2] supports both. Required when creating. Connector purpose. OmniFabric only supports export, fill in 2 or [2].

config

object

Yes

Connection information. Only fill in a set of configuration objects corresponding to source_type.

config.s3.endpoint

string

No

S3 service address. If not filled in, the default address of the S3 service is used.

config.s3.access_key_id

string

Yes

Access key ID.

config.s3.access_key_secret

string

Yes

Access key.

config.s3.bucket_name

string

Yes

Bucket name. Can be written as bucket name/prefix, such as orders/import.

config.s3.region

string

No

The region where the bucket is located.

config.s3.session_token

string

No

The session token filled in when using temporary credentials.

config.s3.path_style

boolean

No

Use the path style address when filling in true. Use virtual host style address when omitting or filling in false.

config.oss.endpoint

string

Yes

OSS service address.

config.oss.access_key_id

string

Yes

AccessKey ID。

config.oss.access_key_secret

string

Yes

AccessKey Secret。

config.oss.bucket_name

string

Yes

Bucket name. Can be written as bucket name/prefix, such as orders/import.

config.mo.host

string

Yes

OmniFabric service address.

config.mo.port

integer

Yes

OmniFabric service port.

config.mo.username

string

Yes

Login username.

config.mo.password

string

Yes

Login password.

config.mo.database

string

No

Default database name.

config.hdfs.address

string

Yes

NameNode address, can be prefixed with hdfs://.

config.hdfs.auth_type

integer

Yes

Authentication type: Simple for 0, Kerberos for 1. For Simple certification, fill in 0. Fill in 1.

config.hdfs.username

string

Required when Simple

HDFS username used for Simple authentication.

config.hdfs.file_path

string

Yes

An HDFS base directory accessible to the connector, for example /data/orders. The HDFS base directory accessible to the connector.

config.hdfs.kerberos_principal

string

Yes

Kerberos client principal.

config.hdfs.service_principal

string

Yes

HDFS service principal.

config.hdfs.keytab_content

string (Base64 encoding)

Conditional

During Kerberos authentication, the required Keytab content when keytab_file is not provided.

config.hdfs.krb5_conf_content

string (Base64 encoding)

Conditional

During Kerberos authentication, the required krb5.conf content is not provided when krb5_conf_file is not provided.

config.hdfs.proxy_user

string

No

The proxy user to use after logging in.

config.hive.addresses

array of string

Yes

HiveServer2 address list. Fill in at least one host:port. HiveServer2 address list, fill in at least one host:port.

config.hive.auth_type

integer

Yes

Authentication type: 0 is LDAP, 1 is Kerberos. For LDAP authentication, fill in 0. Fill in 1.

config.hive.username

string

Required for LDAP

LDAP username.

config.hive.password

string

Required for LDAP

LDAP password.

config.hive.client_principal

string

Yes

The user principal used to log in.

config.hive.service_principal

string

Yes

HiveServer2 service principal.

config.hive.keytab_data

string

Yes

Keytab content.

config.hive.krb5_conf_data

string

Yes

krb5.conf content.

config.mysql.host

string

Yes

MySQL database host address.

config.mysql.port

integer

Yes

MySQL database port.

config.mysql.username

string

Yes

Login username.

config.mysql.password

string

Yes

Login password.

config.mysql.database

string

Yes

The name of the database to connect to. The connector only browses and imports the database after it is created.

config.sqlserver.host

string

Yes

SQL Server database host address.

config.sqlserver.port

integer

Yes

SQL Server database port.

config.sqlserver.username

string

Yes

Login username.

config.sqlserver.password

string

Yes

Login password.

config.sqlserver.database

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.

config.oracle.host

string

Yes

Oracle host address.

config.oracle.port

integer

Yes

Oracle port.

config.oracle.username

string

Yes

Login username.

config.oracle.password

string

Yes

Login password.

config.oracle.service_name

string

Yes

Oracle service name to connect to.

config.postgresql.host

string

Yes

PostgreSQL host address.

config.postgresql.port

integer

Yes

PostgreSQL port.

config.postgresql.username

string

Yes

Login username.

config.postgresql.password

string

Yes

Login password.

config.postgresql.database

string

Yes

The name of the database to connect to. The connector only browses and imports the database after it is created.

config.mongodb.host

string

Yes

MongoDB host address.

config.mongodb.port

integer

Yes

MongoDB port.

config.mongodb.authMode

string

Yes

Authentication method: userpass is user name and password authentication, none is non-authentication.

config.mongodb.user

string

Required when authMode is userpass

authMode is the login username when userpass.

config.mongodb.password

string

No

authMode is the login password when userpass.

config.mongodb.authSource

string

Required when authMode is userpass

When authMode is userpass, the database name of the authenticated user is saved, for example, admin.

config.mongodb.replicaSet

string

No

Replica set name.

config.mongodb.readPreference

string

No

Read node preference, optional primary, primaryPreferred, secondary, secondaryPreferred or nearest.

config.mongodb.readConcern

string

No

Read consistency level, optional majority or snapshot.

Successful response

JSON
{
  "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

code

string

OK on success.

msg

string

OK on success.

data

object

Saved connector.

data.id

string

New connector ID.

data.name

string

Saved connector name.

data.source_type

integer

Saved data source type code.

data.created_at

integer

Unix timestamp of creation time.

data.updated_at

integer

Unix timestamp of the time of update.

data.status

string

Current connector status. After creation, it is active, which does not mean that the connectivity has been verified.

data.username

string

The name of the user who created this connector.

data.related_task_ids

array of string

Associated import task ID list. It is an empty array when creating a new connector.

data.usage_type

integer (integer array)

List of saved uses: [1] import only, [2] export only, [1, 2] supports both.

data.config

object

Saved connection configuration object. The object structure is determined by source_type.

Error response

JSON
{
  "code": "ErrParamInvalid",
  "msg": "invalid connector parameters"
}

Field

Type

Description

code

string

error code.

msg

string

Readable error message.

Common HTTP errors

HTTP status

Error code

Common cause

Recommended action

400

ErrParamInvalid, ErrWorkspaceRequired

Invalid request field, workspace, or operation precondition.

Fix the request parameters and submit again.

401

Unauthorized, ErrServiceUnavailable, ErrIAMExplicitRoleInvalid

Missing or invalid authentication credentials.

Check the credential type, expiration, and authentication header.

403

ErrForbidden

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

ErrNotFound

The target object or required reference was not found.

Verify the object identifier, workspace, and current status.

409

ErrAlreadyExists, ErrConnectorInUse

Conflict in resource state, request payload, or concurrent modification.

Re-read the current state and version, then handle according to the latest result.

500

ErrServer

Internal processing failed; write operations may have been partially applied.

Retain request and trace details, and verify the current state before retrying.

503

ErrServiceUnavailable

A business, runtime, or authorization dependency is temporarily unavailable.

After the dependency recovers, check existing results first instead of blindly repeating writes.

Last updated on