Domain name for API request: ckafka.intl.tencentcloudapi.com.
This API is used to replace CreateInstancePost to create a pay-as-you-go instance. 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.
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: CreatePostPaidInstance. |
| 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. |
| VpcId | Yes | String | VPC Id, can be obtained through the DescribeVpcs api. . |
| SubnetId | Yes | String | Subnet Id, which can be obtained through the DescribeSubnets api. . |
| InstanceName | No | String | Specifies the cluster instance name of ckafka, with a length not exceeding 128 arbitrary characters. . |
| InstanceType | No | Integer | Specifies the standard edition instance specification for the international site. currently only the standard edition on the international site uses the current field to distinguish specifications, while the domestic site standard edition uses peak bandwidth. fill in 1 for all instances except the international site standard edition. for international site standard edition instances: [entry-level (general)] fill 1; [standard type (standard)] fill 2; [advanced] fill 3; [capacity type (capacity)] fill 4; [advanced type 1 (specialized-1)] fill 5; [advanced type 2 (specialized-2)] fill 6; [advanced type 3 (specialized-3)] fill 7; [advanced type 4 (specialized-4)] fill 8. . |
| MsgRetentionTime | No | Integer | The default maximum retention time for instance logs, in minutes. default value: 1440 minutes (1 day) when this parameter is not input. maximum: 30 days. if the message retention time is explicitly set for a topic, the topic retention time takes precedence. . |
| ClusterId | No | Integer | Specifies the cluster Id when creating an instance. input this parameter to indicate the cluster Id. leave it empty if no cluster is specified. . |
| KafkaVersion | No | String | Instance version. currently supports "2.4.1", "2.4.2", "2.8.1", "3.2.3". default value is "2.4.1". "2.4.1" and "2.4.2" belong to the same version, any one can be passed. . |
| SpecificationsType | No | String | Instance type. "standard": standard version, "profession": professional version. (standard version is only supported on the international site. chinese site currently supports professional version) . |
| DiskType | No | String | Specifies the instance disk type for pro edition. standard edition instances do not require this field. valid values: "CLOUD_SSD" (SSD CLOUD disk), "CLOUD_BASIC" (high-performance CLOUD block storage). default value: "CLOUD_BASIC". . |
| BandWidth | No | Integer | The peak bandwidth of the instance private network. the default value is 40 MB/s. for standard edition, input the peak bandwidth corresponding to the current instance specifications. note that if the instance created is a pro edition instance, parameter configurations such as peak bandwidth and number of partitions should meet the billing specification of the pro edition. you can view the billing specification through the following link: https://www.tencentcloud.com/document/product/597/11745.?from_cn_redirect=1 . |
| DiskSize | No | Integer | Instance disk size. default value is 500. step length is set to 100. should meet the billing specification of the current instance. can be accessed through the following link to view billing specifications: https://www.tencentcloud.com/document/product/597/122562.?from_cn_redirect=1 . |
| Partition | No | Integer | Specifies the maximum number of partitions for the instance, which should meet the billing specification of the current instance. default value is 800 with a step length of 100. the billing specification can be viewed through the following link: https://www.tencentcloud.com/document/product/597/122563.?from_cn_redirect=1 . |
| TopicNum | No | Integer | Specifies the maximum number of topics for the instance, which should meet the billing specification of the current instance. default value is 800. step length is set to 100. . |
| ZoneId | No | Integer | Specifies the availability zone where the instance is located. when creating a multi-az instance, this parameter indicates the availability zone id of the subnet where the default access point is created. ZoneId and ZoneIds cannot be empty at the same time. you can obtain this information through the API DescribeCkafkaZone. |
| MultiZoneFlag | No | Boolean | Specifies whether the current instance is a multi-az instance. . |
| ZoneIds.N | No | Array of Integer | Specifies the multi-availability zone id list when the instance is a multi-az instance. note the corresponding multi-availability zone for parameter ZoneId must be included in the parameter array. ZoneId and ZoneIds cannot be empty at the same time. obtain through the API DescribeCkafkaZone. . |
| InstanceNum | No | Integer | Specifies the number of instances to purchase. optional. default value is 1. when input this parameter, it will create multiple instances with case-sensitive suffixes added to instanceName. . |
| PublicNetworkMonthly | No | Integer | Public bandwidth size in Mbps. the free 3 Mbps bandwidth is not included by default. for example, if the total required public network bandwidth is 3 Mbps, input 0 here; if the total required public network bandwidth is 6 Mbps, input 3 here. ensure the input parameter is a multiple of 3. . |
| Tags.N | No | Array of Tag | Tag. . |
| ElasticBandwidthSwitch | No | Integer | Specifies the elastic bandwidth switch. 0: disable (default); 1: enable. . |
| CustomSSLCertId | No | String | Specifies the custom certificate Id. this parameter is valid only when SpecificationsType is profession. supports custom certificate capacity. can be obtained through the DescribeCertificateDetail api. . |
| Parameter Name | Type | Description |
|---|---|---|
| Result | CreateInstancePostResp | Returned result. . |
| RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
This example shows you how to create a post-payment for professional edition instance with 200GB disk capacity and 20MB/s peak bandwidth.
POST / HTTP/1.1
Host: ckafka.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreatePostPaidInstance
<Common request parameters>
{
"InstanceName": "test55",
"VpcId": "vpc-rmcgxxxx",
"SubnetId": "subnet-mnzcxxxx",
"ZoneId": 450001,
"InstanceType": 1,
"KafkaVersion": "2.4.2",
"SpecificationsType": "profession",
"DiskSize": 200,
"BandWidth": 20,
"Partition": 400,
"DiskType": "CLOUD_BASIC",
"PublicNetworkMonthly": 0,
"CustomSSLCertId": "TPNd2oBB"
}{
"Response": {
"RequestId": "323c3bbe-db79-48c3-9b76-63aacd65b169",
"Result": {
"Data": {
"DealNameInstanceIdMapping": [
{
"DealName": "20230608002033899990000",
"InstanceIdList": [
"ckafka-mom5xxxx"
]
}
],
"DealNames": [
"2023060800203389990000"
],
"FlowId": 0,
"InstanceId": "ckafka-mom5xxxx"
},
"ReturnCode": "0",
"ReturnMessage": "ok[apply ok]"
}
}
}
This example shows you how to create a triple-az Pro Edition instance.
POST / HTTP/1.1
Host: ckafka.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreatePostPaidInstance
<Common request parameters>
{
"InstanceName": "test55",
"VpcId": "vpc-rmcgxxxx",
"SubnetId": "subnet-mnzcxxxx",
"ZoneId": 450001,
"InstanceType": 1,
"KafkaVersion": "2.4.2",
"SpecificationsType": "profession",
"DiskSize": 200,
"BandWidth": 20,
"Partition": 400,
"DiskType": "CLOUD_BASIC",
"PublicNetworkMonthly": 0,
"MultiZoneFlag": true,
"ZoneIds": [
450001,
450002,
450003
]
}{
"Response": {
"RequestId": "323c3bbe-db79-48c3-9b76-63aacd65b169",
"Result": {
"Data": {
"DealNameInstanceIdMapping": [
{
"DealName": "20230608002033899990000",
"InstanceIdList": [
"ckafka-mom5xxxx"
]
}
],
"DealNames": [
"2023060800203389990000"
],
"FlowId": 0,
"InstanceId": "ckafka-mom5xxxx"
},
"ReturnCode": "0",
"ReturnMessage": "ok[apply ok]"
}
}
}
This example shows you how to create three postpaid Pro Edition instances simultaneously.
POST / HTTP/1.1
Host: ckafka.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreatePostPaidInstance
<Common request parameters>
{
"InstanceName": "test58",
"VpcId": "vpc-rmcg5cpf",
"SubnetId": "subnet-mnzcs7gk",
"KafkaVersion": "2.4.2",
"SpecificationsType": "profession",
"BandWidth": 20,
"DiskSize": 200,
"Partition": 400,
"TopicNum": 200,
"ZoneId": 450001,
"InstanceNum": 3,
"PublicNetworkMonthly": 12
}{
"Response": {
"RequestId": "cda79237-6424-482a-b2d2-97d4853b33b4",
"Result": {
"Data": {
"DealNameInstanceIdMapping": [
{
"DealName": "20230608002033915320000",
"InstanceIdList": [
"ckafka-bz4dxxxx",
"ckafka-o9gdxxxx",
"ckafka-aj5gxxxx"
]
}
],
"DealNames": [
"20230608002033915320000"
],
"FlowId": 0,
"InstanceId": "ckafka-bz4dxxxx"
},
"ReturnCode": "0",
"ReturnMessage": "ok[apply ok]"
}
}
}
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 |
|---|---|
| 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. |
Feedback