Domain name for API request: ckafka.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. |
InstanceName | No | String | Instance name, which is a string of up to 64 letters, digits, and hyphens (-). It must start with a letter. |
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. standard (Standard Edition), profession (Pro Edition) |
DiskType | No | String | Instance disk type. CLOUD_BASIC (Premium Cloud Storage), CLOUD_SSD (SSD). If this parameter is left empty, the default value CLOUD_BASIC will be used. |
BandWidth | No | 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. |
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. |
Parameter Name | Type | Description |
---|---|---|
Result | CreateInstancePostResp | Returned result |
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 a pay-as-you-go Pro Edition instance, with the peak bandwidth being 20 MB/sec and disk capacity being 200 GB.
POST / HTTP/1.1Host: ckafka.tencentcloudapi.comContent-Type: application/jsonX-TC-Action: CreatePostPaidInstance<Common request parameters>{ "InstanceName": "test55", "VpcId": "vpc-rmcgxxxx", "SubnetId": "subnet-mnzcxxxx", "ZoneId": 450001, "InstanceType": 1, "KafkaVersion": "1.1.1", "SpecificationsType": "profession", "DiskSize": 200, "BandWidth": 20, "Partition": 400, "DiskType": "CLOUD_BASIC", "PublicNetworkMonthly": 0}
{
"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 pay-as-you-go Pro Edition instances at a time.
POST / HTTP/1.1Host: ckafka.tencentcloudapi.comContent-Type: application/jsonX-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]"
}
}
}
This example shows you how to create a Pro Edition instance across three AZs.
POST / HTTP/1.1Host: ckafka.tencentcloudapi.comContent-Type: application/jsonX-TC-Action: CreatePostPaidInstance<Common request parameters>{ "InstanceName": "test55", "VpcId": "vpc-rmcgxxxx", "SubnetId": "subnet-mnzcxxxx", "ZoneId": 450001, "InstanceType": 1, "KafkaVersion": "1.1.1", "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]"
}
}
}
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. |
Was this page helpful?