调用GetTopicAttributes接口获取主题的属性。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
mns:GetTopicAttributes |
get |
*Topic
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| TopicName |
string |
是 |
主题的名称。 |
demo-topic |
| Tag |
array<object> |
否 |
资源标签列表。 |
|
|
object |
否 |
标签列表。 |
||
| Key |
string |
否 |
标签的 key。 |
tag1 |
| Value |
string |
否 |
标签值。 |
test |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| RequestId |
string |
请求的 ID。 |
06273500-249F-5863-121D-74D51123**** |
| Code |
integer |
响应 code。 |
200 |
| Status |
string |
响应的状态。 |
Success |
| Message |
string |
响应信息。 |
operation success |
| Success |
boolean |
请求是否成功。 |
true |
| Data |
object |
响应数据。 |
|
| TopicName |
string |
主题的名称。 |
demo-topic |
| MessageCount |
integer |
当前该主题中消息数目。 |
0 |
| MaxMessageSize |
integer |
发送到该主题的消息体最大长度,单位为 Byte。 |
65536 |
| MessageRetentionPeriod |
integer |
消息在主题中最长存活时间,从发送到该主题开始经过此参数指定的时间后,不论消息是否被成功推送给用户都将被删除,单位为秒。 |
86400 |
| CreateTime |
integer |
主题的创建时间,为 UTC Unix 秒级时间戳。 |
1449554277 |
| LastModifyTime |
integer |
主题属性最近一次修改时间,为 UTC Unix 秒级时间戳。 |
1449554460 |
| LoggingEnabled |
boolean |
是否开启日志管理功能。
|
True |
| Tags |
array<object> |
资源标签列表。 |
|
|
object |
标签键对应的标签值。 |
||
| TagKey |
string |
标签的 key。 |
tag1 |
| TagValue |
string |
标签值。 |
test |
| TopicType |
string |
主题类型。可取值如下:
|
normal |
| TopicUrl |
string |
主题的公网访问 URL。 |
http://111111111****.mns.us-west-1.aliyuncs.com/topics/testTopic |
| TopicInnerUrl |
string |
主题的内网访问 URL。 |
http://111111111****.mns.us-west-1-internal.aliyuncs.com/topics/testTopic |
| EnableSSE |
boolean |
是否开启存储加密。取值:true 或 false。 |
true |
| SseType |
string |
存储加密方式。取值:SMQ 或 KMS。 |
KMS |
| SseAlgorithm |
string |
存储加密算法,当前支持 AES-256-GCM;未指定时使用默认算法。 |
AES-256-GCM |
| KmsKeyId |
string |
KMS 密钥 ID。 |
key-xxx |
| EncryptionEnabled |
boolean |
是否已启用存储加密。 |
true |
示例
正常返回示例
JSON格式
{
"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": "tag1",
"TagValue": "test"
}
],
"TopicType": "normal",
"TopicUrl": "http://111111111****.mns.us-west-1.aliyuncs.com/topics/testTopic",
"TopicInnerUrl": "http://111111111****.mns.us-west-1-internal.aliyuncs.com/topics/testTopic",
"EnableSSE": true,
"SseType": "KMS",
"SseAlgorithm": "AES-256-GCM",
"KmsKeyId": "key-xxx",
"EncryptionEnabled": true
}
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。