All Products
Search
Document Center

ApsaraMQ for RocketMQ:OnsTopicList

Last Updated:Jun 10, 2026

Mengkueri informasi tentang semua topik di akun Anda.

Deskripsi operasi

Penting Alibaba Cloud OpenAPI is a management API that you can use to manage and query resources of Alibaba Cloud services. Integrate this API for management purposes only. Do not rely on this API for core data links that send and receive messages. This can create security threats for your data links.
This operation is typically used to generate a list of resources, not to view specific details.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

mq:ListTopic

list

Instance

acs:mq:{#regionId}:{#accountId}:{#InstanceId}

None
  • mq:QueryInstanceBaseInfo

Parameter permintaan

Parameter

Type

Required

Description

Example

Topic

string

No

Tentukan topik yang akan dikueri. Jika Anda mengosongkan parameter ini, semua topik akan dikueri.

test

InstanceId

string

No

ID instans yang berisi topik yang ingin Anda kueri.

MQ_INST_188077086902****_BXSuW61e

Tag

array<object>

No

Daftar tag yang dilampirkan ke topik. Daftar ini dapat berisi maksimal 20 elemen.

object

No

The structure of the returned tag.

Key

string

Yes

The tag key of the topic. You must specify the Key and Value parameters at the same time, or leave them both empty. If you specify both parameters, this operation queries topics that have the specified tag. If you leave both parameters empty, this operation queries all topics.

  • If you specify this parameter, its value cannot be an empty string.

  • The value can be up to 128 characters in length. It cannot start with aliyun or acs:. It cannot contain http:// or https://.

CartService

Value

string

Yes

The tag value of the topic. You must specify the Key and Value parameters at the same time, or leave them both empty. If you specify both parameters, this operation queries topics that have the specified tag. If you leave both parameters empty, this operation queries all topics.

  • If you specify this parameter, its value can be an empty string.

  • The value can be up to 128 characters in length. It cannot start with aliyun or acs:. It cannot contain http:// or https://.

ServiceA

Elemen respons

Element

Type

Description

Example

object

The returned data structure.

RequestId

string

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

4A978869-7681-4529-B470-107E1379****

Data

object

PublishInfoDo

array<object>

The list of topics in the specified instance.

array<object>

The data structure of the returned topic.

MessageType

integer

The message type. Valid values:

  • 0: Normal message

  • 1: Partitionally ordered message

  • 2: Globally ordered message

  • 4: Transactional message

  • 5: Scheduled and delayed message

0

RelationName

string

The relation name. Valid values are Owner, Subscribable, Publishable, and Publishable and Subscribable.

授权发布/订阅

Owner

string

The ID of the topic owner. This is the ID of an Alibaba Cloud account.

138015630679****

IndependentNaming

boolean

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

  • true: The instance has an independent namespace. The resource name must be unique within the instance. The resource name can be the same as a resource name in another instance.

  • false: The instance does not have an independent namespace. The resource name must be globally unique within and across all instances.

true

Remark

string

The remarks.

测试

Relation

integer

The relation ID. Valid values:

  • 1: The owner of the topic.

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

  • 4: The account can subscribe to the topic.

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

6

CreateTime

integer

The time when the topic was created.

1570700947000

Topic

string

The topic name.

test

Tags

object

Tag

array<object>

The tags that are attached to the topic.

object

The definition of the tag structure.

Key

string

The tag key.

CartService

Value

string

The tag value.

SrviceA

InstanceId

string

The ID of the instance that contains the topic.

MQ_INST_188077086902****_BXSuW61e

ServiceStatus

integer

The status of the asynchronous topic creation. Valid values:

  • 0: Creating.

  • 1: In service.

0

Contoh

Respons sukses

JSONformat

{
  "RequestId": "4A978869-7681-4529-B470-107E1379****",
  "Data": {
    "PublishInfoDo": [
      {
        "MessageType": 0,
        "RelationName": "授权发布/订阅",
        "Owner": "138015630679****",
        "IndependentNaming": true,
        "Remark": "测试",
        "Relation": 6,
        "CreateTime": 1570700947000,
        "Topic": "test",
        "Tags": {
          "Tag": [
            {
              "Key": "CartService",
              "Value": "SrviceA"
            }
          ]
        },
        "InstanceId": "MQ_INST_188077086902****_BXSuW61e",
        "ServiceStatus": 0
      }
    ]
  }
}

Kode kesalahan

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.