tencent cloud

文档反馈

CreateInstancePost

最后更新时间:2023-07-05 15:57:47

1. API Description

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

This API is used to create a pay-as-you-go instance. It will be deprecated in future versions. We recommend that you use the CreatePostPaidInstance API instead. You can call this API via SDK or the TencentCloud API console to create a pay-as-you-go CKafka instance, which is an alternate option for making a purchase in the console.

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: CreateInstancePost.
Version Yes String Common Params. The value used for this API: 2019-08-19.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
InstanceName Yes String Instance name, which is a string of up to 64 characters. It can contain letters, digits, and hyphens (-) and must start with a letter.
BandWidth Yes Integer Private network peak bandwidth of an instance in MB/sec. If you create a Standard Edition instance, pass in the corresponding peak bandwidth for the current instance specification. If you create a Pro Edition instance, configure the peak bandwidth, partition count, and other parameters as required by Pro Edition.
VpcId No String ID of the VPC where the default access point of the created instance resides. This parameter is required as instances cannot be created in the classic network currently.
SubnetId No String ID of the subnet where the default access point of the created instance resides.
InstanceType No Integer Instance specification. This parameter is required for a Standard Edition instance but not for a Pro Edition instance. Valid values: 1 (Small), 2 (Standard), 3 (Advanced), 4 (Large), 5 (Xlarge L1), 6 (Xlarge L2), 7 (Xlarge L3), 8 (Xlarge L4),
MsgRetentionTime No Integer The maximum instance log retention period in minutes by default. If this parameter is left empty, the default retention period is 1,440 minutes (1 day) to 30 days. If the message retention period of the topic is explicitly set, it will prevail.
ClusterId No Integer Cluster ID, which can be selected when you create an instance. You don’t need to pass in this parameter if the cluster where the instance resides is not specified.
KafkaVersion No String Instance version. Valid values: 0.10.2, 1.1.1, 2.4.2, and 2.8.1.
SpecificationsType No String Instance type. Valid values: standard (Standard Edition), profession (Pro Edition)
DiskType No String Instance disk type. Valid values: CLOUD_BASIC (Premium Cloud Storage), CLOUD_SSD (SSD). If this parameter is left empty, the default value CLOUD_BASIC will be used.
DiskSize No Integer Instance disk size, which must meet the requirement of the instance’s specification.
Partition No Integer The maximum number of partitions of the instance, which must meet the requirement of the instance’s specification.
TopicNum No Integer The maximum number of topics of the instance, which must meet the requirement of the instance’s specification.
ZoneId No Integer AZ of the instance. When a multi-AZ instance is created, the value of this parameter is the AZ ID of the subnet where the instance’s default access point resides.
MultiZoneFlag No Boolean Whether the current instance is a multi-AZ instance
ZoneIds.N No Array of Integer This parameter indicates the list of AZ IDs when the instance is deployed in multiple AZs. Note that ZoneId must be included in the array of this parameter.
InstanceNum No Integer The number of purchased instances. Default value: 1. This parameter is optional. If it is passed in, multiple instances will be created, with their names being instanceName plus different suffixes.
PublicNetworkMonthly No Integer Public network bandwidth in Mbps. The 3 Mbps of free bandwidth is not included here by default. For example, if you need 3 Mbps of public network bandwidth, pass in 0; if you need 6 Mbps, pass in 3. The value must be an integer multiple of 3.

3. Output Parameters

Parameter Name Type Description
Result JgwOperateResponse Returned result
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Creating a Pro Edition instance

This example shows you how to create a Pro Edition instance, with the peak bandwidth being 20 MB/sec and disk capacity being 200 GB.

Input Example

POST / HTTP/1.1Host: ckafka.tencentcloudapi.comContent-Type: application/jsonX-TC-Action: CreateInstancePost<Common request parameters>{    "InstanceName": "test45",    "VpcId": "vpc-xxxxxxxx",    "SubnetId": "subnet-xxxxxxxx",    "KafkaVersion": "2.4.2",    "SpecificationsType": "profession",    "DiskType": "CLOUD_BASIC",    "BandWidth": 20,    "DiskSize": 200,    "Partition": 400,    "TopicNum": 200,    "ZoneId": 450001}

Output Example

{
    "Response": {
        "RequestId": "9432af9d-8c3e-4474-b5eb-0f5298dbb6e5",
        "Result": {
            "Data": {
                "FlowId": 0
            },
            "ReturnCode": "0",
            "ReturnMessage": "ok[apply ok]"
        }
    }
}

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 Operation failed.
InternalError Internal error.
InvalidParameter Invalid parameter.
InvalidParameterValue.InstanceNotExist The instance does not exist.
InvalidParameterValue.NotAllowedEmpty The parameter is required.
InvalidParameterValue.RepetitionValue The parameter already exists.
InvalidParameterValue.SubnetIdInvalid Invalid subnet ID.
InvalidParameterValue.SubnetNotBelongToZone The subnet is not in the zone.
InvalidParameterValue.VpcIdInvalid Invalid VPC ID.
InvalidParameterValue.WrongAction The value of the Action parameter is incorrect.
InvalidParameterValue.ZoneNotSupport The zone is not supported.
ResourceUnavailable The resource is unavailable.
UnauthorizedOperation Unauthorized operation.
UnsupportedOperation.BatchDelInstanceLimit The batch instance deletion limit is reached.
UnsupportedOperation.OssReject Oss rejected the operation.
联系我们

联系我们,为您的业务提供专属服务。

技术支持

如果你想寻求进一步的帮助,通过工单与我们进行联络。我们提供7x24的工单服务。

7x24 电话支持