All Products
Search
Document Center

Simple Message Queue (formerly MNS):ListEventRules

Last Updated:Jun 11, 2026

Mengkueri daftar aturan notifikasi event.

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

mns:ListEventRules

list

*Topic

acs:mns:{#regionId}:{#accountId}:/products/{#ProductName}/rules

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

ProductName

string

No

Nama layanan Alibaba Cloud yang dikonfigurasi untuk Notifikasi event.

oss

ResourceName

string

No

Nama Sumber daya dalam aturan pencocokan. Parameter ini digunakan untuk memfilter aturan. Misalnya, untuk Object Storage Service (OSS), ini adalah nama bucket.

test-bucket

RuleName

string

No

Nama aturan.

rule-xsXDW

TopicName

string

No

Nama Topik.

test-topic

Subscription

object

No

subscriber.

EndpointType

string

No

The endpoint type. Valid values:

  • topic: A topic can deliver messages to multiple subscribers. You can add or remove subscribers later.

  • queue: Messages are delivered directly to a queue. This simplifies the delivery path, but you cannot add new subscribers later.

topic

EndpointValue

string

No

The actual value of the endpoint.

test-topic

PageNum

integer

No

Nomor halaman hasil yang dikembalikan. Nilai valid: 1 hingga 100000. Jika Anda menetapkan parameter ini ke nilai kurang dari 1, sistem menggunakan 1. Jika Anda menetapkan parameter ini ke nilai lebih dari 100000, sistem menggunakan 100000.

1

PageSize

integer

No

Jumlah entri yang dikembalikan pada setiap halaman. Nilai valid: 10 hingga 50. Jika Anda menetapkan parameter ini ke nilai kurang dari 10, sistem menggunakan 10. Jika Anda menetapkan parameter ini ke nilai lebih dari 50, sistem menggunakan 50.

20

NextToken

string

No

Parameter ini tidak digunakan lagi. Gunakan PageNum untuk kueri berhalaman.

cd7NlPlX4kgKCdsCWMiMR/+HnVzPLQ4/XLvjR64jZ7F9AQ+Mr3T59J6IVkuXeV3w

MaxResults

integer

No

Parameter ini tidak digunakan lagi. Gunakan PageSize untuk kueri berhalaman.

50

Elemen respons

Element

Type

Description

Example

object

RequestId

string

The request ID.

06273500-249F-5863-121D-74D51123E62C

Code

integer

The response code.

200

Status

string

The status of the response.

Success

Message

string

The response message.

operation success

Success

boolean

Indicates whether the request was successful.

true

Data

object

The response data.

PageNum

integer

The page number of the returned results.

1

PageSize

integer

The number of entries returned per page.

50

Size

integer

The number of entries on the current page.

20

Pages

integer

The total number of pages.

3

Total

integer

The total number of entries.

130

NextToken

string

This parameter is deprecated. Paged queries are based on PageNum.

a88f58d504b8b4c4e0b5e8707e68181f

MaxResults

integer

This parameter is deprecated. The maximum number of entries is based on Total.

1

PageData

array<object>

The data entries.

array<object>

The data entries.

RuleName

string

The name of the event notification rule.

rule-xsXDW

Subscriptions

array<object>

The subscribers. A maximum of 20 entries are returned. If there are more subscribers, see List Subscriptions.

object

EndpointType

string

The endpoint type.

queue

EndpointValue

string

The actual value of the endpoint.

wyx-vp-complete-queue

TopicName

string

The name of the topic.

demo-topic

MatchRules

array

The event matching rules. The rules have an OR relationship.

array

The event matching rules. The rules have an OR relationship.

EventMatchRule

The matching rules. Multiple rules have an OR relationship.

[[{\"MatchState\":true,\"Prefix\":\"cdhxdev1cdh-bba-dto-052901-sem-5seh/\",\"Suffix\":\"\"}]]

EventTypes

array

The list of event types.

string

The list of event types.

["oss:ObjectCreated:CopyObject"]

Endpoint

object

The endpoint of the subscription.

EndpointType

string

The endpoint type. Valid values:

  • topic: A topic can deliver messages to multiple subscribers. You can add or remove subscribers later.

  • queue: Messages are delivered directly to a queue. This simplifies the delivery path, but you cannot add new subscribers later.

topic

EndpointValue

string

The actual value of the endpoint.

test-topic

DeliveryMode

string

This parameter is deprecated.

--

Contoh

Respons sukses

JSONformat

{
  "RequestId": "06273500-249F-5863-121D-74D51123E62C",
  "Code": 200,
  "Status": "Success",
  "Message": "operation success",
  "Success": true,
  "Data": {
    "PageNum": 1,
    "PageSize": 50,
    "Size": 20,
    "Pages": 3,
    "Total": 130,
    "NextToken": "a88f58d504b8b4c4e0b5e8707e68181f",
    "MaxResults": 1,
    "PageData": [
      {
        "RuleName": "rule-xsXDW",
        "Subscriptions": [
          {
            "EndpointType": "queue",
            "EndpointValue": "wyx-vp-complete-queue"
          }
        ],
        "TopicName": "demo-topic",
        "MatchRules": [
          [
            {
              "MatchState": true,
              "Name": "testBucket/folder1/file1",
              "Prefix": "testBucket/prefix1xxx",
              "Suffix": "suffix/xxxx.test"
            }
          ]
        ],
        "EventTypes": [
          "[\"oss:ObjectCreated:CopyObject\"]"
        ],
        "Endpoint": {
          "EndpointType": "topic",
          "EndpointValue": "test-topic"
        },
        "DeliveryMode": "--"
      }
    ]
  }
}

Kode kesalahan

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.