All Products
Search
Document Center

ApsaraMQ for RocketMQ:OnsTopicList

更新時間:Mar 03, 2024

Queries the information about topics that belong to the current account.

Operation description

Note API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur.

This operation returns the basic information about topics and does not return the details of topics.

Debugging

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

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
mq:QueryInstanceBaseInfoList
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
TopicstringNo

The name of the topic that you want to query. This parameter is required if you want to query a specific topic. If you do not include this parameter in a request, all topics that you can access are queried.

test
InstanceIdstringYes

The ID of the instance that contains the topics you want to query.

MQ_INST_188077086902****_BXSuW61e
Tagobject []No

The list of tags that are attached to the topic. A maximum of 20 tags can be included in the list.

KeystringYes

The key of the tag that is attached to the topics you want to query. This parameter is not required. If you configure this parameter, you must also configure the Value parameter.**** If you include the Key and Value parameters in a request, this operation queries only the topics that use the specified tag. If you do not include these parameters in a request, this operation queries all topics that you can access.

  • The value of this parameter cannot be an empty string.
  • A tag value can be up to 128 characters in length and cannot start with acs: or aliyun. It cannot contain http:// or https://.
CartService
ValuestringYes

The value of the tag that is attached to the topics you want to query. This parameter is not required. If you configure this parameter, you must also configure the Key parameter.**** If you include the Key and Value parameters in a request, this operation queries only the topics that use the specified tag. If you do not include these parameters in a request, this operation queries all topics that you can access.

  • The value of this parameter can be an empty string.
  • A tag key can be up to 128 characters in length and cannot contain http:// or https://. It cannot start with acs: or aliyun.
ServiceA
UserIdstringNo

The user ID of the topic owner. Set this parameter to an Alibaba Cloud account ID.

138015630679****

Response parameters

ParameterTypeDescriptionExample
object

The data returned.

RequestIdstring

The ID of the request. This is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.

4A978869-7681-4529-B470-107E1379****
Dataobject []

The information about the topics.

MessageTypeinteger

The message type. Valid values:

  • 0: normal messages
  • 1: partitionally ordered messages
  • 2: globally ordered messages
  • 4: transactional messages
  • 5: scheduled or delayed messages
0
RelationNamestring

The relationship between the current account and the topic. The value of this parameter indicates whether the current account is the owner of the topic, and whether the current account can subscribe or publish messages to the topic. the topic.

Publish and subscribe
Ownerstring

The user ID of the topic owner. The value of this parameter is an Alibaba account ID.

138015630679****
IndependentNamingboolean

Indicates whether the instance that contains the topic uses a namespace. Valid values:

  • true: The instance uses a separate namespace. The name of each resource must be unique in the instance. The names of resources in different instances can be the same.
  • false: The instance does not use a separate namespace. The name of each resource must be globally unique within an instance and across all instances.
true
Remarkstring

The description of the topic.

Test
Relationinteger

Indicates 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.
6
CreateTimelong

The time when the topic was created.

1570700947000
Topicstring

The topic name.

test
Tagsobject []

The tags that are attached to the topic.

Keystring

The tag key.

CartService
Valuestring

The tag value.

SrviceA
InstanceIdstring

The ID of the instance that contains the topic.

MQ_INST_188077086902****_BXSuW61e
ServiceStatusinteger

The status of the topic that is asynchronously created. Valid values:

  • 0: The topic is being created.
  • 1: The topic is being used.
0

Examples

Sample success responses

JSONformat

{
  "RequestId": "4A978869-7681-4529-B470-107E1379****",
  "Data": {
    "PublishInfoDo": [
      {
        "MessageType": 0,
        "RelationName": "Publish and subscribe\n",
        "Owner": "138015630679****",
        "IndependentNaming": true,
        "Remark": "Test\n",
        "Relation": 6,
        "CreateTime": 1570700947000,
        "Topic": "test",
        "Tags": {
          "Tag": [
            {
              "Key": "CartService",
              "Value": "SrviceA"
            }
          ]
        },
        "InstanceId": "MQ_INST_188077086902****_BXSuW61e",
        "ServiceStatus": 0
      }
    ]
  }
}

Error codes

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

Change history

Change timeSummary of changesOperation
No change history