Importing Topics
Function
This API is used to import topics.
URI
POST /v2/{project_id}/mqs/instances/{instance_id}/topics/import
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID. For details about how to obtain a project ID, see "Appendix" > "Obtaining a Project ID" in this document. |
| instance_id | Yes | String | Instance ID. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| mode | No | String | Mode for importing topics. The default value is AddNew. |
| prefix | No | String | Prefix of an application name. If a prefix is carried, the prefix is added to the existing application name to form a new application name. Then, the topic is imported based on the new application name. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | User token, which can be obtained by calling the IAM API (value of X-Subject-Token in the response header). |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| upload_file_name | Yes | File | List of topics to be imported. |
Response Parameters
Status code: 204
No Content
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code. |
| error_msg | String | Error message. |
Status code: 403
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code. |
| error_msg | String | Error message. |
Example Requests
Import a topic file to MQS.
POST https://{endpoint}/v2/{project_id}/mqs/instances/{instance_id}/topics/import Example Responses
Status code: 400
Bad Request
{
"error_code" : 400,
"error_msg" : "Bad Request"
} Status code: 403
Forbidden
{
"error_code" : 403,
"error_msg" : "Forbidden"
} Status Codes
| Status Code | Description |
|---|---|
| 204 | No Content |
| 400 | Bad Request |
| 403 | Forbidden |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.