Mengkueri tag yang ditambahkan ke sumber daya.
Deskripsi operasi
-
You must specify ResourceId.N or Tag.N in the request to specify the object that you want to query.
-
Tag.N is a resource tag that consists of a key-value pair (Tag.N.Key and Tag.N.Value). If you specify only Tag.N.Key, all tag values that are associated with the specified key are returned. If you specify only Tag.N.Value, an error message is returned.
-
If you specify Tag.N and ResourceId.N to filter tags, ResourceId.N must match all specified key-value pairs.
-
If you specify multiple key-value pairs, resources that contain these key-value pairs are returned.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
privatelink:ListTagResources |
get |
*VpcEndpoint
*VpcEndpointService
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| ResourceId |
array |
No |
ID sumber daya. Anda dapat menentukan hingga 50 ID sumber daya. |
|
|
string |
No |
The resource ID. |
ep-hp3i05294c2d2d****** |
|
| ResourceType |
string |
Yes |
Tipe sumber daya. Nilai valid:
|
vpcendpoint |
| Tag |
array<object> |
No |
Tag yang akan ditambahkan ke sumber daya. |
|
|
object |
No |
The tags to add to the resource. |
||
| Key |
string |
No |
The key of tag N to add to the resource. You can specify up to 20 tag keys. The tag key cannot be an empty string. The tag key can be up to 64 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The tag key must start with a letter but cannot start with |
FinanceDept |
| Value |
string |
No |
The value of tag N to add to the resource. You can specify up to 20 tag values. The tag value can be an empty string. The tag value can be up to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The tag value must start with a letter but cannot start with |
FinanceJoshua |
| ClientToken |
string |
No |
Token klien yang digunakan untuk memastikan idempotens permintaan. Anda dapat menggunakan klien untuk menghasilkan token, tetapi Anda harus memastikan bahwa token tersebut unik di antara permintaan yang berbeda. Token hanya dapat berisi karakter ASCII. |
0c593ea1-3bea-11e9-b96b-88e9fe637760 |
| RegionId |
string |
Yes |
ID wilayah tempat sumber daya berada. Anda dapat memanggil operasi DescribeRegions untuk mengkueri daftar wilayah terbaru. |
cn-hangzhou |
| NextToken |
string |
No |
Token paginasi yang digunakan di permintaan berikutnya untuk mengambil halaman hasil baru.
|
caeba0bbb2be03f84eb48b699f0a**** |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
8D8992C1-6712-423C-BAC5-E5E817484C6B |
| TagResources |
array<object> |
The resources to which the tags are added. |
|
|
object |
The resources to which the tags are added. |
||
| TagKey |
string |
The key of tag N added to the resource. |
endpoint |
| TagValue |
string |
The value of tag N added to the resource. |
FinanceJoshua |
| ResourceId |
string |
The resource ID. |
ep-hp3i05294c2d2d****** |
| ResourceType |
string |
The type of the resource. Valid values:
|
vpcendpoint |
| NextToken |
string |
The pagination token that is used in the next request to retrieve a new page of results. Valid values:
|
caeba0bbb2be03f84eb48b699f0a4883 |
Contoh
Respons sukses
JSONformat
{
"RequestId": "8D8992C1-6712-423C-BAC5-E5E817484C6B",
"TagResources": [
{
"TagKey": "endpoint",
"TagValue": "FinanceJoshua",
"ResourceId": "ep-hp3i05294c2d2d******",
"ResourceType": "vpcendpoint"
}
],
"NextToken": "caeba0bbb2be03f84eb48b699f0a4883"
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | DuplicatedTagKey | The tag keys is duplicated. | |
| 400 | MissingTagKeyParam | The tag key is empty. | |
| 400 | MissingTagValueParam | The tag value is empty. | |
| 400 | MissingResourceIdOrTagParam | The resource id and tag is empty. | |
| 400 | IllegalTagKeyParam | IllegalTagKeyParam | |
| 400 | IllegalTagValueParam | The tag value is Illegal. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.