AddTags
Description
add or overwrite one or more tags to various resources of the cloud server ECS. You can add tags to instances, disks, snapshots, images, and security groups to facilitate resource management.
Request Method
POST
Request Path
/apsara/route/Ecs/AddTags
Request Parameters Common Parameters
Name | Location | Type | Required | Sample value | Description |
---|---|---|---|---|---|
Tag.N.value | BODY | string | No | FinanceTagValue | the tag value of the resource. description to improve compatibility, it is recommended that you try to use the Tag.N.Value parameter. |
Tag.N.key | BODY | string | No | Finance | the tag key of the resource. Description To improve compatibility, we recommend that you use the Tag.N.Key parameter as much as possible. |
Tag.N.Key | BODY | string | No | Finance | the tag key of the resource. The value range of n is 1~20. Once the value is passed in, an empty string is not allowed. it can be up to 128 characters in length. it cannot start with aliyun or acs: and cannot contain http:// or https://. |
ResourceId | BODY | string | Yes | i-bp1ecr********5go2go | the resource ID to bind the tag. For example, when the resource type (ResourceType) is an instance (instance), the resource ID can be understood as the instance ID. |
regionId | BODY | string | Yes | No sample value for this parameter. | region id |
Tag.N.Value | BODY | string | No | FinanceTagValue | the tag value of the resource. The value range of n is 1~20. Once the value is passed in, it can be an empty string. it can be up to 128 characters in length. it cannot start with aliyun or acs: and cannot contain http:// or https://. |
ResourceType | BODY | string | Yes | instance | resource type. Value range: disk instance image securitygroup snapshot The above values are all lowercase. |
RegionId | BODY | string | Yes | cn-qingdao-env17-d01 | the region where the resource is located. You can call the DescribeRegions to view the latest Alibaba Cloud region list. |
version | BODY | string | No | 2016-01-01 | version of api |
Return data
Name | Type | Sample value | Description |
---|---|---|---|
RequestID | string | 1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DC | Request id |
Example
Successful Response example
{
"RequestID":"1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DC"
}
Failed Response example
{
"errorSample":
{
"resultCode":-1,
"resultMsg":"system error",
"result":null
}
}