tencent cloud

Feedback

CreateDataEngine

Last updated: 2023-09-19 11:26:22

1. API Description

Domain name for API request: dlc.tencentcloudapi.com.

This API is used to create a data engine.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

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: CreateDataEngine.
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.
EngineType Yes String The engine type. Valid values: spark and presto.
DataEngineName Yes String The name of the virtual cluster.
ClusterType Yes String The cluster type. Valid values: spark_private, presto_private, presto_cu, and spark_cu.
Mode Yes Integer The billing mode. Valid values: 0 (shared engine), 1 (pay-as-you-go), and 2 (monthly subscription).
AutoResume Yes Boolean Whether to automatically start the clusters.
MinClusters No Integer The minimum number of clusters.
MaxClusters No Integer The maximum number of clusters.
CidrBlock No String The VPC CIDR block.
Message No String The description.
Size No Integer The cluster size.
PayMode No Integer The pay mode. Valid value: 0 (postpaid, default) and 1 (prepaid) (currently not available).
TimeSpan No Integer The resource period. For the postpaid mode, the value is 3600 (default); for the prepaid mode, the value must be in the range of 1–120, representing purchasing the resource for 1–120 months.
TimeUnit No String The unit of the resource period. Valid values: s (default) for the postpaid mode and m for the prepaid mode.
AutoRenew No Integer The auto-renewal status of the resource. For the postpaid mode, no renewal is required, and the value is fixed to 0. For the prepaid mode, valid values are 0 (manual), 1 (auto), and 2 (no renewal). If this parameter is set to 0 for a key account in the prepaid mode, auto-renewal applies. It defaults to 0.
Tags.N No Array of TagInfo The tags to be set for the resource being created.
AutoSuspend No Boolean Whether to automatically suspend clusters. Valid values: false (default, no) and true (yes).
CrontabResumeSuspend No Integer Whether to enable scheduled start and suspension of clusters. Valid values: 0 (disable) and 1 (enable). Note: This policy and the auto-suspension policy are mutually exclusive.
CrontabResumeSuspendStrategy No CrontabResumeSuspendStrategy The complex policy for scheduled start and suspension, including the start/suspension time and suspension policy.
EngineExecType No String The type of tasks to be executed by the engine, which defaults to SQL. Valid values: SQL and BATCH.
MaxConcurrency No Integer The max task concurrency of a cluster, which defaults to 5.
TolerableQueueTime No Integer The task queue time limit, which defaults to 0. When the actual queue time exceeds the value set here, scale-out may be triggered. Setting this parameter to 0 represents that scale-out may be triggered immediately after a task queues up.
AutoSuspendTime No Integer The cluster auto-suspension time, which defaults to 10 min.
ResourceType No String The resource type. Valid values: Standard_CU (standard) and Memory_CU (memory).
DataEngineConfigPairs.N No Array of DataEngineConfigPair The advanced configurations of clusters.
ImageVersionName No String The version name of cluster image, such as SuperSQL-P 1.1 and SuperSQL-S 3.2. If no value is passed in, a cluster is created using the latest image version.
MainClusterName No String The primary cluster, which is specified when a failover cluster is created.
ElasticSwitch No Boolean Whether to enable the scaling feature for a monthly subscribed Spark job cluster.
ElasticLimit No Integer The upper limit (in CUs) for scaling of the monthly subscribed Spark job cluster.
SessionResourceTemplate No SessionResourceTemplate The session resource configuration template for a Spark job cluster.

3. Output Parameters

Parameter Name Type Description
DataEngineId String The ID of the virtual engine.
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Creating a data engine

This example shows you how to create a data engine.

Input Example

POST / HTTP/1.1
Host: dlc.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateDataEngine
<Common request parameters>

{
    "EngineType": "spark",
    "DataEngineName": "test",
    "ClusterType": "spark",
    "MinClusters": 0,
    "MaxClusters": 0,
    "DefaultDataEngine": true,
    "CidrBlock": "10.255.255.0/16",
    "Mode": 0,
    "Message": "test",
    "AutoResume": true,
    "Size": 0,
    "PayMode": 0,
    "TimeSpan": 1,
    "TimeUnit": "h",
    "AutoRenew": 0,
    "Tags": [
        {
            "TagKey": "key",
            "TagValue": "value"
        }
    ],
    "AutoSuspend": true,
    "CrontabResumeSuspend": 0,
    "CrontabResumeSuspendStrategy": {
        "ResumeTime": "10",
        "SuspendTime": "10",
        "SuspendStrategy": 0
    },
    "EngineExecType": "BATCH",
    "MaxConcurrency": 0,
    "TolerableQueueTime": 0,
    "AutoSuspendTime": 0,
    "ResourceType": "standard_cu",
    "ImageVersionName": "SuperSQL-P 1.1"
}

Output Example

{
    "Response": {
        "DataEngineId": "DataEngine-abc123",
        "RequestId": "sd01m2-fasfki-231safas"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
FailedOperation.AbnormalOrderStatus Order status exception.
FailedOperation.AnotherCreateProcessRunning Another data source is being created.
FailedOperation.AnotherProcessRunning Another operation is in progress. Please try again later.
FailedOperation.AnotherRequestProcessing Another request is being processed. Try again later.
FailedOperation.BalanceNotEnough Insufficient account balance.
FailedOperation.BillingSystemError Billing system exception.
FailedOperation.BindTooManyTags The number of tags set reached the limit.
FailedOperation.CreateDataEngineFailed Failed to create the engine.
FailedOperation.DeliverGoodsFailed Failed to deliver the goods.
FailedOperation.DuplicateTagKey Duplicate tag keys.
FailedOperation.FeeDeductionFailed Deduction failed.
FailedOperation.GetProductInformationFailed Failed to get product information.
FailedOperation.IllegalResource Invalid resources.
FailedOperation.IllegalTagKey Invalid characters in the tag key.
FailedOperation.IllegalTagValue Invalid characters in the tag value.
FailedOperation.InquirePriceFailed Price query failed.
FailedOperation.ModifyInstanceFailed Failed to scale up/down the instance.
FailedOperation.NoPermission No permission.
FailedOperation.NoRealNameAuthentication Unverified account.
FailedOperation.NumberExceedLimit Reached the allowed limit of engines.
FailedOperation.ParameterValidationFailed Failed to verify parameters.
FailedOperation.RefundDepositFailed Refunding failed.
FailedOperation.TagAlreadyAttached A tag key of the same name has been set for the resource.
FailedOperation.TagKeyTooLong The tag key exceeded the length limit.
FailedOperation.TagNotExist The tag does not exist.
FailedOperation.TagValueTooLong The tag value exceeded the length limit.
FailedOperation.TooManyResources The number of resources reached the limit.
FailedOperation.TooManyTags The number of tags reached the limit.
InternalError An internal error occurred.
InternalError.DBError A database error occurred.
InvalidParameter.DuplicateDataEngineName Duplicate engine name.
InvalidParameter.InvalidDataEngineMode Invalid data engine mode.
InvalidParameter.InvalidDataEngineName The data engine name is invalid.
InvalidParameter.InvalidDataEngineSpecs Invalid data engine spec.
InvalidParameter.InvalidEngineType Invalid engine type.
InvalidParameter.InvalidPayMode Invalid billing mode.
InvalidParameter.InvalidTimeSpan Invalid billing period.
InvalidParameter.InvalidTimeUnit Invalid unit of billing period.
InvalidParameter.VpcCidrFormatError Invalid VPC CIDR format.
ResourceNotFound The resource does not exist.
UnauthorizedOperation.NoPaymentAuthority No permission to pay.
Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support