Domain name for API request: dlc.tencentcloudapi.com.
This API is used to create and execute SQL tasks in batches.
A maximum of 20 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
Parameter Name | Required | Type | Description |
---|---|---|---|
Action | Yes | String | Common Params. The value used for this API: CreateTasks. |
Version | Yes | String | Common Params. The value used for this API: 2021-01-25. |
Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. |
DatabaseName | Yes | String | Database name. If there is a database name in the SQL statement, the database in the SQL statement will be used first; otherwise, the database specified by this parameter will be used (note: when submitting the database creation SQL statement, passed in an empty string for this field). |
Tasks | Yes | TasksInfo | SQL task information |
DatasourceConnectionName | No | String | Data source name. Default value: DataLakeCatalog. |
DataEngineName | No | String | Compute engine name. If this parameter is not specified, the task will be submitted to the default engine. |
Parameter Name | Type | Description |
---|---|---|
BatchId | String | ID of the current batch of submitted tasks |
TaskIdSet | Array of String | Collection of task IDs arranged in order of execution |
RequestId | String | The unique request ID, which is returned for each request. RequestId is required for locating a problem. |
This example shows you how to create and execute SQL tasks in batches.
POST / HTTP/1.1
Host: dlc.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateTasks
<Common request parameters>
{
"Tasks": {
"TaskType": "SQLTask",
"SQL": "U0VMRUNUICogRlJPTSBgdGVzdGh5d2AuYHRlc3QxMDBtYCBMSU1JVCAxMDs=",
"Config": [
{
"Key": "",
"Value": ""
}
],
"FailureTolerance": "Proceed"
},
"DatabaseName": "testdb",
"DatasourceConnectionName": "DataLakeCatalog"
}
{
"Response": {
"BatchId": "batch-45nyt3ee",
"RequestId": "b577857e-041f-46c7-b5cf-4b3d3f50bc51",
"TaskIdSet": [
"e9663251-3a14-423a-b003-13c77c3fae11"
]
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
Error Code | Description |
---|---|
InternalError | An internal error occurred. |
InternalError.DBError | A database error occurred. |
InvalidParameter | The parameter is incorrect. |
InvalidParameter.InvalidDataEngineName | The data engine name is invalid. |
InvalidParameter.InvalidFailureTolerance | The fault tolerance policy is invalid. |
InvalidParameter.InvalidSQL | SQL parsing failed. |
InvalidParameter.InvalidSQLNum | The number of SQL statements does not meet the specification. |
InvalidParameter.InvalidStoreLocation | The storage location is incorrect. |
InvalidParameter.InvalidTaskType | The task type is invalid. |
ResourceNotFound | The resource does not exist. |
ResourceNotFound.ResultOutputPathNotFound | The result path was not found. |
ResourceUnavailable.BalanceInsufficient | The account balance is insufficient to run the SQL task. |
UnauthorizedOperation.UseComputingEngine | The sub-user does not have permission to use the compute engine. |
Was this page helpful?