最近更新时间:2023.07.25 18:39:31
首次发布时间:2022.09.02 08:59:16
调用 CreateTags 接口为一个或多个资源添加用户标签。
说明
名称 | 类型 | 是否必填 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | CreateTags | 要执行的操作,取值:CreateTags。 |
Version | String | 是 | 2020-04-01 | API的版本,取值:2020-04-01。 |
ResourceType | String | 是 | instance | 资源类型,取值:
|
ResourceIds.N | String | 是 | ResourceIds.1=i-l8u0p77yseabkpak****&ResourceIds.2=i-l8u0p7xyseabkbak**** | 资源ID。
|
Tags.N.Key | String | 是 | Tags.1.Key=k1 | 为资源添加的用户标签的标签键。
|
Tags.N.Value | String | 否 | Tags.1.Value=v1 | 为资源添加的用户标签的标签值。
|
ClientToken | String | 否 | 333456899ff**** | 保证请求幂等性。由客户端自动生成一个参数值,确保不同请求间该参数值唯一,避免当调用API超时或服务器内部错误时,客户端多次重试导致重复性操作。 |
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
OperationDetails | Array of Struct | - | 操作详情,具体请参见下表“ OperationDetails结构 ”。 |
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
Error | Struct | - | 操作的资源错误信息,具体请参见下表“ Error结构 ”。 |
ResourceId | String | i-l8u0p77yseabkpak**** | 操作的资源ID。 |
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
Code | String | InvalidResourceId.NotFound | 批量操作时具体单个请求失败的错误码,具体请参见下表“ 错误码(批量操作时具体单个请求失败)”。 |
Message | String | The specified ResourceId does not exist. | 批量操作时具体单个请求失败的错误信息,具体请参见下表“ 错误码(批量操作时具体单个请求失败)”中的错误信息。 |
错误码 | 错误信息 | 描述 |
---|---|---|
InvalidResourceId.NotFound | The specified ResourceId does not exist. | 指定的资源不存在。 |
InvalidResourceStatus | The status of the specified resource does not support this request. | 当前资源的状态不支持此操作。 |
OperationDenied.ResourceLocked | The specified operation is denied as your resource is locked for another operation. | 指定的操作被拒绝,因为您的资源已被其他操作锁定。 |
InternalError | An internal error has occurred. | 内部错误,请重试。如果多次尝试失败,请提交工单。 |
FlowLimitExceeded | You've reach the limit on request rate of resources. | 您已超过资源请求限速。 |
GET /?Action=CreateTags&Version=2020-04-01&ResourceType=instance&ResourceIds.1=i-l8u0p77yseabkpak****&ResourceIds.2=i-l8u0p7xyseabkbak****&Tags.1.Key=k1&Tags.1.Value=v1 HTTP/1.1 Host: open.volcengineapi.com Region: cn-beijing ServiceName: ecs
{ "ResponseMetadata": { "RequestId": "2021062415303301022514515207C4****", "Action": "CreateTags", "Version": "2020-04-01", "Service": "ecs", "Region": "cn-beijing" }, "Result": { "OperationDetails": [ { "Error": null, "ResourceId": "i-l8u0p77yseabkpak****" }, { "Error": { "Code": "InvalidResourceId.NotFound", "Message": "The specified ResourceId does not exist." }, "ResourceId": "i-l8u0p7xyseabkbak****" } ] } }
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | InvalidArgument | The specified argument is invalid. | 指定的参数不合法。 |
400 | QuotaExceeded.MaximumTags | You've reached the limit on the number of Tags that you can create. | 已达到单个资源可创建标签上限。 |
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 | InvalidTagKey.Malformed | The specified TagKey is malformed. | 指定的标签键不合法。 |
400 | InvalidTagValue.Malformed | The specified TagValue is malformed. | 指定的标签值不合法。 |
400 | InvalidClientToken.Malformed | The specified ClientToken is malformed. | 指定的ClientToken不合法。 |
400 | IdempotentParameterMismatch | The request uses the same client token as a previous, but non-identical request. Do not reuse a client token with different requests, unless the requests are identical. | 幂等参数不一致。 |
404 | InvalidResourceType.NotFound | The specified ResourceType does not exist. | 指定的资源类型不存在。 |
404 | InvalidResourceId.NotFound | The specified ResourceId does not exist. | 指定的资源不存在。 |
404 | InvalidTag.NotFound | The specified tag does not exist. | 指定的标签不存在。 |
409 | InvalidTagKey.Conflict | The specified TagKey already exists. | 指定的标签键已存在。 |
412 | IdempotentProcessing | The request uses the same client token as a previous one that is still in process. | 先前的幂等请求仍在处理中,请稍后重试。 |
500 | InternalError | An internal error has occurred. | 内部错误,请重试。如果多次尝试失败,请提交工单。 |