為指定的ECS資源清單統一建立並綁定標籤。
介面說明
介面說明
綁定標籤前,阿里雲會校正資源已有標籤數量。超過限制值後返回報錯資訊。更多資訊,請參見使用限制。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
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 數組。數組長度:1~50。 |
i-bp67acfmxazb4ph**** |
|
string |
否 |
資源 ID。 |
r-XXX |
|
| Tag |
array<object> |
是 |
標籤數組。數組長度:1~20。如果數組中有多個標籤對象,標籤鍵 |
|
|
object |
否 |
標籤對象。 |
||
| Key |
string |
是 |
標籤鍵,不允許為空白和Null 字元串。最多支援 128 個字元,不能以 |
TestKey |
| Value |
string |
是 |
標籤值。不允許為空白,可以為空白字串。最多支援 128 個字元,不能包含 |
TestValue |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
|||
| RequestId |
string |
請求 ID。 |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
樣本
正常返回樣本
JSON格式
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | NumberExceed.ResourceIds | The ResourceIds parameter's number is exceed , Valid : 50. | 指定的ResourceIds參數的數量超過限制。 |
| 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. | 指定的 Tag.N.Key 和 Tag.N.Value 不匹配。 |
| 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 | 標籤數超過可以配置的最大數量。%s為變數,將根據調用API的實際情況動態返回錯誤資訊。 |
| 403 | TagKey.Duplication | The TagKey has duplication with others, case-insensitive. | 指定的 Tag.N.Key 參數中存在重複的取值。該參數的取值不區分大小寫,請檢查是否傳入了重複的參數值。 |
| 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. | 參數ResourceType不可為空。 |
| 404 | MissingParameter.Tags | The parameter - Tags should not be null. | |
| 404 | MissingParameter.RegionId | The parameter - RegionId should not be null. | 必填參數RegionId為空白。 |
| 404 | InvalidResourceId.NotFound | The specified ResourceIds are not found in our records. | 指定的資源不存在,請檢查參數 ResourceId 是否正確。 |
| 404 | InvalidResourceType.NotFound | The ResourceType provided does not exist in our records. | 指定的資源類型不存在。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。