All Products
Search
Document Center

Simple Message Queue (formerly MNS):GetTopicAttributes

Last Updated:Jul 26, 2024

Queries the attributes of a topic.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
TopicNamestringYes

The name of the topic.

demo-topic

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

06273500-249F-5863-121D-74D51123****
Codelong

The response code.

200
Statusstring

The response status.

Success
Messagestring

The returned message.

operation success
Successboolean

Indicates whether the request was successful.

true
Dataobject

The returned data.

TopicNamestring

The name of the topic.

demo-topic
MessageCountlong

The number of messages in the topic.

0
MaxMessageSizelong

The maximum length of the message that is sent to the topic. Unit: bytes.

65536
MessageRetentionPeriodlong

The maximum duration for which a message is retained in the topic. After the specified retention period ends, the message is deleted regardless of whether the message is received. Unit: seconds.

86400
CreateTimelong

The time when the topic was created. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

1449554277
LastModifyTimelong

The time when the topic was last modified. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

1449554460
LoggingEnabledboolean

Indicates whether the logging feature is enabled. Valid values:

  • True
  • False
True

Examples

Sample success responses

JSONformat

{
  "RequestId": "06273500-249F-5863-121D-74D51123****",
  "Code": 200,
  "Status": "Success",
  "Message": "operation success",
  "Success": true,
  "Data": {
    "TopicName": "demo-topic",
    "MessageCount": 0,
    "MaxMessageSize": 65536,
    "MessageRetentionPeriod": 86400,
    "CreateTime": 1449554277,
    "LastModifyTime": 1449554460,
    "LoggingEnabled": true,
    "Tags": [
      {
        "TagKey": "",
        "TagValue": ""
      }
    ]
  }
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-05-27The request parameters of the API has changed. The response structure of the API has changedView Change Details