Adds one or more tags to an application group.

This topic provides an example on how to add a tag to an application group whose ID is 7301****. In this example, the key of the tag is key1 and the value of the tag is value1.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes AddTags

The operation that you want to perform. Set the value to AddTags.

GroupIds.N RepeatList Yes 7301****

The ID of the application group.

Valid values of N: 1 to 20.

For information about how to obtain the ID of an application group, see DescribeMonitorGroups.

Tag.N.Key String Yes key1

The key of the tag.

Valid values of N: 1 to 3. A tag key can be 1 to 64 characters in length.

You can create a tag key or specify an existing tag key. For more information about how to obtain a tag key, see DescribeTagKeyList.

Note
  • A tag key cannot contain http:// or https://. It cannot start with aliyun or acs:. Only the following special characters a tag key can contain: _.-.
  • You must set the Tag.N.Key and Tag.N.Value parameters for a tag at the same time.
Tag.N.Value String Yes value1

The value of the tag.

Valid values of N: 1 to 3. A tag value can be 1 to 64 characters in length.

You can create a tag value or specify an existing tag value. For more information about how to obtain a tag value, see DescribeTagValueLis.

Note
  • A tag value cannot contain http:// or https://. It cannot start with aliyun or acs:. Only the following special characters a tag key can contain: _.-.
  • You must set the Tag.N.Key and Tag.N.Value parameters for a tag at the same time.

For more information about common request parameters, see Common parameters.

Response parameters

Parameter Type Example Description
RequestId String DAE4B115-3847-5438-8709-423627F0A3A3

The ID of the request.

Code String 200

The status code.

Note The status code 200 indicates that the call was successful.
Success Boolean true

Indicates whether the call was successful. Valid values:

  • true: The call was successful.
  • false: The call was failed.
Message String The specified resource is not found.

The error message.

Examples

Sample requests

http(s)://[Endpoint]/?Action=AddTags
&GroupIds.1=7301****
&Tag.1.Key=key1
&Tag.1.Value=value1
&<Common request parameters>

Sample success responses

XML format

<AddTagsResponse>
      <RequestId>DAE4B115-3847-5438-8709-423627F0A3A3</RequestId>
      <Code>200</Code>
      <Success>true</Success>
</AddTagsResponse>

JSON format

{
    "RequestId": "DAE4B115-3847-5438-8709-423627F0A3A3",
    "Code": 200,
    "Success": true
}

Error codes

HttpCode Error code Error message Description
404 ResourceNotFound The specified resource is not found. The error message returned because the specified resource is not found.

For a list of error codes, visit the API Error Center.