Attaches one or more tags to the specified resources.

Debugging

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

Request parameters

Parameter Type Required Example Description
Action String Yes TagDcdnResources

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

ResourceId.N RepeatList Yes example.com

The ID of the resource. Valid values of N: 1 to 50.

ResourceType String Yes DOMAIN

The type of the resource. Set the value to DOMAIN.

Tag.N.Key String Yes env

The key of the tag. Valid values of N: 1 to 20.

Tag.N.Value String No value

The value of the tag. Valid values of N: 1 to 20.

Response parameters

Parameter Type Example Description
RequestId String 97C68796-EB7F-4D41-9D5B-12B909D76508

The ID of the request.

Examples

Sample requests

http(s)://dcdn.aliyuncs.com/? Action=TagDcdnResources
&ResourceId.1=example.com
&ResourceType=DOMAIN
&Tag.1.Key=env
&Tag.1.Value=''
&<Common request parameters>

Sample success responses

XML format

<TagDcdnResourcesResponse>
  <RequestId>97C68796-EB7F-4D41-9D5B-12B909D76508</RequestId>
</TagDcdnResourcesResponse>

JSON format

{
"RequestId":"97C68796-EB7F-4D41-9D5B-12B909D76508"
}

Error codes

HttpCode Error code Error message Description
400 InvalidRegionId.Malformed The specified RegionId is invalid. The error message returned because the specified value of the RegionId parameter is invalid.
400 Resource.NotExist The resource does not exist. The error message returned because the specified resource does not exist.
400 TagKeyIsInvalid The specified TagKey is invalid. The error message returned because the specified value of the TagKey parameter is invalid.
400 TooManyTags You have entered too many tags. The error message returned because the maximum number of tags has been reached. Specify another value.
400 TagValueIsInvalid The specified TagValue is invalid. The error message returned because the specified value of the TagValue parameter is invalid. Specify another value.
400 TagKeyDuplicated The specified TagKey is duplicated. The error message returned because the specified TagKey parameter already exists.
400 TagIsInvalid The number of Tag exceeds 20. The error message returned because the number of tags exceeds 20.
400 ResourceIdIsInvalid The number of ResourceId exceeds 50. The error message returned because the number of resource IDs exceeds 50.
400 SystemTagIsInvalid The number of System Tag exceeds 50. The error message returned because the number of system tags exceeds 50.
400 CustomTagIsInvalid The number of Custom Tag exceeds 20. The error message returned because the number of custom tags exceeds 20.

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