為指定的多個(gè)云產(chǎn)品的多個(gè)云資源統(tǒng)一創(chuàng)建并綁定標(biāo)簽。
接口說(shuō)明
標(biāo)簽是云資源的標(biāo)識(shí),可以幫助您從不同維度對(duì)具有相同特征的云資源進(jìn)行分類(lèi)、搜索和聚合,讓資源管理變得更加輕松。更多信息,請(qǐng)參見(jiàn)標(biāo)簽概述。
支持標(biāo)簽的云服務(wù),請(qǐng)參見(jiàn)支持標(biāo)簽的云服務(wù)。
調(diào)試
您可以在OpenAPI Explorer中直接運(yùn)行該接口,免去您計(jì)算簽名的困擾。運(yùn)行成功后,OpenAPI Explorer可以自動(dòng)生成SDK代碼示例。
授權(quán)信息
下表是API對(duì)應(yīng)的授權(quán)信息,可以在RAM權(quán)限策略語(yǔ)句的Action
元素中使用,用來(lái)給RAM用戶(hù)或RAM角色授予調(diào)用此API的權(quán)限。具體說(shuō)明如下:
- 操作:是指具體的權(quán)限點(diǎn)。
- 訪(fǎng)問(wèn)級(jí)別:是指每個(gè)操作的訪(fǎng)問(wèn)級(jí)別,取值為寫(xiě)入(Write)、讀?。≧ead)或列出(List)。
- 資源類(lèi)型:是指操作中支持授權(quán)的資源類(lèi)型。具體說(shuō)明如下:
- 對(duì)于必選的資源類(lèi)型,用背景高亮的方式表示。
- 對(duì)于不支持資源級(jí)授權(quán)的操作,用
全部資源
表示。
- 條件關(guān)鍵字:是指云產(chǎn)品自身定義的條件關(guān)鍵字。
- 關(guān)聯(lián)操作:是指成功執(zhí)行操作所需要的其他權(quán)限。操作者必須同時(shí)具備關(guān)聯(lián)操作的權(quán)限,操作才能成功。
操作 | 訪(fǎng)問(wèn)級(jí)別 | 資源類(lèi)型 | 條件關(guān)鍵字 | 關(guān)聯(lián)操作 |
---|---|---|---|---|
tag:TagResources | Write |
|
|
|
請(qǐng)求參數(shù)
名稱(chēng) | 類(lèi)型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
RegionId | string | 是 | 地域 ID。取值:
| cn-hangzhou |
Tags | string | 是 | 標(biāo)簽鍵和標(biāo)簽值。鍵值對(duì)取值范圍:1~10。 如果指定多個(gè)標(biāo)簽,則會(huì)為指定資源同時(shí)創(chuàng)建并綁定該多個(gè)標(biāo)簽。 約束如下:
| {"k1":"v1","k2":"v2"} |
ResourceARN | array | 是 | 資源 ARN(Aliyun Resource Name)。 | |
string | 是 | 資源 ARN(Aliyun Resource Name)。 N 的取值范圍:1~50。 資源 ARN 的格式:
說(shuō)明
ResourceARN 支持傳遞資源組、操作審計(jì)和資源管理的 ProductCode 和ResourceType 。
| arn:acs:vpc:cn-hangzhou:123456789****:vpc/vpc-bp19dd90tkt6tz7wu**** |
關(guān)于公共請(qǐng)求參數(shù)的詳情,請(qǐng)參見(jiàn)公共參數(shù)。
返回參數(shù)
示例
正常返回示例
JSON
格式
{
"RequestId": "72086426-9F8C-4A60-852B-864048FD1199",
"FailedResources": {
"FailedResource": [
{
"ResourceARN": "arn:acs:vpc:cn-hangzhou:123456789****:vpc/vpc-bp19dd90tkt6tz7wu****",
"Result": {
"Code": "InvalidResourceId.NotFound",
"Message": "The specified ResourceIds are not found in our records."
}
}
]
}
}
錯(cuò)誤碼
HTTP status code | 錯(cuò)誤碼 | 錯(cuò)誤信息 | 描述 |
---|---|---|---|
400 | InvalidResourceARN.Region | The Region specified in the ResourceARN parameter does not match the RegionId parameter, specifically: %s. | ResourceARN中的Region與參數(shù)RegionId不匹配,它們分別是:%s |
400 | InvalidResourceARN.Account | The Account specified in the ResourceARN parameter does not match the actual account, specifically: %s. | ResourceARN中的Account與實(shí)際用戶(hù)不吻合,分別是:%s |
400 | InvalidResourceARN.FormatError | The format of parameter ResourceARN: %s is not valid, for the correct format, you can refer to the Recommend. | ResourceARN的格式不符合規(guī)范,正確的格式請(qǐng)參考錯(cuò)誤診斷。 |
400 | InvalidParameter.ResourceType | The parameter resource type: %s in ResourceARN is not valid or not support. | 在ResourceARN中的ResourceType:%s 不合法或不被支持。 |
400 | InvalidParameter.ServiceCode | The parameter service code: %s in ResourceARN is not valid or not support. | ResourceARN中的ServiceCode:%s 不合法或未被支持。 |
400 | InvalidParameter.TagKey | The TagKey parameter is invalid. The following TagKeys are invalid: %s. | 參數(shù)中存在不合法的標(biāo)簽鍵,不合法的標(biāo)簽鍵如下:%s |
400 | InvalidParameter.TagValue | The TagValue parameter is invalid. The following TagValues are invalid: %s. | 參數(shù)中包含不合法的標(biāo)簽值,不合法的標(biāo)簽值如下:%s |
400 | InvalidParameter.Tags | The Tags parameter cannot be empty, and JSON parsing should adhere to the format of a Map. | 參數(shù)Tags不能為空,JSON解析需符合Map的格式,比如 {"key":"value"} |
403 | Duplicate.TagKey | The Tag.N.Key contains duplicate keys. | 參數(shù)包含重復(fù)標(biāo)簽鍵。 |
403 | InvalidParameter.Category | The specified Category is invalid. Valid values are Custom and System. | 標(biāo)簽類(lèi)型非法,合法值為Custom,System。 |
403 | MissingParameter.Createby | You must specify Createby. | 操作者參數(shù)不可為空。 |
403 | MissingParameter.ResourceIds | You must specify ResourceIds. | 資源列表參數(shù)不可為空。 |
403 | NoPermission.Operator | The user is not authorized to operate on the specified resource. | 該用戶(hù)沒(méi)有權(quán)限操作。 |
403 | NoPermissionKey.Category | Some keys cannot be modified because the user does not have permission. | 某些key的標(biāo)簽類(lèi)型沒(méi)有操作權(quán)限。 |
403 | NoPermissionKey.Operator | You are not authorized to operate the tag key. | 該用戶(hù)沒(méi)有操作此標(biāo)簽鍵權(quán)限。 |
403 | NumberExceed.ResourceIds | The maximum number of ResourceIds is exceeded. | 資源列表參數(shù)數(shù)量超限。 |
403 | NumberExceed.Tags | The maximum number of Tags is exceeded. | 標(biāo)簽參數(shù)數(shù)量超限。 |
403 | QuotaExceed.TagsPerResource | The maximum number of tags for each resource is exceeded. | 每個(gè)資源上的標(biāo)簽數(shù)量有限制,目前有資源已經(jīng)超限。 |
404 | Missing.TagKey | Tag.N.Value has been specified and you must specify Tag.N.Key. | 一對(duì)鍵值對(duì),對(duì)應(yīng)的TagValue缺失相同N的TagKey。 |
404 | MissingParameter.AliUid | You must specify AliUid. | 缺失用戶(hù)UID參數(shù)。 |
404 | MissingParameter.Bid | You must specify Bid. | bid參數(shù)不可為空。 |
404 | MissingParameter.TagKey | You must specify TagKey. | 標(biāo)簽鍵參數(shù)不可為空。 |
訪(fǎng)問(wèn)錯(cuò)誤中心查看更多錯(cuò)誤碼。
變更歷史
變更時(shí)間 | 變更內(nèi)容概要 | 操作 |
---|---|---|
2024-02-27 | OpenAPI 錯(cuò)誤碼發(fā)生變更 | 查看變更詳情 |