Elastic Compute Service (ECS) リソースにタグを作成して追加します。
操作説明
注意事項
リソースにタグを追加する前に、Alibaba Cloud はリソースの既存のタグ数を確認します。 タグ数が上限に達した場合、エラーメッセージが返されます。 詳細については、「タグの制限」をご参照ください。
今すぐお試しください
テスト
RAM 認証
|
アクション |
アクセスレベル |
リソースタイプ |
条件キー |
依存アクション |
|
ecs:TagResources |
create |
DedicatedHost
Disk
NetworkInterface
Image
Instance
KeyPair
LaunchTemplate
ReservedInstance
SecurityGroup
Snapshot
AutoSnapshotPolicy
|
なし | なし |
リクエストパラメーター
|
パラメーター |
型 |
必須 / 任意 |
説明 |
例 |
| RegionId |
string |
必須 |
リソースのリージョン ID。 DescribeRegions 操作を呼び出して、最新のリージョンリストを照会できます。 |
cn-hangzhou |
| RegionId |
string |
必須 |
リソースのリージョン ID。 DescribeRegions 操作を呼び出して、最新のリージョンリストを照会できます。 |
cn-hangzhou |
| ResourceType |
string |
必須 |
タグを追加するリソースのタイプ。 有効値:
|
instance |
| ResourceId |
array |
必須 |
リソース ID。 最大 50 個のリソース ID を指定できます。 |
i-bp67acfmxazb4ph**** |
|
string |
任意 |
リソース N の ID。 |
r-XXX |
|
| Tag |
array<object> |
必須 |
リザーブドインスタンスのタグです。最大 20 個のタグを指定できます。複数のタグを指定する場合、タグキーを重複させることはできません。 |
|
|
object |
任意 |
タグ N。 |
||
| Key |
string |
必須 |
タグキーは、null または空文字列にすることはできません。 タグキーは最大 128 文字で、 |
TestKey |
| Value |
string |
必須 |
タグ N の値。タグ値は null にはできませんが、空の文字列は使用できます。長さは最大 128 文字で、 |
TestValue |
レスポンスフィールド
|
フィールド |
型 |
説明 |
例 |
|
object |
|||
| RequestId |
string |
リクエストの ID。 |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
例
成功レスポンス
JSONJSON
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
エラーコード
|
HTTP ステータスコード |
エラーコード |
エラーメッセージ |
説明 |
|---|---|---|---|
| 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. | |
| 500 | ServiceUnavailable | The service is unavailable, please try again later. | |
| 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 | NoPermissionKey.Scope | %s | |
| 403 | NoPermission.Tag | The operator is not permission for the tag. | |
| 403 | QuotaExceed.Tags | %s | |
| 403 | TagKey.Duplication | The TagKey has duplication with others, case-insensitive. | |
| 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. |
完全なリストについては、「エラーコード」をご参照ください。
変更履歴
完全なリストについては、「変更履歴」をご参照ください。