Query the connector table structure¶
Reads the field structure and mapping reference of the selected source object.
POST $CLOUDSIGMA_API_BASE/connectors/structured/v1/source/schema
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 a personal access token and target workspace ID that can access the target workspace. Obtain the identifier of the same source object in the following order:
Query the connector that supports database browsing.
When the source supports Schema, Query the Schema list of the source database.
Request body¶
Replace the source object IDs in $CLOUDSIGMA_API_KEY, $WORKSPACE_ID, and examples with actual values.
relational table
curl -X POST "$CLOUDSIGMA_API_BASE/connectors/structured/v1/source/schema" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d @- <<EOF
{
"connector_id": "$CONNECTOR_ID",
"source": {
"connector_id": "$CONNECTOR_ID",
"source_type": "$SOURCE_TYPE",
"database": "$DATABASE",
"schema": "$SCHEMA",
"table": "$TABLE"
}
}
EOF
MongoDB collection
curl -X POST "$CLOUDSIGMA_API_BASE/connectors/structured/v1/source/schema" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d @- <<EOF
{
"connector_id": "$CONNECTOR_ID",
"source": {
"connector_id": "$CONNECTOR_ID",
"source_type": "SOURCE_TYPE_MONGODB",
"database": "$DATABASE",
"collection": "$COLLECTION"
},
"mongo_sample_limit": 100
}
EOF
schema is required for PostgreSQL, SQLServer and Oracle. schema, collection must be empty for MySQL, Hive and Doris. MongoDB’s schema, table must be empty. Although Kafka has description and sampling capability records, it is currently unable to fully query the field structure.
MongoDB must fill in the sampling upper limit of 1–100. The returned fields are inferred based on the sample of find().limit(n) and may not contain all fields in the collection.
relational table
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Connector ID. |
|
object |
Yes |
source object. MongoDB source object. |
|
string |
Yes |
Same as the top-level connector ID. |
|
string |
Yes |
Source type. Source type. The values are |
|
string |
Yes |
Database name. |
|
string |
Conditional |
PostgreSQL, SQLServer, Oracle required. MySQL, Hive, Doris, MongoDB do not allow non-null values. |
|
string |
Yes |
Table name. |
|
string |
No |
Table name. |
|
string |
Conditional |
Required collection name for MongoDB branches. Relational branches do not accept non-null values. |
|
integer |
Conditional |
The MongoDB branch must be provided in the range 1–100. |
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": {
"schema_snapshot": {
"source": {},
"schema_kind": "columns"
},
"mapping_draft": [],
"target_type_catalog": [],
"field_compatibilities": [],
"source_schema_hash": "schema-hash",
"source_object_hash": "object-hash",
"connector_config_hash": "connector-hash",
"mapping_hash": "mapping-hash",
"flatten_hash": "flatten-hash",
"endpoint_results": []
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
success code. |
|
string |
Response information. |
|
object |
The data returned by this operation. |
|
object |
Source field structure. |
|
object |
Structured source positioning. |
|
string |
Association ID. |
|
string or integer |
Source type. |
|
string |
Database name. |
|
string |
Database schema name. |
|
string |
Table name. |
|
string |
MongoDB collection name. |
|
array of object |
Relational columns. |
|
string |
The name of the current object. |
|
string |
Source type. |
|
boolean |
Whether to allow null values. |
|
boolean |
Whether it is the primary key. |
|
boolean |
Whether to increment automatically. |
|
string |
Field description. |
|
integer |
serial number. |
|
boolean |
Whether it is an unsigned number. |
|
string |
Source identification. |
|
array of object |
MongoDB inferred fields. |
|
object |
Field path. |
|
array of object |
Field path segments. |
|
string |
The name of the current object. |
|
string |
Path segment type. |
|
array of string |
The observed BSON type. |
|
string |
Recommended target type. |
|
boolean |
Whether to allow null values. |
|
integer |
The number of samples in which the field was observed. |
|
integer |
Number of samples with missing fields. |
|
integer |
The number of samples where the field is null. |
|
string |
Extended JSON sample. |
|
string |
Snapshot type. The values are |
|
array of object |
Candidate mapping. |
|
object |
Structured source positioning. |
|
string |
Resource type. |
|
string |
Column positioning. |
|
object |
MongoDB field path. |
|
array of object |
Field path segments. |
|
string |
The name of the current object. |
|
string |
Path segment type. |
|
string |
Source type. |
|
integer |
Source serial number. |
|
object |
Extended string property objects allow extended keys. |
|
boolean |
Whether to include the source serial number. |
|
string |
Target column name. |
|
string |
Target type. |
|
boolean |
Whether to allow null values. |
|
boolean |
Whether it is the primary key. |
|
boolean |
Whether duplicate sources are allowed. |
|
string |
Default value. |
|
string |
Description of the current object. |
|
boolean |
Whether to provide a default value. |
|
array of object |
Target type directory. |
|
string |
Target type. |
|
string |
classification. |
|
array of object |
model parameters. |
|
string |
The name of the current object. |
|
integer |
minimum value. |
|
integer |
maximum value. |
|
integer |
Default value. |
|
string |
The source parameter of the maximum value. |
|
array of object |
Field compatibility reference. |
|
object |
Structured source positioning. |
|
string |
Resource type. |
|
string |
Column positioning. |
|
object |
MongoDB field path. |
|
array of object |
Field path segments. |
|
string |
The name of the current object. |
|
string |
Path segment type. |
|
string |
Source type. |
|
integer |
Source serial number. |
|
object |
Extended string property objects allow extended keys. |
|
boolean |
Whether to include the source serial number. |
|
string |
Recommended target type. |
|
array of object |
Optional target compatibility scheme. |
|
string |
Target type. |
|
string |
status. |
|
string |
Reason code. |
|
object |
Compatibility plan selected. |
|
string |
Target type. |
|
string |
status. |
|
string |
Reason code. |
|
string |
Field structure identifier. |
|
string |
Source object identifier. |
|
string |
Connector configuration identifier. |
|
string |
Mapping reference identifier. |
|
string |
Flat reference mark. |
|
array |
Reserve result sets. |
Error response¶
{
"code": "ErrParamInvalid",
"msg": "invalid parameter",
"data": null
}
Field |
Type |
Description |
|---|---|---|
|
string |
error code. |
|
string |
error message. |
|
null |
The error response is |
Common HTTP errors¶
HTTP status |
Error code |
Common cause |
Recommended action |
|---|---|---|---|
200 |
|
Business processing did not succeed; an HTTP 2xx status does not guarantee business success. |
Inspect the business code and feature flags instead of relying on the HTTP status alone. |
400 |
|
Invalid request field, workspace, or operation precondition. |
Fix the request parameters and submit again. |
500 |
|
Internal processing failed; write operations may have been partially applied. |
Retain request and trace details, and verify the current state before retrying. |