DATASOURCE::MNS::Topic类型用于获取单个主题的详情信息。
语法
{
"Type": "DATASOURCE::MNS::Topic",
"Properties": {
"TopicName": String,
"RefreshOptions": String
}
}
属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
TopicName | String | 是 | 是 | 主题的名称。 | 无 |
RefreshOptions | String | 否 | 是 | 当资源栈更新时,数据源资源的刷新策略。 | 有效值:
|
返回值
Fn::GetAtt
MessageRetentionPeriod:消息在主题中最长存活时间。
CreateTime:主题的创建时间。
TopicUrl:主题的公网访问地址。
MaxMessageSize:发送到该主题的消息体最大长度。
LastModifyTime:修改主题属性信息的最近时间。
MessageCount:当前该主题中消息数目。
TopicInnerUrl:主题的内网访问地址。
LoggingEnabled:是否开启日志管理功能。
TopicName:主题的名称。
示例
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
TopicName:
Type: String
Description:
en: The name of the resource.
Required: true
Resources:
ExtensionDataSource:
Type: DATASOURCE::MNS::Topic
Properties:
TopicName:
Ref: TopicName
Outputs:
MessageRetentionPeriod:
Description: The retention period of the message in the topic.
Value:
Fn::GetAtt:
- ExtensionDataSource
- MessageRetentionPeriod
CreateTime:
Description: The time when the topic was created.
Value:
Fn::GetAtt:
- ExtensionDataSource
- CreateTime
TopicUrl:
Description: The URL of the topic.
Value:
Fn::GetAtt:
- ExtensionDataSource
- TopicUrl
MaxMessageSize:
Description: The maximum size of a message body that is sent to the topic.
Value:
Fn::GetAtt:
- ExtensionDataSource
- MaxMessageSize
LastModifyTime:
Description: The time when the topic was last modified.
Value:
Fn::GetAtt:
- ExtensionDataSource
- LastModifyTime
MessageCount:
Description: The number of messages in the topic.
Value:
Fn::GetAtt:
- ExtensionDataSource
- MessageCount
TopicInnerUrl:
Description: The internal URL of the topic.
Value:
Fn::GetAtt:
- ExtensionDataSource
- TopicInnerUrl
LoggingEnabled:
Description: Indicates whether the log management feature is enabled for the topic.
Value:
Fn::GetAtt:
- ExtensionDataSource
- LoggingEnabled
TopicName:
Description: The name of the MNS topic.
Value:
Fn::GetAtt:
- ExtensionDataSource
- TopicName
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"TopicName": {
"Type": "String",
"Description": {
"en": "The name of the resource."
},
"Required": true
}
},
"Resources": {
"ExtensionDataSource": {
"Type": "DATASOURCE::MNS::Topic",
"Properties": {
"TopicName": {
"Ref": "TopicName"
}
}
}
},
"Outputs": {
"MessageRetentionPeriod": {
"Description": "The retention period of the message in the topic.",
"Value": {
"Fn::GetAtt": [
"ExtensionDataSource",
"MessageRetentionPeriod"
]
}
},
"CreateTime": {
"Description": "The time when the topic was created.",
"Value": {
"Fn::GetAtt": [
"ExtensionDataSource",
"CreateTime"
]
}
},
"TopicUrl": {
"Description": "The URL of the topic.",
"Value": {
"Fn::GetAtt": [
"ExtensionDataSource",
"TopicUrl"
]
}
},
"MaxMessageSize": {
"Description": "The maximum size of a message body that is sent to the topic.",
"Value": {
"Fn::GetAtt": [
"ExtensionDataSource",
"MaxMessageSize"
]
}
},
"LastModifyTime": {
"Description": "The time when the topic was last modified.",
"Value": {
"Fn::GetAtt": [
"ExtensionDataSource",
"LastModifyTime"
]
}
},
"MessageCount": {
"Description": "The number of messages in the topic.",
"Value": {
"Fn::GetAtt": [
"ExtensionDataSource",
"MessageCount"
]
}
},
"TopicInnerUrl": {
"Description": "The internal URL of the topic.",
"Value": {
"Fn::GetAtt": [
"ExtensionDataSource",
"TopicInnerUrl"
]
}
},
"LoggingEnabled": {
"Description": "Indicates whether the log management feature is enabled for the topic.",
"Value": {
"Fn::GetAtt": [
"ExtensionDataSource",
"LoggingEnabled"
]
}
},
"TopicName": {
"Description": "The name of the MNS topic.",
"Value": {
"Fn::GetAtt": [
"ExtensionDataSource",
"TopicName"
]
}
}
}
}
该文章对您有帮助吗?