Creates and attaches a tag to a specified CEN instance.

API description

  • To determine the search object, a request should include the parameter ResourceId.N or Tag.N (that is, Tag.N.Key and Tag.N.Value).
  • Tag.N is a resource tag and consists of a key-value pair. When only Tag.N.Key is specified, all tag values associated with the tag key are returned. When only Tag.N.Value is specified, an error is reported.
  • If you specify Tag.N and ResourceId.N simultaneously, ResourceId.N must match all the tag key-value inputs.
  • If you specify multiple tag key-value pairs at the same time, the returned results are the resources that contain the specified multiple key-value pairs.

Debug

Use OpenAPI Explorer to perform debug operations and generate SDK code examples.

Request parameters

Parameter Type Required? Example value Description
ResourceId.N RepeatList Yes cen-7qthudw0ll6jmc****

The ID of the resource. Value range of N: 1 to 50.

ResourceType String Yes cen

The resource type. Value: cen.

Tag.N.Key String Yes FinanceDept

The tag key of the resource. Value range of N: 1 to 20. This value can be a null string. It can be a maximum of 64 characters in length and cannot start with aliyun or acs:. It cannot contain http:// or https://.

Tag.N.Value String Yes FinanceJoshua

The tag value of the resource. Value range of N: 1 to 20. This value can be a null string. It can be a maximum of 128 characters in length and cannot start with aliyun or acs:. It cannot contain http:// or https://.

Action String No TagResources

The name of this action. Value: TagResources.

Response parameters

Parameter Type Example value Description
RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The ID of the request.

Examples

Request example


http(s)://[Endpoint]/? Action=TagResources
&ResourceId.1=cen-7qthudw0ll6jmc****
&ResourceType=cen
&Tag.1.Key=FinanceDept
&Tag.1.Value=FinanceJoshua
&<CommonParameters>

Response example

XML format

<TagResourcesResponse>
      <RequestId>C46FF5A8-C5F0-4024-8262-B16B639225A0</RequestId>
</TagResourcesResponse>

JSON format

{
	"RequestId":"C46FF5A8-C5F0-4024-8262-B16B639225A0"
}

Errors

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