All Products
Search
Document Center

Container Registry:TagResources

Last Updated:Dec 16, 2025

Adds tags to resources. Instance resources are supported.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
cr:TagResourcescreate
*Instance
acs:cr:{#regionId}:{#accountId}:instance/{#InstanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ResourceTypestringYes

The type of the resource. Instance resources are supported.

Instance
ResourceIdarrayYes

The resource IDs. You can specify a maximum of 20 resource IDs.

stringYes

The resource ID.

cri-1lg7vtctpqdn****
RegionIdstringYes

The region ID of the resources.

cn-hangzhou
Tagarray<object>Yes

The tag list.

objectYes

The tag list.

KeystringNo

The tag key of the resource. You can specify up to 20 tag keys. The tag key cannot be an empty string.

A tag key can be up to 128 characters in length. It cannot start with acs: or aliyun, and cannot contain http:// or https://.

test-key
ValuestringNo

The tag value of the resource. You can specify up to 20 tag values. The tag value can be an empty string.

A tag value can be up to 128 characters in length. It cannot start with acs: or aliyun, and cannot contain http:// or https://.

test-val

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The request ID.

E9A586D0-3977-5C28-A44D-55D3A9CD53CC

Examples

Sample success responses

JSONformat

{
  "RequestId": "E9A586D0-3977-5C28-A44D-55D3A9CD53CC"
}

Error codes

HTTP status codeError codeError message
400SystemErrorA system error occurred while processing your request
400InvalidParameter.ResourceIdThe ResourceId parameter is invalid.
400InvalidResourceId.NotFoundThe specified ResourceIds are not found in our records.
400NumberExceed.ResourceIdsThe maximum number of ResourceIds is exceeded.
400InvalidParameter.RegionIdThe RegionId parameter is invalid.
400InvalidParameter.ResourceTypeThe ResourceType parameter is invalid.
400MissingParameter.ResourceIdsYou must specify ResourceId.N.
400MissingParameter.ResourceTypeYou must specify ResourceType.
400MissingParameter.TagsYou must specify Tags.
400MissingParameter.TagKeyYou must specify Tag.N.Key.
400MissingParameter.TagValueYou must specify Tag.N.Value.
400InvalidParameter.TagKeyThe Tag.N.Key parameter is invalid.
400InvalidParameter.TagValueThe Tag.N.Value parameter is invalid.
400NumberExceed.TagsThe maximum number of Tags is exceeded.
400QuotaExceed.TagsPerResourceThe maximum number of tags for each resource is exceeded.
400Duplicate.TagKeyThe Tag.N.Key contains duplicate keys.
403NoPermissionThe operator is not permission for this operate
500InvalidOperation.ConcurrentModificationThe resource is modified concurrently.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-12-11The Error code has changedView Change Details
2024-04-01The Error code has changedView Change Details