All Products
Search
Document Center

ApsaraDB for MyBase:TagResources

Last Updated:Aug 28, 2026

Adds tags to hosts.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

cddc:TagResources

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID of the host.

ap-southeast-1

ResourceId

array

Yes

The host IDs.

ch-t4n4dcdvu6840****

string

No

The host ID. N is the sequence number. Examples:

  • ResourceId.1: the first host.

  • ResourceId.2: the second host.

ch-bp1yp3mqggn8****

Tag

array<object>

Yes

The tags.

object

No

Key

string

Yes

The tag key. N is the sequence number.

  • Examples:

    • Tag.1.Key: the first tag key.

    • Tag.2.Key: the second tag key.

  • A key is created automatically if none exists.

demokey

Value

string

Yes

The tag value. N is the sequence number.

  • Examples:

    • Tag.1.Value: the first tag value.

    • Tag.2.Value: the second tag value.

  • A value is created automatically if none exists.

demovalue

ResourceType

string

Yes

The resource type. Set to DEDICATEDHOST.

DEDICATEDHOST

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

4B938011-874B-5F54-8B9E-7E2A08B3AA13

Examples

Success response

JSON format

{
  "RequestId": "4B938011-874B-5F54-8B9E-7E2A08B3AA13"
}

Error codes

HTTP status code

Error code

Error message

Description

400 OperationDenied.QuotaExceed The Tags parameter number is exceed. Valid is 20. The Tags parameter number is exceed. Valid is 20.
400 NoPermission.SystemTag The operator is not permission for the system tag The operator is not permission for the system tag
400 InvalidParameter.TagValue The Tag.%s.Value parameter - %s is invalid The Tag.%s.Value parameter - %s is invalid
400 InvalidParameter.TagKey The Tag.%s.Key parameter - %s is invalid The Tag.%s.Key parameter - %s is invalid
400 NumberExceed.ResourceIds The ResourceIds parameter's number is exceed , Valid : 50
400 InvalidTagValue.Malformed The specified parameter "Tag.n.Value" is not valid.
400 InvalidDedicatedHostId.NotFound The parameter - ResourceIds.N is not found. The parameter - ResourceIds.N is not found.
400 InvalidParameter.ResourceType The specified parameter "ResourceType" is not valid.
400 NumberExceed.Tags The Tags parameter's number is exceed, Valid : 20.
400 MissingParameter.ResourceIds The parameter - ResourceIds.N should not be null. The parameter - ResourceIds.N should not be null.
400 Duplicate.TagKey The Tag.N.Key contain duplicate key.
400 InvalidTagKey.Malformed The Tag.N.Key parameter is invalid.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.