Add tags for an SLB instance.

Note the following when calling this API:
  • You can bind up to 10 tags to a Server Load Balancer instance.
  • You can bind up to five pairs of tags at one time.
  • All the tags and keys added to a Server Load Balancer instance must be unique.
  • If you add a tag of which the key is the same as that of an existing tag but the value is different, the new tag overwrites the existing one.

Request parameters

Name  Type Required  Description
Action  String   Yes The action to perform. Valid value:

AddTags

RegionId String   Yes The ID of the region where the SLB instance is located.

You can obtain the region ID by calling the DescribeRegions API.

LoadBalancerID String   Yes The ID of the SLB instance.
Tags String   Yes The list of tags to add.

A maximum of five tags can be contained.

Table 1. Tag
Name  Type Required  Description
TagKey String   Yes The key of the tag.

It can contain up to 64 characters, and cannot start with aliyun or be empty.

TagValue String  No The value of the tag.

It can contain up to 128 characters, and cannot start with aliyun.

Response parameters

Name Type Description
RequestId String The ID of the request.

Examples

Request example

https://slb.aliyuncs.com/?Action=AddTags
&RegionId=cn-hangzhou
&LoadBalancerId=lb-t4nj5vuz8ish9emfk1f20
&Tags=[
    {"TagKey":"Key2","TagValue":"Value2"}]
    {"TagKey":"Key2","TagValue":"Value2"}]
&CommonParameters

Response example

  • XML format
    <? xml version="1.0" encoding="UTF-8"? >
    <AddTagsResponse>
    	<RequestId>365F4154-92F6-4AE4-92F8-7FF34B540710</RequestId>
    </AddTagsResponse>
  • JSON format
    {
      "RequestId":"365F4154-92F6-4AE4-92F8-7FF34B540710",
    }