Queries the parameters of a topic.
Description
You can call this operation to query the parameters of a topic. The operation returns the parameters that were specified when the topic was created. The operation also returns the time when the topic was created and the maximum period for which a message can be retained in the topic.
Request
Each request consists of the following parts:
-
Request line
GET /topics/$TopicName HTTP/1.1
-
Operation-specific request headers
None. For more information about common request headers, see Common parameters.
-
Request Body
None.
Response
Each response consists of the following parts:
- HTTP Status Code
HTTP/1.1 200 OK
- Operation-specific response headers
None. For more information about common response headers, see Common parameters.
- Response Body
The response body is in the XML format. Syntax:
<TopicAttributes>Attribute Element List</TopicAttributes>
.The response body contains the following parameters.
Parameter Description TopicName The name of the topic. CreateTime The time when the topic was created. The value is a timestamp that follows the UNIX time format. It is the number of seconds that have elapsed since 00:00:00 Thursday, January 1, 1970. LastModifyTime The time when the topic was last modified. The value is a timestamp that follows the UNIX time format. It is the number of seconds that have elapsed since 00:00:00 Thursday, January 1, 1970. MaximumMessageSize The maximum size of a message body that can be sent to the topic. Unit: bytes. MessageRetentionPeriod The maximum period for which a message can be retained in the topic. A message that is sent to the topic can be retained for a specified period. After the specified period ends, the message is deleted no matter whether it is pushed to the specified endpoints. Unit: seconds. MessageCount The number of messages in the topic. LoggingEnabled Indicates whether the log management feature is enabled for the queue. Valid values: - True: The log management feature is enabled.
- False: The log management feature is disabled.
Examples
Sample requests
GET /topics/$TopicName HTTP/1.1
Host: $AccountId.mns.cn-hangzhou.aliyuncs.com
Date: Tue, 08 Dec 2015 06:02:33 GMT
x-mns-version: 2015-06-06
Authorization:MNS 15B4D3461F177624206A:aVZgLZzVchjOtM1aecDQYFuj4Bo=
Sample success responses
HTTP/1.1 200 OK
Content-Type=text/xml;utf-8
Content-Length:145
x-mns-request-id:56667279B2B71C9C1600001D
x-mns-version: 2015-06-06
<? xml version="1.0" encoding="UTF-8"? >
<Topic xmlns=http://mns.aliyuncs.com/doc/v1/”>
<TopicName>$TopicName</TopicName>
<CreateTime>1449554277</CreateTime >
<LastModifyTime>1449554460</LastModifyTime>
<MaximumMessageSize>65536</MaximumMessageSize>
<MessageRetentionPeriod>86400</MessageRetentionPeriod>
<MessageCount>0</MessageCount>
<LoggingEnabled>True</LoggingEnabled>
</Topic>
Special error
Error code | Error message | HTTP status code |
---|---|---|
TopicNotExist | The topic you provided does not exist. | 404 |