tencent cloud

APIs

ModifyTopicAttributes

Download
聚焦模式
字号
最后更新时间: 2026-05-12 20:08:02

1. API Description

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

This API is used to modify topic attributes.

A maximum of 100 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: ModifyTopicAttributes.
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.
InstanceId Yes String

ckafka cluster instance Id

For reference: DescribeInstances

TopicName Yes String

Topic name

Note No String

Topic remark

Input parameter limit: no more than 64 characters

Default value: ""

EnableWhiteList No Integer

IP allowlist switch, 1: on; 0: off.

MinInsyncReplicas No Integer

Minimum sync replica count

Default value: 1

Minimum value: 1

UncleanLeaderElectionEnable No Integer

Whether to allow unsynchronized replicas to be elected as leader

Enumeration value:

  • 0: Not allowed
  • 1: Allowed

Default value: 0

RetentionMs No Integer

Duration of Segment shard scrolling

Unit: ms

Default value: 86400000

Minimum value: 86400000ms (1 day)

MaxMessageBytes No Integer

Maximum topic messages

Value ranges from 1024 to 12582912

Unit: Bytes

SegmentMs No Integer

Duration of Segment fragment scrolling

Unit: ms

Minimum value: 86400000ms (1 day)

CleanUpPolicy No String

Message deletion strategy: choose delete or compact

IpWhiteList.N No Array of String

Ip whitelist, Quota limit, essential when enableWhileList=1

EnableAclRule No Integer

Preset ACL rule, 1: on 0: off, default is off

AclRuleName No String

ACL rule name

RetentionBytes No Integer

Option, retain file size

Value ranges from [1073741824, 1099511627776]

Unit: Bytes

Default value: -1

Special value: -1 indicates unlimited

Tags.N No Array of Tag

Tag list

QuotaProducerByteRate No Integer

Production traffic throttling in MB/s. Set to -1 for unlimited production traffic throttling.

QuotaConsumerByteRate No Integer

Consumption throttling, unit MB/s; set to -1 for unlimited consumption throttling.

ReplicaNum No Integer

topic replica count Minimum value: 1, Maximum value: 3

LogMsgTimestampType No String

Time type for message saving: CreateTime/LogAppendTime

3. Output Parameters

Parameter Name Type Description
Result JgwOperateResponse

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.

4. Example

Example1 Setting Topic Properties

Input Example

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

{
    "InstanceId": "ckafka-test",
    "Note": "note",
    "TopicName": "topic-test"
}

Output Example

{
    "Response": {
        "Result": {
            "ReturnCode": "0",
            "ReturnMessage": "ok",
            "Data": {
                "FlowId": 0,
                "RouteDTO": {
                    "RouteId": 0
                }
            }
        },
        "RequestId": "fcfb7c89-3973-44f1-9a3e-a2811c67434e"
    }
}

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.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.

帮助和支持

本页内容是否解决了您的问题?

填写满意度调查问卷,共创更好文档体验。

文档反馈