DATASOURCE::ROCKETMQ::Topics

更新时间:
复制 MD 格式

Queries topics on an ApsaraMQ for RocketMQ instance.

Syntax

{
  "Type": "DATASOURCE::ROCKETMQ::Topics",
  "Properties": {
    "InstanceId": String,
    "TopicName": String,
    "RefreshOptions": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

InstanceId

String

No

Yes

The instance ID.

None.

TopicName

String

No

Yes

The topic name.

None.

RefreshOptions

String

No

Yes

The refresh policy for data source resources when the stack is updated.

Valid values:

  • Never (default): does not refresh data source resources when the stack is updated.

  • Always: refreshes data source resources when the stack is updated.

Return values

Fn::GetAtt

  • Topics: the details of each topic.

  • TopicNames: the names of the topics.

Property

Type

Description

Constraint

TopicNames

List

The names of the topics.

None.

Topics

List

The details of each topic.

None.

Remark

string

The description of the topic.

None.

Tags

Map

The tags of the topic.

Example:

[
            {
              "Key": "CartService",
              "Value": "SrviceA"
            }
          ]

InstanceId

string

The instance ID.

None.

RelationName

string

The relationship between the current account and the topic.

Valid values:

  • The current account is the owner of the topic.

  • The current account can subscribe to the topic.

  • The current account can publish messages to the topic.

  • The current account can publish messages to and subscribe to the topic.

MessageType

Number

The message type of the topic.

Valid values:

  • 0: normal message

  • 1: partitionally ordered message

  • 2: globally ordered message

  • 4: transactional message

  • 5: scheduled or delayed messages

CreateTime

string

The topic creation time.

None.

IndependentNaming

boolean

Whether the instance uses a separate namespace.

Valid values:

  • true: The instance has a separate namespace. Resource names must be unique within an instance but can be the same across different instances.

  • false: The instance does not have a separate namespace. Resource names must be globally unique within and across all instances.

Relation

integer

The numeric code of the relationship between the current account and the topic.

Valid values:

  • 1: The current account is the owner of the topic.

  • 2: The current account can publish messages to the topic.

  • 4: The current account can subscribe to the topic.

  • 6: The current account can publish messages to and subscribe to the topic.

Owner

string

The ID of the topic owner.

None.

TopicName

string

The topic name.

None.

Examples

ROSTemplateFormatVersion: '2015-09-01'
Parameters: {}
Resources:
  ExtensionDataSource:
    Type: DATASOURCE::ROCKETMQ::Topics
    Properties:
      TopicName: DemoTopic
Outputs:
  Topics:
    Description: The list of topics.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - Topics
  TopicNames:
    Description: The list of topic names.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - TopicNames
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
  },
  "Resources": {
    "ExtensionDataSource": {
      "Type": "DATASOURCE::ROCKETMQ::Topics",
      "Properties": {
        "TopicName": "DemoTopic"
      }
    }
  },
  "Outputs": {
    "Topics": {
      "Description": "The list of topics.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "Topics"
        ]
      }
    },
    "TopicNames": {
      "Description": "The list of topic names.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "TopicNames"
        ]
      }
    }
  }
}