Creates and binds tags to specified Bastionhost instances.

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 region ID of the Bastionhost instances to which tags need to be created and bound.

ResourceId.N RepeatList Yes bastionhost-cn-78v1gc****

The ID of Bastionhost instance N.

Valid values of N: 1 to 20.

Note You can call the DescribeInstances operation to obtain the ID of the Bastionhost instance.
ResourceType String Yes INSTANCE

The type of the resource.

Set the value to INSTANCE, which indicates that the resource is a Bastionhost instance.

Tag.N.Key String No operation

The key of tag N of the instance.

Valid values of N: 1 to 20.

Note
  • The key can be up to 128 characters in length but cannot be an empty string.
  • The key cannot start with aliyun or acs:. It cannot contain http:// or https://.
Tag.N.Value String No operation_test

The value of tag N of the instance.

Valid values of N: 1 to 20.

Note
  • The value can be up to 128 characters in length or an empty string.
  • The value cannot start with aliyun or acs:. It cannot contain http:// or https://.

Response parameters

Parameter Type Example Description
RequestId String 2F24F0A8-4C69-4E89-9392-457D107E2D4A

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=TagResources
&RegionId=cn-hangzhou
&ResourceId.1=bastionhost-cn-78v1gc****
&ResourceType=INSTANCE
&<Common request parameters>

Sample success responses

XML format

<TagResourcesResponse>
      <RequestId>2F24F0A8-4C69-4E89-9392-457D107E2D4A</RequestId>
</TagResourcesResponse>

JSON format

{
    "RequestId":"2F24F0A8-4C69-4E89-9392-457D107E2D4A"
}

Error codes

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