Skip to main content

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

NameLocationTypeRequiredSample valueDescription
Tag.N.valueBODYstringNoFinanceTagValuethe tag value of the resource. description to improve compatibility, it is recommended that you try to use the Tag.N.Value parameter.
Tag.N.keyBODYstringNoFinancethe 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.KeyBODYstringNoFinancethe 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://.
ResourceIdBODYstringYesi-bp1ecr********5go2gothe 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.
regionIdBODYstringYesNo sample value for this parameter.region id
Tag.N.ValueBODYstringNoFinanceTagValuethe 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://.
ResourceTypeBODYstringYesinstanceresource type. Value range: disk instance image securitygroup snapshot The above values are all lowercase.
RegionIdBODYstringYescn-qingdao-env17-d01the region where the resource is located. You can call the DescribeRegions to view the latest Alibaba Cloud region list.
versionBODYstringNo2016-01-01version of api

Return data

NameTypeSample valueDescription
RequestIDstring1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DCRequest id

Example

Successful Response example

{
"RequestID":"1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DC"
}

Failed Response example

{
"errorSample":
{
"resultCode":-1,
"resultMsg":"system error",
"result":null
}

}