1 つ以上の Elastic Compute Service (ECS) リソースのタグを一覧表示します。
操作説明
API
特定のリソースを検索するには、リクエストに次のパラメーターを 1 つ以上含めてください。
ResourceId.NTag.N(Tag.N.KeyとTag.N.Value)TagFilter.N
次のパラメーターの組み合わせを指定した場合、API はすべての条件に一致する ECS リソースのみを返します。
Tag.NとResourceId.NTagFilter.NとResourceId.N
今すぐお試しください
テスト
RAM 認証
|
アクション |
アクセスレベル |
リソースタイプ |
条件キー |
依存アクション |
|
ecs:ListTagResources |
get |
*All Resource
|
なし | なし |
リクエストパラメーター
|
パラメーター |
型 |
必須 / 任意 |
説明 |
例 |
| RegionId |
string |
必須 |
リソースが所在するリージョンの ID です。DescribeRegions API を呼び出して、Alibaba Cloud リージョンの最新リストを表示できます。 |
cn-hangzhou |
| RegionId |
string |
必須 |
|
cn-hangzhou |
| NextToken |
string |
任意 |
次のページの結果を取得するためのページネーショントークンです。 |
caeba0bbb2be03f84eb48b699f0a4883 |
| ResourceType |
string |
必須 |
リソースタイプです。有効な値:
|
instance |
| ResourceId |
array |
任意 |
ECS リソースの ID です。N の値は 1~50 です。 |
i-bp1j6qtvdm8w0z1o**** |
|
string |
任意 |
|
i-bp1j6qtvdm8w0z1o**** |
|
| Tag |
array<object> |
任意 |
タグのリストです。 |
|
|
object |
任意 |
|
||
| Key |
string |
任意 |
完全一致に使用するタグキーです。タグキーは 1~128 文字である必要があります。N の値は 1~20 です。
|
TestKey |
| Value |
string |
任意 |
完全一致に使用するタグ値です。タグ値は 1~128 文字である必要があります。N の値は 1~20 です。 説明
|
TestValue |
| TagFilter |
array<object> |
任意 |
タグフィルターのリストです。 説明
このパラメーターは招待制プレビューのため、まだご利用いただけません。 |
|
|
object |
任意 |
|
||
| TagValues |
array |
任意 |
あいまい一致に使用するタグ値です。タグ値は 1~128 文字である必要があります。N の値は 1~5 です。詳細については、 |
TestTagFilter |
|
string |
任意 |
|
TestTagFilter |
|
| TagKey |
string |
任意 |
あいまい一致に使用するタグキーです。タグキーは 1~128 文字である必要があります。N の値は 1~5 です。
説明
同じリクエストで |
env |
レスポンスフィールド
|
フィールド |
型 |
説明 |
例 |
|
object |
|||
| NextToken |
string |
次のページを取得するためのトークンです。 |
caeba0bbb2be03f84eb48b699f0a4883 |
| RequestId |
string |
リクエスト ID です。 |
484256DA-D816-44D2-9D86-B6EE4D5BA78C |
| TagResources |
object |
||
| TagResource |
array<object> |
タグとリソースの関連情報の配列です。配列内の各オブジェクトには、リソース ID、リソースタイプ、タグキー、およびタグ値が含まれます。 |
|
|
object |
|||
| TagValue |
string |
タグ値です。 |
TestValue |
| ResourceType |
string |
リソースタイプです。有効な値:
|
instance |
| ResourceId |
string |
リソース ID です。 |
i-bp1j6qtvdm8w0z1o**** |
| TagKey |
string |
タグキーです。 |
TestKey |
例
成功レスポンス
JSONJSON
{
"NextToken": "caeba0bbb2be03f84eb48b699f0a4883",
"RequestId": "484256DA-D816-44D2-9D86-B6EE4D5BA78C",
"TagResources": {
"TagResource": [
{
"TagValue": "TestValue",
"ResourceType": "instance",
"ResourceId": "i-bp1j6qtvdm8w0z1o****",
"TagKey": "TestKey"
}
]
}
}
エラーコード
|
HTTP ステータスコード |
エラーコード |
エラーメッセージ |
説明 |
|---|---|---|---|
| 400 | InvalidDefaultResourceGroup.NotSupported | The specified parameter Tag is not support for default resource group. | |
| 400 | InvalidTag.NotSupported | You can only specify Tag for either resource tag or resource group. | |
| 400 | NumberExceed.ResourceIds | The ResourceIds parameter's number is exceed , Valid : 50. | |
| 400 | NumberExceed.Tags | The Tags parameter's number is exceed , Valid : 20. | |
| 400 | Duplicate.TagKey | The Tag.N.Key contain duplicate key. | |
| 400 | InvalidTagKey.Malformed | The specified Tag.n.Key is not valid. | |
| 400 | InvalidTagValue.Malformed | The specified Tag.n.Value is not valid. | |
| 400 | OperationDenied.QuotaExceed | The quota of tags on resource is beyond permitted range. | |
| 400 | InvalidTag.Mismatch | The specified Tag.n.Key and Tag.n.Value are not match. | |
| 400 | InvalidTagCount | The specified tags are beyond the permitted range. | |
| 400 | Invalid.Scope | The specified scope is invalid. | |
| 400 | InvalidTags.MalFormed | The tags must be empty, when the tagFilters is not empty. | |
| 500 | ServiceUnavailable | The service is unavailable, please try again later. | |
| 500 | InternalError | The process of creating snapshot has failed due to some unknown error. | |
| 403 | PermissionDenied.TagOwnerBid | The specified operator not have permission to set TagOwnerBid value. | |
| 403 | PermissionDenied.TagOwnerUid | The specified operator not have permission to set TagOwnerUid value. | |
| 403 | PermissionDenied.Scope | The specified operator not have permission to set Scope value. | |
| 403 | InvalidResourceId.NotSupported | The specified ResourceId does not support tagging. | |
| 403 | NoPermission.Tag | The operator is not permission for the tag. | |
| 403 | BothEmpty.TagsAndResources | The specified Tags and ResourcesIds are not allow to both empty. | |
| 403 | PermissionDenied.TagsFuzzyQuery | The specified operator has not permission to query fuzzy tags. | |
| 403 | NumberExceed.TagValues | The number of the specified TagValues is beyond permitted range, the max is 5. | |
| 403 | InvalidFilter.Malformed | The specified Filter is not valid. | |
| 403 | InvalidTagFilter.Malformed | The specified TagFilter is not valid. | |
| 403 | Invalid.NextToken | The specified NextToken is not valid. | |
| 404 | InvalidRegionId.NotFound | The RegionId provided does not exist in our records. | |
| 404 | MissingParameter.ResourceIds | The parameter - ResourceIds.N should not be null. | |
| 404 | MissingParameter.TagOwnerUid | The parameter - TagOwnerUid should not be null. | |
| 404 | MissingParameter.TagOwnerBid | The parameter - TagOwnerBid should not be null. | |
| 404 | MissingParameter.ResourceType | The parameter - ResourceType should not be null. | |
| 404 | MissingParameter.Tags | The parameter - Tags should not be null. | |
| 404 | MissingParameter.RegionId | The parameter - RegionId should not be null. | |
| 404 | InvalidResourceId.NotFound | The specified ResourceIds are not found in our records. | |
| 404 | InvalidResourceType.NotFound | The ResourceType provided does not exist in our records. |
完全なリストについては、「エラーコード」をご参照ください。
変更履歴
完全なリストについては、「変更履歴」をご参照ください。