すべてのプロダクト
Search
ドキュメントセンター

:ListTagResources

最終更新日:Jul 14, 2026

複数のクラウドサービスにまたがる複数のクラウドリソースにバインドされたタグを照会します。

操作説明

タグをサポートするクラウドサービスについては、「タグをサポートするクラウドサービス」をご参照ください。

今すぐお試しください

この API を OpenAPI Explorer でお試しください。手作業による署名は必要ありません。呼び出しに成功すると、入力したパラメーターに基づき、資格情報が組み込まれた SDK コードが自動的に生成されます。このコードをダウンロードしてローカルで使用できます。

テスト

RAM 認証

下表に、この API を呼び出すために必要な認証情報を示します。認証情報は、RAM (Resource Access Management) ポリシーを使用して定義できます。以下で各列名について説明します。

  • アクション:特定のリソースに対して実行可能な操作。ポリシー構文ではAction要素として指定します。

  • API:アクションを具体的に実行するための API。

  • アクセスレベル:各 API に対して事前定義されているアクセスの種類。有効な値:create、list、get、update、delete。

  • リソースタイプ:アクションが作用するリソースの種類。リソースレベルでの権限をサポートするかどうかを示すことができます。ポリシーの有効性を確保するため、アクションの対象として適切なリソースを指定してください。

    • リソースレベルの権限を持つ API の場合、必要なリソースタイプはアスタリスク (*) でマークされます。ポリシーのResource要素で対応する ARN を指定してください。

    • リソースレベルの権限を持たない API の場合、「すべてのリソース」と表示され、ポリシーのResource要素でアスタリスク (*) でマークされます。

  • 条件キー:サービスによって定義された条件のキー。このキーにより、きめ細やかなアクセス制御が可能になります。この制御は、アクション単体に適用することも、特定のリソースに対するアクションに適用することもできます。Alibaba Cloud は、サービス固有の条件キーに加えて、すべての RAM 統合サービスに適用可能な一連の共通条件キーを提供しています。

  • 依存アクション:ある特定のアクションを実行するために、前提として実行が必要となる他のアクション。依存アクションの権限も RAM ユーザーまたは RAM ロールに付与する必要があります。

アクション

アクセスレベル

リソースタイプ

条件キー

依存アクション

tag:ListTagResources

get

*All Resource

*

なし なし

リクエストパラメーター

パラメーター

必須 / 任意

説明

RegionId

string

必須

リージョン ID。有効な値:

cn-hangzhou

RegionId

string

必須

次のクエリのトークン。

cn-hangzhou

NextToken

string

任意

1 ページあたりのエントリ数。

最大値: 1000。デフォルト値: 50。

caeba0bbb2be03f84eb48b699f0a****

PageSize

integer

任意

タグキーとタグ値。1~10 のキーと値のペアを指定できます。

複数のタグを指定した場合、システムは指定されたすべてのタグがバインドされているリソースを照会します。

使用制限:

  • タグキーの長さは 1~128 文字である必要があります。

  • タグ値の長さは 1~128 文字である必要があります。

  • タグキーとタグ値は大文字と小文字が区別されます。

  • リソース上の各タグキーには、タグ値を 1 つだけ設定できます。既存のタグと同じキーを持つタグを追加した場合、新しいタグ値によって既存のタグ値が上書きされます。

50

Tags

string

任意

タグタイプ。有効な値:

  • Custom: カスタムタグ。

  • System: システムタグ。

  • All: すべてのタグ。

デフォルト値: All。

{"k1":"v1","k2":"v2"}

Category

string

任意

リソースの Amazon リソースネーム (ARN)。

N の有効な値: 1~50。

リソース ARN のフォーマット: arn:acs:${ProductCode}:${Region}:${Account}:${ResourceType}/${ResourceId}。各フィールドの説明は以下のリストのとおりです。

  • ProductCode: クラウドサービスコード。値は ListSupportResourceTypes の応答から取得できます。

  • Region: リソースのリージョン ID。アスタリスク (*) を使用して現在のリージョンを示すことができます。

  • Account: Alibaba Cloud アカウント ID。アスタリスク (*) を使用して現在の Alibaba Cloud アカウントを示すことができます。

  • ResourceType: リソースタイプ。値は ListSupportResourceTypes の応答から取得できます。

  • ResourceId: リソース ID。

説明

ResourceARN は、リソースグループ、ActionTrail、およびリソース管理の ProductCode および ResourceType の値をサポートします。

Custom

ResourceARN

array

任意

Alibaba Cloud リソース名 (ARN)。

N の有効範囲:1~50。

ARN の形式:arn:acs:${ProductCode}:${Region}:${Account}:${ResourceType}/${ResourceId} 各フィールドの説明:

  • ProductCode:サービスコード。このフィールドには、 ListSupportResourceTypes 操作のレスポンスから取得した値を指定できます。

  • Region:リソースのリージョン ID。現在のリージョンを示す場合はアスタリスク (*) を指定できます。

  • Account:リソースが属する Alibaba Cloud アカウントの ID。現在の Alibaba Cloud アカウントを示す場合はアスタリスク (*) を指定できます。

  • ResourceType:リソースタイプ。このフィールドには、 ListSupportResourceTypes 操作のレスポンスから取得した値を指定できます。

  • ResourceId:リソース ID。

説明

ProductCode および ResourceType には、リソースグループ、ActionTrail、またはリソースセンターで定義された値を指定できます。

arn:acs:ecs:cn-hangzhou:123456789****:instance/i-bp15hr53jws84akg****

string

任意

リソースの ARN。

arn:acs:ecs:cn-hangzhou:123456789****:instance/i-bp15hr53jws84akg****

共通リクエストパラメーターの詳細については、「共通パラメーター」をご参照ください。

レスポンスフィールド

フィールド

説明

object

応答パラメーター。

NextToken

string

次のトークンが存在するかどうかを示します。有効な値:

  • NextToken が空 ("NextToken": "") の場合、次のページは存在しません。

  • NextToken に値がある場合、その値は次のクエリのトークンです。

caeba0bbb2be03f84eb48b699f0a****

RequestId

string

リクエスト ID。

014738E0-3C7F-47D8-8FB9-469500C6F387

TagResources

array<object>

リソースにバインドされたタグ。

array<object>

リソースにバインドされたタグ。

ResourceARN

string

リソース ARN。

arn:acs:ecs:cn-hangzhou:123456789****:instance/i-bp15hr53jws84akg****

Tags

array<object>

タグ情報のフォーマット。

object

タグ情報のフォーマット。

Key

string

タグキー。

k1

Value

string

タグ値。

v1

Category

string

タグの種類。有効な値:

  • Custom

  • System

Custom

成功レスポンス

JSONJSON

{
  "NextToken": "caeba0bbb2be03f84eb48b699f0a****",
  "RequestId": "014738E0-3C7F-47D8-8FB9-469500C6F387",
  "TagResources": [
    {
      "ResourceARN": "arn:acs:ecs:cn-hangzhou:123456789****:instance/i-bp15hr53jws84akg****",
      "Tags": [
        {
          "Key": "k1",
          "Value": "v1",
          "Category": "Custom"
        }
      ]
    }
  ]
}

エラーコード

HTTP ステータスコード

エラーコード

エラーメッセージ

説明

400 InvalidResourceARN.Account The Account specified in the ResourceARN parameter does not match the actual account, specifically: %s.
400 InvalidResourceARN.FormatError The format of parameter ResourceARN: %s is not valid, for the correct format, you can refer to the Recommend.
400 InvalidResourceARN.Region The Region specified in the ResourceARN parameter does not match the RegionId parameter, specifically: %s.
400 InvalidParameter.TagKey The TagKey parameter is invalid. The following TagKeys are invalid: %s.
400 InvalidParameter.Tags The Tags parameter cannot be empty, and JSON parsing should adhere to the format of a Map.
400 InvalidParameter.RegionId %s.
400 Throttling You have exceeded the maximum traffic. To increase the limit, submit a ticket.
403 Duplicate.TagKey The Tag.N.Key contains duplicate keys. The Tag.N.Key contains duplicate keys.
403 InvalidParameter.Category The specified Category is invalid. Valid values are Custom and System. The specified Category is invalid. Valid values are Custom and System.
403 MissingParameter.ResourceIds You must specify ResourceIds. You must specify ResourceIds.
403 NoPermission.Operator The user is not authorized to operate on the specified resource. The user is not authorized to operate on the specified resource.
403 NoPermission.SystemTag The user does not have permission to operate the system tag. The user does not have permission to operate the system tag.
403 NoPermissionKey.Category Some keys cannot be modified because the user does not have permission. Some keys cannot be modified because the user does not have permission.
403 NoPermissionKey.Operator You are not authorized to operate the tag key. You are not authorized to operate the tag key.
403 NumberExceed.ResourceIds The maximum number of ResourceIds is exceeded. The maximum number of ResourceIds is exceeded.
403 NumberExceed.Tags The maximum number of Tags is exceeded. The maximum number of Tags is exceeded.
403 QuotaExceed.TagsPerResource The maximum number of tags for each resource is exceeded. The maximum number of tags for each resource is exceeded.
403 Invalid.NextToken The parameter NextToken is invalid. The parameter NextToken is invalid.
403 InvalidParameter.TagValue The Tag.N.Value parameter is invalid. The Tag.N.Value parameter is invalid.
403 InvalidParameter.ResourceType The ResourceType parameter is invalid.
404 Missing.TagKey Tag.N.Value has been specified and you must specify Tag.N.Key. Tag.N.Value has been specified and you must specify Tag.N.Key.
404 MissingParameter.AliUid You must specify AliUid. You must specify AliUid.
404 MissingParameter.Bid You must specify Bid. You must specify Bid.
404 MissingParameter.RegionId You must specify RegionId. You must specify RegionId.
404 MissingParameter.RemoveNum You must specify RemoveNum. You must specify RemoveNum.
404 MissingParameter.ResourceIdARN You must specify ResourceIdARN. You must specify ResourceIdARN.
404 MissingParameter.TagKey You must specify TagKey. You must specify TagKey.
404 MissingParameter.Tags You must specify Tags. You must specify Tags.
404 NoMatch.RemoveNum The specified DataNum does not match the deleted number. The specified DataNum does not match the deleted number.

完全なリストについては、「エラーコード」をご参照ください。

変更履歴

完全なリストについては、「変更履歴」をご参照ください。