You can call this operation to create tags for one or more resources.

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 TagResources

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

RegionId String Yes cn-hangzhou

The ID of the region.

ResourceIds Json Yes ["templateNam1","templateName2"]

The IDs of resources. The number of resource IDs ranges from 1 to 50.

ResourceType String Yes template

The type of the resource. Valid values:

template

execution

Tags Json Yes {"k1":"v2","k2":"v2"}

The tag keys and values. The number of key-value pairs ranges from 1 to 20.

Response parameters

Parameter Type Example Description
RequestId String B19AE203-FD99-49C7-9253-FAAACAD46F4A

The ID of the request.

Examples

Sample requests


http(s)://[Endpoint]/? Action=TagResources
&RegionId=cn-hangzhou
&ResourceIds=["templateNam1","templateName2"]
&ResourceType=template
&Tags={"k1":"v2","k2":"v2"}
&<Common request parameters>

Sample success responses

XML format

<TagResourcesResponse> 
  <RequestId>B19AE203-FD99-49C7-9253-FAAACAD46F4A</RequestId>
</TagResourcesResponse>

JSON format

{
	"RequestId":"B19AE203-FD99-49C7-9253-FAAACAD46F4A"
}

Error codes

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