Menampilkan tag yang ditambahkan ke resource Elastic Compute Service (ECS).
Catatan penggunaan
Tentukan setidaknya salah satu parameter atau pasangan parameter berikut dalam permintaan untuk menentukan objek kueri:
ResourceId.NTag.N(Tag.N.KeydanTag.N.Value)TagFilter.N
Jika salah satu himpunan parameter permintaan berikut ditentukan sebagai kondisi filter, hanya resource ECS yang memenuhi semua kondisi filter tersebut yang akan dikembalikan:
- Himpunan 1: Tag.N.Key,
Tag.N.Value, danResourceId.N - Set 2: TagFilter.N.TagKey,
TagFilter.N.TagValues.N, danResourceId.N
Debugging
Parameter permintaan
|
Parameter |
Tipe |
Wajib |
Contoh |
Deskripsi |
| Action | String | Ya | ListTagResources |
Operasi yang ingin Anda lakukan. Tetapkan nilainya ke ListTagResources. |
| RegionId | String | Ya | cn-hangzhou |
ID wilayah dari resource tersebut. Anda dapat memanggil operasi DescribeRegions untuk menanyakan daftar wilayah terbaru. |
| NextToken | String | Tidak | caeba0bbb2be03f84eb48b699f0a4883 |
Token paginasi. |
| ResourceType | String | Ya | instance |
Tipe resource tersebut. Nilai yang valid:
|
| ResourceId.N | String | Tidak | i-bp1j6qtvdm8w0z1o**** |
ID resource N. Nilai N yang valid: 1 hingga 50. |
| Tag.N.Key | String | Tidak | TestKey |
Kunci tag N yang digunakan untuk pencarian tepat resource ECS. Panjang kunci tag harus antara 1 hingga 128 karakter. Nilai N yang valid: 1 hingga 20. Metode penggunaan pasangan parameter
|
| Tag.N.Value | String | Tidak | TestValue |
Nilai tag N yang digunakan untuk pencarian tepat resource ECS. Panjang nilai tag harus antara 1 hingga 128 karakter. Nilai N yang valid: 1 hingga 20. Catatan Saat Tag.1.Key diatur ke acs:rm:rgId, Anda hanya dapat mengatur Tag.1.Value ke ID kelompok sumber daya non-default. |
| TagFilter.N.TagValues.N | String | Tidak | TestTagFilter |
Nilai tag N yang digunakan untuk pencarian fuzzy resource ECS. Panjang nilai tag harus antara 1 hingga 128 karakter. Nilai N yang valid: 1 hingga 5. Untuk informasi selengkapnya, lihat deskripsi |
| TagFilter.N.TagKey | String | Tidak | env |
Kunci tag N yang digunakan untuk pencarian fuzzy resource ECS. Panjang kunci tag harus antara 1 hingga 128 karakter. Nilai N yang valid: 1 hingga 5. Pasangan parameter
Catatan Pasangan parameter TagFilter.N (TagFilter.N.TagKey dan TagFilter.N.TagValues.N) tidak dapat digunakan bersamaan dengan pasangan parameter Tag.N (Tag.N.Key dan Tag.N.Value). Jika tidak, pesan kesalahan akan dikembalikan. |
Parameter respons
|
Parameter |
Tipe |
Contoh |
Deskripsi |
| NextToken | String | caeba0bbb2be03f84eb48b699f0a4883 |
Token yang diperlukan untuk kueri berikutnya. |
| RequestId | String | 484256DA-D816-44D2-9D86-B6EE4D5BA78C |
ID permintaan. |
| TagResources | Array of TagResource |
Detail tentang resource dan tag, termasuk ID resource, tipe resource, dan pasangan kunci-nilai tag. |
|
| TagResource | |||
| TagValue | String | TestValue |
Nilai tag dari resource tersebut. |
| ResourceType | String | instance |
Tipe resource. Nilai yang valid:
|
| ResourceId | String | i-bp1j6qtvdm8w0z1o**** |
ID resource. |
| TagKey | String | TestKey |
Kunci tag. |
Contoh
Permintaan Contoh
http(s)://ecs.aliyuncs.com/?Action=ListTagResources
&RegionId=cn-hangzhou
&ResourceType=instance
&ResourceId.1=i-bp1j6qtvdm8w0z1o****
&<Common request parameters>
Respons Sukses Contoh
XML format
HTTP/1.1 200 OK
Content-Type:application/xml
<ListTagResourcesResponse>
<TagResources>
<TagResource>
<ResourceType>instance</ResourceType>
<TagValue>TestValue</TagValue>
<ResourceId>i-bp1j6qtvdm8w0z1o****</ResourceId>
<TagKey>TestKey</TagKey>
</TagResource>
</TagResources>
<RequestId>DE65F6B7-7566-4802-9007-96F2494AC512</RequestId>
</ListTagResourcesResponse>
JSON format
HTTP/1.1 200 OK
Content-Type:application/json
{
"TagResources" : {
"TagResource" : [ {
"ResourceType" : "instance",
"TagValue" : "TestValue",
"ResourceId" : "i-bp1j6qtvdm8w0z1o****",
"TagKey" : "TestKey"
} ]
},
"RequestId" : "DE65F6B7-7566-4802-9007-96F2494AC512"
}
Kode kesalahan
|
Kode status HTTP |
Kode kesalahan |
Pesan kesalahan |
Deskripsi |
| 400 | InvalidDefaultResourceGroup.NotSupported | The specified parameter Tag is not support for default resource group. | Kelompok sumber daya default tidak dapat ditanyakan. |
| 400 | InvalidTag.NotSupported | You can only specify Tag for either resource tag or resource group. | Kelompok sumber daya dan tag tidak dapat ditanyakan secara bersamaan. |
| 400 | Duplicate.TagKey | The Tag.N.Key contain duplicate key. | Kunci tag sudah ada. Kunci tag harus unik. |
| 400 | InvalidTagKey.Malformed | The specified Tag.n.Key is not valid. | Nilai Tag.N.Key tidak valid. |
| 400 | InvalidTagValue.Malformed | The specified Tag.n.Value is not valid. | Nilai Tag.N.Value tidak valid. |
| 400 | OperationDenied.QuotaExceed | The quota of tags on resource is beyond permitted range. | Jumlah maksimum tag telah terlampaui. |
| 400 | InvalidTag.Mismatch | The specified Tag.n.Key and Tag.n.Value are not match. | Nilai Tag.N.Key dan Tag.N.Value tidak saling berkorespondensi. |
| 400 | InvalidTagCount | The specified tags are beyond the permitted range. | Jumlah maksimum tag telah terlampaui. |
| 400 | Invalid.Scope | The specified scope is invalid. | Nilai Scope tidak valid. |
| 403 | PermissionDenied.TagOwnerUid | The specified operator not have permission to set TagOwnerUid value. | Anda tidak berwenang untuk menentukan parameter TagOwnerUid. |
| 403 | PermissionDenied.Scope | The specified operator not have permission to set Scope value. | Anda tidak berwenang untuk menentukan parameter Scope. |
| 403 | InvalidResourceId.NotSupported | The specified ResourceId does not support tagging. | Resource yang ditentukan tidak mendukung penandaan tag. |
| 403 | NoPermission.Tag | The operator is not permission for the tag. | Anda tidak berwenang untuk mengelola tag tersebut. |
| 404 | InvalidRegionId.NotFound | %s | ID wilayah yang ditentukan tidak ditemukan. |
| 404 | MissingParameter.ResourceType | The parameter - ResourceType should not be null. | ResourceType wajib diisi. |
| 404 | InvalidResourceId.NotFound | The specified ResourceIds are not found in our records. | ID resource yang ditentukan tidak ditemukan. Periksa apakah ID resource tersebut benar. |
| 404 | InvalidResourceType.NotFound | The ResourceType provided does not exist in our records. | Tipe resource yang ditentukan tidak ditemukan. |
| 404 | InvalidRegionId.NotFound | The specified RegionId does not exist. | Nilai RegionId tidak valid. |
| 500 | ServiceUnavailable | The service is unavailable, please try again later. | Layanan sementara tidak tersedia. Coba lagi nanti. |
| 500 | InternalError | The process of creating snapshot has failed due to some unknown error. | Snapshot tidak dapat dibuat. |
Untuk daftar kode kesalahan, lihat Kode Kesalahan Layanan.