All Products
Search
Document Center

Cloud Enterprise Network:ListTagResources

Last Updated:Jun 10, 2026

Mengkueri tag yang dilampirkan ke instans Cloud Enterprise Network (CEN).

Deskripsi operasi

When you call the ListTagResources operation, you must specify at least one of the ResourceId.N and Tag.N.Key request parameters.

  • If you specify only ResourceId.N, the system queries the tags that are attached to the specified CEN instance.

  • If you specify only Tag.N.Key, the system queries all CEN instances that are associated with the specified tag key.

  • If you specify both ResourceId.N and Tag.N.Key, the system queries for tags that match the specified tag key and are attached to the specified CEN instance.

    • The specified CEN instance must be associated with the specified tag key. Otherwise, an empty result is returned.

    • If you specify multiple tag keys, the relationship between the tag keys is AND.

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:ListTagResources

get

*CenInstance

acs:cen:*:{#accountId}:ceninstance/{#ceninstanceId}

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

ResourceType

string

Yes

Tipe sumber daya. Nilai valid:

Cen: Instans CEN.

BandwidthPackage: Paket bandwidth.

TransitRouter: Router transit.

TransitRouterVpcAttachment: Koneksi VPC.

TransitRouterVbrAttachment: Koneksi VBR.

TransitRouterPeerAttachment: Koneksi antar-wilayah.

TransitRouterVpnAttachment: Koneksi VPN.

TransitRouterRouteTable: Tabel rute.

Flowlog: Log aliran.

TransitRouterMulticastDomain: Domain multicast.

cen

NextToken

string

No

Token yang digunakan untuk kueri berikutnya. Nilai valid:

  • Jika ini adalah kueri pertama Anda atau tidak ada kueri berikutnya yang akan dikirim, Anda tidak perlu menentukan parameter ini.

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

FFmyTO70tTpLG6I3FmYAXGKPd****

PageSize

integer

No

Jumlah entri yang akan dikembalikan pada setiap halaman. Nilai valid: 1 hingga 50. Nilai default: 10.

10

ResourceId

array

No

ID instans CEN.

Anda dapat memasukkan maksimal 20 ID instans CEN.

cen-8z69wtwqel33lq****

string

No

The ID of the CEN instance.

You can enter a maximum of 20 CEN instance IDs.

cen-8z69wtwqel33lq****

Tag

array<object>

No

Tag instans CEN.

Anda dapat mengkueri maksimal 20 tag.

object

No

The tags of the CEN instance.

You can query a maximum of 20 tags.

Key

string

No

The tag key.

The tag key can be up to 64 characters in length. It cannot start with aliyun or acs:, and cannot contain http:// or https://.

You can enter a maximum of 20 tag keys.

test

Value

string

No

The tag value.

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

You can enter a maximum of 20 tag values.

Bp

RegionId

string

No

ID wilayah tempat sumber daya di-deploy.

Parameter ini tidak diperlukan untuk tipe sumber daya Cen dan BandwidthPackage. Parameter ini diperlukan untuk semua tipe sumber daya lainnya.

cn-hangzhou

Elemen respons

Element

Type

Description

Example

object

The response parameters.

NextToken

string

The token that is used for the next query. Valid values:

  • 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.

165B5C86-2033-5954-A89D-4CD83BA06C85

TagResources

object

TagResource

array<object>

A list of resources and their tags.

object

ResourceType

string

The resource type. Valid values:

Cen: a CEN instance.

BandwidthPackage: a bandwidth plan.

TransitRouter: a transit router.

TransitRouterVpcAttachment: a VPC connection.

TransitRouterVbrAttachment: a VBR connection.

TransitRouterPeerAttachment: an inter-region connection.

TransitRouterVpnAttachment: a VPN connection.

TransitRouterRouteTable: a route table.

Flowlog: a flow log.

TransitRouterMulticastDomain: a multicast domain.

CEN

TagValue

string

The tag value.

Bp

ResourceId

string

The ID of the CEN instance.

cen-8z69wtwqel33lq****

TagKey

string

The tag key.

test

Contoh

Respons sukses

JSONformat

{
  "NextToken": "FFmyTO70tTpLG6I3FmYAXGKPd****",
  "RequestId": "165B5C86-2033-5954-A89D-4CD83BA06C85",
  "TagResources": {
    "TagResource": [
      {
        "ResourceType": "CEN",
        "TagValue": "Bp",
        "ResourceId": "cen-8z69wtwqel33lq****",
        "TagKey": "test"
      }
    ]
  }
}

Kode kesalahan

HTTP status code

Error code

Error message

Description

400 InvalidTagKey The tag keys are not valid. The error message returned because the specified tag key is invalid.
400 InvalidTagValue The tag values are not valid. The error message returned because the specified tag value is invalid.
400 MissingParam %s
400 InvalidInstanceType.NotFound The instance type is not found The error message returned because the specified instance type does not exist.
400 InvalidInstanceIds.NotFound The instanceIds are not found The error message returned because the specified instance does not exist.
400 Forbidden.TagKeys The request do not allow to operate the tag keys The error message returned because you cannot manage the specified tag key.
400 QuotaExceeded.TagNum Custom Tags quota exceeded The error message returned because the number of tags has reached the upper limit.
400 InvalidTagScope.NotFound The tag scope is not found The error message returned because the specified tag scope is invalid.
400 Forbidden.NotAllowedCategary The System tag is not valid The error message returned because you cannot configure system tags.
400 SizeLimitExceeded.ResourceIdNum The ResourceIds parameter's number is exceed , Valid : 20
400 BothEmpty.TagsAndResources Both of Tags and ResourceIds is empty. The error message returned because the Tags and ResourceIds parameters are not set.
400 IllegalParam.NextToken The parameter NextToken is invalid. The error message returned because the NextToken parameter is set to an invalid value. Check the value and try again.
400 IllegalParam.Region The specified region 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.