Domain name for API request: cls.intl.tencentcloudapi.com.
This API is used to create logs or metric topics.
A maximum of 100 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: CreateTopic. |
| Version | Yes | String | Common Params. The value used for this API: 2020-10-16. |
| Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. |
| LogsetId | Yes | String | Logset ID
|
| TopicName | Yes | String | Topic name
|
| PartitionCount | No | Integer | Topic partition count. Default creation is 1 partition. Supports a maximum of 10 partitions. |
| Tags.N | No | Array of Tag | Tag description list, by specifying this parameter, you can simultaneously bind a tag to the corresponding topic. Up to 10 tag key-value pairs are supported, and the same resource can only be bound to the same tag key. |
| AutoSplit | No | Boolean | Whether to enable auto-split, true by default |
| MaxSplitPartitions | No | Integer | When auto-split is enabled, the maximum number of partitions allowed for each topic is 50 by default. |
| StorageType | No | String | Log topic storage type. Available values: hot (standard storage), cold (infrequent storage). Default hot. This configuration is not supported for metric topics. |
| Period | No | Integer | Storage time, in days.
|
| Describes | No | String | Topic description |
| HotPeriod | No | Integer | 0: Log topic disables log settlement. |
| Encryption | No | Integer | Encryption-related parameters. Encrypted regions and allowlisted users can pass this parameter, which cannot be passed in other scenarios. Supported regions: ap-beijing, ap-guangzhou, ap-shanghai, ap-singapore, ap-bangkok, ap-jakarta, eu-frankfurt, ap-seoul, ap-tokyo |
| BizType | No | Integer | Topic type
|
| TopicId | No | String | Custom topic ID, format: custom part-User APPID. If this parameter is left empty, ID will be automatically generated.
|
| IsWebTracking | No | Boolean | Free authentication switch. False: turned off; true: turned on. Default false. |
| Extends | No | TopicExtendInfo | Topic extended information |
| IsSourceFrom | No | Boolean | Enable logging of public network source IP and server receipt time |
| BillingMode | No | Integer | Billing mode Enumeration value:
Default value: 0 |
| Parameter Name | Type | Description |
|---|---|---|
| TopicId | String | Topic ID |
| 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. |
create metric topic
POST / HTTP/1.1
Host: cls.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateTopic
<Common request parameters>
{
"LogsetId": "29ccb4c0-ab2f-47ab-9dcd-31413b057812",
"TopicName": "testname",
"BizType": 1,
"Period": 12
}
{
"Response": {
"TopicId": "6d069a26-1606-4142-9fa6-17ccee4f9bc9",
"RequestId": "c1731e60-e00d-45ee-a9e8-5343d4f38325"
}
}
Create a log topic
POST / HTTP/1.1
Host: cls.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateTopic
<Common request parameters>
{
"LogsetId": "29ccb4c0-ab2f-47ab-9dcd-31413b057812",
"TopicName": "testname",
"Period": 12
}
{
"Response": {
"TopicId": "866f8a15-ae8e-4ab4-afb2-4ff169fa3dc0",
"RequestId": "6ef60bec-0242-43af-bb20-270359fb54a7"
}
}
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. |
| FailedOperation.InvalidPeriod | The offline storage period cannot be less than 7 days. |
| FailedOperation.TopicCreating | The topic is being created. |
| InternalError | Internal error. |
| InvalidParameter | Incorrect parameter. |
| InvalidParameter.TopicConflict | There is already a log topic with the same name in the specified logset. |
| LimitExceeded | The quota limit has been reached. |
| LimitExceeded.BillingTopicOutOfLimit | A uin can only create one billing topic |
| LimitExceeded.Logset | The number of logsets exceeds the limit. |
| LimitExceeded.Topic | The number of log topics exceeds the limit. |
| MissingParameter | Missing parameter. |
| OperationDenied | Operation denied. |
| OperationDenied.AccountDestroy | The account has been terminated. |
| OperationDenied.AccountIsolate | The account has overdue payments. |
| OperationDenied.AccountNotExists | The account does not exist. |
| ResourceNotFound.LogsetNotExist | The specified logset does not exist. |
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback