You need to enable JavaScript to run this app.
文档中心
服务器迁移中心

服务器迁移中心

复制全文
下载 pdf
标签
TagResources - 创建标签
复制全文
下载 pdf
TagResources - 创建标签
调用 TagResources 接口,为指定的SMC迁移源、迁移任务创建并绑定标签。​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
下方仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。​
Action string 必选 示例值:TagResources​
要执行的操作,取值:TagResources。​
​
Version string 必选 示例值:2020-04-01​
API的版本,取值:2020-04-01。​
​
ClientToken string 可选 示例值:333456899ff****​
保证请求幂等性。由客户端自动生成一个参数值,确保不同请求间该参数值唯一,避免当调用API超时或服务器内部错误时,客户端多次重试导致重复性操作。​
取值:仅支持ASCII字符,且不能超过64个字符。​
​
ResourceIds.N string[] 必选 示例值:ResourceIds.1=job-3tiegs1y963vj0****&ResourceIds.2=job-4segs15yts2ls****​
资源ID。​
  • 参数 - N:表示资源的序号,取值范围:1~50。​
  • 多个资源之间用&分隔。​
​
ResourceType string 必选 示例值:migrationjob​
资源类型,取值:​
  • migrationsource:迁移源。​
  • migrationjob:迁移任务。​
​
Tags.N.Key string[] 必选 示例值:Tags.1.Key=k1&Tags.2.Key=k2​
为资源添加的用户标签的标签键。​
  • 参数 - N:表示标签键的序号,取值范围:1~20。​
  • 多个标签键之间用&分隔。​
  • 命名规则如下:​
  • 不能以任何大小写形式的volc:、sys:开头。​
volc:、sys:开头为系统预留标签键禁止创建。​
  • 只能包含语言字符、数字、空格和英文符号“_”、“.”、“:”、“/”、“=”、“+”、“-”、“@”。​
  • 长度限制在1~128个字符之间。​
​
Tags.N.Value string[] 可选 示例值:Tags.1.Value=v1&Tags.2.Value=v2​
为资源添加的用户标签的标签值。​
  • 参数 - N:表示标签值的序号,取值范围:1~20。​
  • 多个标签值之间用&分隔。​
  • 命名规则如下:​
  • 只能包含语言字符、数字、空格和英文符号“_”、“.”、“:”、“/”、“=”、“+”、“-”、“@”。​
  • 允许为空,长度限制在0~256个字符之间。​
​
​
​
返回参数​
下方仅列出本接口特有的返回参数。更多信息请参见返回结构。​
OperationDetails object[] 示例值:--​
操作详情。​
Error object 示例值:--​
操作的资源错误信息。​
Code string 示例值:InvalidResourceId.NotFound​
批量操作时具体单个请求失败的错误码。取值:​
  • InvalidResourceIds.NotFound:指定的资源不存在。​
  • InvalidActionOrVersion:请求接口不存在。​
  • MissingParameter.ResourceIds:资源ID参数不能为空。​
说明​
Code与Message一一对应。​
​
Message string 示例值:The specified ResourceId does not exist.​
批量操作时具体单个请求失败的错误信息。取值:​
  • The specified resourceids do not exist.:指定的资源不存在。​
  • Could not find operation %s for version %s.:请求接口不存在。​
  • The required parameter resourceids is not supplied.:资源ID参数不能为空。​
​
​
ResourceId string 示例值:job-3tiegs1y963vj0****​
操作的资源ID。​
​
​
​
​
请求示例​
​
GET /?Action=TagResources&Version=2020-04-01&ResourceType=migrationjob&ResourceIds.1=job-3tiegs1y963vj0****&ResourceIds.2=job-4segs15yts2ls****&Tags.1.Key=key1&Tags.2.Key=k2&Tags.1.Value=v1&Tags.2.Value=2 HTTP/1.1​
Host: smc.volcengineapi.com​
Region: cn-beijing​
Service: smc​
​
返回示例​
​
{​
"ResponseMetadata":{​
"RequestId":"202306021637410F150D*****",​
"Action":"TagResources",​
"Version":"2020-04-01",​
"Service":"smc",​
"Region":"cn-beijing"​
},​
"Result":{​
"OperationDetails":[​
{​
"Error":null,​
"ResourceId":"job-3tiegs1y963vj0****"​
},​
{​
"Error":{​
"Code":"InvalidResourceId.NotFound",​
"Message":"The specified ResourceId does not exist."​
},​
"ResourceId":"job-4segs15yts2ls****"​
}​
]​
}​
}​
​
错误码​
下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。​
​
状态码​
错误码​
错误信息​
说明​
400​
InvalidResourceIds.NotFound​
The specified resourceids do not exist.​
指定的资源不存在。​
400​
InvalidTagValue.Malformed​
The specified TagValue is malformed.​
指定的标签的值不合法。​
400​
LimitExceeded.MaximumResourceIds​
You've reached the limit on the number of ResourceIds that you can set.​
指定的资源ID数量超过最大限制。​
400​
LimitExceeded.MaximumTags​
You've reached the limit on the number of tags that you can create.​
指定的标签数量超过最大限制。​
400​
MissingParameter.Tags​
The required parameter tags is not supplied.​
标签参数不能为空。​
400​
InvalidTagKey.Malformed​
The specified TagKey is malformed.​
指定的TagKey不合法​
404​
InvalidActionOrVersion​
Could not find operation %s for version %s.​
请求接口不存在。​
409​
InvalidTagKey.Conflict​
The specified TagKey already exists.​
指定的标签键已存在。​
​
​
最近更新时间:2025.12.16 11:23:08
这个页面对您有帮助吗?
有用
有用
无用
无用