Configures the read/write mode for a specified topic.

Usage notes

This operation is called in scenarios where read or write operations are forbidden.

QPS limit

The queries-per-second (QPS) limit on this operation is 10 per user. Throttling is triggered when the number of calls to this operation per second exceeds the QPS limit. Throttling may affect your business. Therefore, call this operation based on your needs. For more information, see QPS limits.

Authorization information

By default, only Alibaba Cloud accounts can call this operation. RAM users can call this operation only after they are authorized to use it. The following table lists the authorization information of this operation. For more information, see Policies and examples.

API

Action

Resource (with namespace)

Resource (without namespace)

OnsTopicUpdate

mq:UpdateTopic

acs:mq:*:*:{instanceId}%{topic}

acs:mq:*:*:{topic}

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes OnsTopicUpdate

The operation that you want to perform. Set the value to OnsTopicUpdate.

InstanceId String Yes MQ_INST_111111111111_DOxxxxxx

The ID of the instance where the topic you want to configure is located.

Perm Integer Yes 6

The read/write mode that you want to configure for the topic. Valid values:

  • 6: Both read and write operations are supported.
  • 4: Write operations are forbidden.
  • 2: Read operations are forbidden.
Topic String Yes test

The name of the topic that you want to configure.

Response parameters

Parameter Type Example Description
RequestId String 81979ADA-4A78-4F64-9DEC-5700446D****

The ID of the request, which is a common parameter. Each request has a unique ID to facilitate troubleshooting and fault locating.

Examples

Sample requests

http(s)://ons.cn-hangzhou.aliyuncs.com/? Action=OnsTopicUpdate
&Perm=6
&Topic=test
&InstanceId=MQ_INST_111111111111_DOxxxxxx
&<Common request parameters>

Sample success responses

XML format

<OnsTopicUpdateResponse>
  <RequestId>81979ADA-4A78-4F64-9DEC-5700446D****</RequestId>
</OnsTopicUpdateResponse>

JSON format

{
    "RequestId": "81979ADA-4A78-4F64-9DEC-5700446D****"
}

Error codes

For a list of error codes, visit the API Error Center.