All Products
Search
Document Center

Key Management Service:ListTagResources

Last Updated:Jun 10, 2026

Menampilkan daftar tag yang terikat pada kunci atau rahasia.

Deskripsi operasi

For more information about the access policy required for a RAM user or RAM role to call this operation, see Resource Access Management.

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

Tidak ada otorisasi untuk operasi ini. Jika Anda mengalami masalah saat menjalankan operasi ini, hubungi dukungan teknis.

Parameter permintaan

Parameter

Type

Required

Description

Example

RegionId

string

Yes

ID wilayah Sumber daya.

Catatan

Panggil DescribeRegions untuk mengkueri daftar wilayah terbaru.

cn-hangzhou

NextToken

string

No

Token paginasi yang digunakan di permintaan berikutnya untuk mengambil halaman hasil baru.

Catatan

Jika tidak semua hasil dikembalikan, nilai NextToken disertakan dalam tanggapan. Secara default, 200 baris dikembalikan per halaman. Untuk mengambil halaman berikutnya, atur parameter ini ke nilai NextToken dari tanggapan sebelumnya.

caeba0bbb2be03f84eb48b699f0a4883

ResourceType

string

Yes

Tipe Sumber daya yang tag-nya ingin Anda kueri. Nilai valid:

  • kunci

  • rahasia.

key

ResourceId

array

No

Daftar ID Sumber daya yang tag-nya ingin Anda kueri. Anda dapat menentukan maksimal 50 ID Sumber daya.

Tentukan beberapa ID Sumber daya dalam format ["ResourceId.1","ResourceId.2",...].

string

No

The resource IDs for which you want to query tags. You can specify a maximum of 50 resource IDs.

Specify multiple resource IDs in the ["ResourceId.1","ResourceId.2",...] format.

key-hzz62f1cb66fa42qo****

Tag

array<object>

No

Daftar tag yang ingin Anda kueri. Nilai valid untuk N: 1 hingga 20.

object

No

Key

string

No

The key of the tag. A tag consists of a key-value pair.

You can specify up to 20 tags. Specify multiple tags in the [{"Key":"key1","Value":"value1"},{"Key":"key2","Value":"value2"},..] format.

Catatan

The key cannot start with aliyun or acs:.

disk-encryption

Value

string

No

The value of the tag. A tag consists of a key-value pair.

You can specify up to 20 tags. Specify multiple tags in the [{"Key":"key1","Value":"value1"},{"Key":"key2","Value":"value2"},..] format.

true

Elemen respons

Element

Type

Description

Example

object

NextToken

string

A pagination token. It can be used in the next request to retrieve a new page of results.

  • If NextToken is empty ("NextToken": ""), no next page exists.

  • If NextToken is not empty, the value is the token used to start the next query.

e71d8a535bd9cc11

RequestId

string

The request ID.

00827261-20B7-4562-83F2-4DF39876A45A

TagResources

object

TagResource

array<object>

The list of tags.

object

ResourceType

string

The type of the resource.

key

TagValue

string

The value of the tag.

true

ResourceId

string

The resource ID.

key-hzz62f1cb66fa42qo****

TagKey

string

The key of the tag.

disk-encryption

Contoh

Respons sukses

JSONformat

{
  "NextToken": "e71d8a535bd9cc11",
  "RequestId": "00827261-20B7-4562-83F2-4DF39876A45A",
  "TagResources": {
    "TagResource": [
      {
        "ResourceType": "key",
        "TagValue": "true",
        "ResourceId": "key-hzz62f1cb66fa42qo****",
        "TagKey": "disk-encryption"
      }
    ]
  }
}

Kode kesalahan

HTTP status code

Error code

Error message

Description

400 Duplicate.TagKey The specified tagKey is duplicate.
404 InvalidAccessKeyId.NotFound The Access Key ID provided does not exist in our records.
404 InvalidResourceId.NotFound The specified ResourceId is not found.

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.