You can call the OnsTopicCreate operation to create a topic.
Operation description
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
mq:CreateTopic |
*Topic
*Topic
|
None |
|
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Topic |
string |
Yes |
The name of the topic to create. The name must meet the following requirements:
Note
To check if an instance has a namespace, go to the Instance Details page in the ApsaraMQ for RocketMQ console. The information is in the Basic Information section. |
test |
| MessageType |
integer |
Yes |
The message type. Valid values:
For more information, see Message types. |
0 |
| Remark |
string |
No |
The description of the topic. |
测试 |
| InstanceId |
string |
No |
The ID of the instance where the topic resides. |
MQ_INST_188077086902****_BXSuW61e |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The returned data. |
||
| RequestId |
string |
The ID of the request. This ID is unique and can be used for troubleshooting. |
B6949B58-223E-4B75-B4FE-7797C15E**** |
Examples
Success response
JSON format
{
"RequestId": "B6949B58-223E-4B75-B4FE-7797C15E****"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | %s | %s, please check and retry later |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.