All Products
Search
Document Center

Cloud Enterprise Network:ListTrafficMarkingPolicies

Last Updated:Jun 10, 2026

Anda dapat memanggil operasi ListTrafficMarkingPolicies untuk mengkueri detail tentang Kebijakan penandaan trafik, seperti status dan prioritasnya.

Deskripsi operasi

When you call the ListTrafficMarkingPolicies operation:

  • You must specify at least one of the TransitRouterId and TrafficMarkingPolicyId parameters.

  • If you do not specify the TrafficMarkingPolicyId parameter, the operation returns only information about the traffic marking policy based on the TransitRouterId, TrafficMarkingPolicyName, and TrafficMarkingPolicyDescription parameters. Information about traffic classification rules is not returned. The TrafficMatchRules field is not included in the response.

  • If you specify the TrafficMarkingPolicyId parameter, the operation returns information about the traffic marking policy and its traffic classification rules. The TrafficMatchRules field is included in the response. If the TrafficMatchRules field is an empty array, no traffic classification rules are configured for the policy.

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

cen:ListTrafficMarkingPolicies

list

*All Resource

*

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

TransitRouterId

string

No

ID Instans TransitRouter.

tr-bp1rmwxnk221e3fas****

TrafficMarkingPolicyId

string

No

ID Kebijakan penandaan trafik.

tm-iz5egnyitxiroq****

TrafficMarkingPolicyName

string

No

Nama Kebijakan penandaan trafik.

Nama dapat kosong atau memiliki panjang 1 hingga 128 karakter. Nama tidak boleh dimulai dengan http:// atau https://.

nametest

TrafficMarkingPolicyDescription

string

No

Deskripsi Kebijakan penandaan trafik.

Deskripsi dapat kosong atau memiliki panjang 1 hingga 256 karakter. Deskripsi tidak boleh dimulai dengan http:// atau https://.

desctest

MaxResults

integer

No

Jumlah entri yang ditampilkan pada setiap halaman. Nilai valid: 1 hingga 100. Nilai default: 20.

20

NextToken

string

No

Token yang digunakan untuk kueri berikutnya. Nilai valid:

  • Anda tidak perlu menentukan parameter ini untuk kueri pertama.

  • Jika kueri berikutnya akan dikirim, atur nilai ke nilai NextToken yang ditampilkan dari panggilan API terakhir.

FFmyTO70tTpLG6I3FmYAXGKPd****

Elemen respons

Element

Type

Description

Example

object

The response.

NextToken

string

The token that is used for the next query.

  • If NextToken is empty, no next query is to be sent.

  • If a value is returned for NextToken, the value is the token that is used for the next query.

FFmyTO70tTpLG6I3FmYAXGKPd****

RequestId

string

The request ID.

699989E4-64A0-5F78-8B93-CDB32D98971F

TotalCount

integer

The number of entries returned.

1

MaxResults

integer

The number of entries returned per page.

20

TrafficMarkingPolicies

array<object>

The list of traffic marking policies.

array<object>

The information about the traffic marking policy.

TrafficMarkingPolicyStatus

string

The status of the traffic marking policy.

  • Creating: The policy is being created.

  • Active: The policy is available.

  • Modifying: The policy is being modified.

  • Deleting: The policy is being deleted.

Creating

TrafficMarkingPolicyId

string

The ID of the traffic marking policy.

tm-iz5egnyitxiroq****

MarkingDscp

integer

The Differentiated Services Code Point (DSCP) value of the traffic marking policy.

5

TrafficMarkingPolicyName

string

The name of the traffic marking policy.

nametest

Priority

integer

The priority of the traffic marking policy.

A smaller value indicates a higher priority.

5

TrafficMarkingPolicyDescription

string

The description of the traffic marking policy.

desctest

TrafficMatchRules

array<object>

The list of traffic classification rules.

object

The information about the traffic classification rule.

MatchDscp

integer

The DSCP value of the traffic message.

Catatan

If MatchDscp returns -1, it indicates that all DSCP values are matched.

6

DstCidr

string

The destination CIDR block of the traffic message. IPv4 and IPv6 addresses are supported.

192.168.120.0/24

TrafficMatchRuleDescription

string

The description of the traffic classification rule.

desctest

Protocol

string

The protocol type of the traffic message.

Catatan

A traffic marking policy supports matching multiple protocol types. For more information about the protocol types, see the relevant documentation.

HTTP

TrafficMatchRuleId

string

The ID of the traffic classification rule.

tm-rule-fa9kgq1e90rmhc****

SrcCidr

string

The source CIDR block of the traffic message. IPv6 and IPv4 addresses are supported.

192.168.10.0/24

TrafficMatchRuleName

string

The name of the traffic classification rule.

nametest

TrafficMatchRuleStatus

string

The status of the traffic classification rule.

  • Creating: The rule is being created.

  • Active: The rule is available.

  • Deleting: The rule is being deleted.

Creating

AddressFamily

string

The address type. Valid values are IPv4, IPv6, or empty.

IPv4

DstPortRange

array

The destination port range to be matched by the traffic classification rule.

integer

The destination port range to be matched by the traffic classification rule.

The operation returns two destination port numbers:

  • If the two destination port numbers are the same, for example, 80 and 80, the traffic classification rule matches traffic with a destination port of 80.

      If both destination port numbers are -1, the stream classification rule matches traffic with any destination port number.
    
  • If both destination port numbers are -1, the traffic classification rule matches traffic with any destination port.

80,80

SrcPortRange

array

The source port range to be matched by the traffic classification rule.

integer

The source port range to be matched by the traffic classification rule.

The operation returns two source port numbers:

  • If the two source port numbers are the same, for example, 80 and 80, the traffic classification rule matches traffic with a source port of 80.

      If both source port numbers are -1, the stream classification rule matches traffic with any source port number.
    
  • If both source port numbers are -1, the traffic classification rule matches traffic with any source port.

1,200

TransitRouterId

string

The ID of the TransitRouter instance.

tr-ccni***

Contoh

Respons sukses

JSONformat

{
  "NextToken": "FFmyTO70tTpLG6I3FmYAXGKPd****",
  "RequestId": "699989E4-64A0-5F78-8B93-CDB32D98971F",
  "TotalCount": 1,
  "MaxResults": 20,
  "TrafficMarkingPolicies": [
    {
      "TrafficMarkingPolicyStatus": "Creating",
      "TrafficMarkingPolicyId": "tm-iz5egnyitxiroq****",
      "MarkingDscp": 5,
      "TrafficMarkingPolicyName": "nametest",
      "Priority": 5,
      "TrafficMarkingPolicyDescription": "desctest",
      "TrafficMatchRules": [
        {
          "MatchDscp": 6,
          "DstCidr": "192.168.120.0/24",
          "TrafficMatchRuleDescription": "desctest",
          "Protocol": "HTTP",
          "TrafficMatchRuleId": "tm-rule-fa9kgq1e90rmhc****",
          "SrcCidr": "192.168.10.0/24",
          "TrafficMatchRuleName": "nametest",
          "TrafficMatchRuleStatus": "Creating",
          "AddressFamily": "IPv4",
          "DstPortRange": [
            0
          ],
          "SrcPortRange": [
            0
          ]
        }
      ],
      "TransitRouterId": "tr-ccni***"
    }
  ]
}

Kode kesalahan

HTTP status code

Error code

Error message

Description

400 MissingParam.TransitRouterIdOrTrafficMarkingPolicyId Either TransitRouterId or TrafficMarkingPolicyId must be specified. The error message returned because the TransitRouterId or TrafficMarkingPolicyId parameter is not set.
400 IllegalParam.NextToken The specified NextToken is invalid. The error message returned because the NextToken parameter is set to an invalid value.
400 InvalidName Name is invalid. The error message returned because the specified name is invalid.
400 InvalidDescription Description is invalid. The error message returned because the description is invalid.
400 InvalidParameter Invalid parameter. The error message returned because the parameter is set to an invalid value.
400 Unauthorized The AccessKeyId is unauthorized. The error message returned because you do not have the permissions to perform this operation.

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.