Updated on 2025-10-22 GMT+08:00

Batch Tagging Resources

Function

This API is used to batch tag resources.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions. For details about the required permissions, see Permissions Policies and Supported Actions.

URI

POST /v1/{project_id}/instances/{instance_id}/tags/create

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

The project ID.

instance_id

Yes

String

Instance ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

tags

No

Array of tags objects

Tag.

Table 4 tags

Parameter

Mandatory

Type

Description

key

Yes

String

Tag key.

value

Yes

String

Tag value.

Response Parameters

Status code: 200

OK

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

error_details

String

Error information.

request_id

String

Request ID.

Status code: 403

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

error_details

String

Error information.

request_id

String

Request ID.

Status code: 404

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

error_details

String

Error details.

suggestion

String

Suggestion.

Status code: 500

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

error_details

String

Error information.

request_id

String

Request ID.

Example Requests

Batch tagging resources

https://{roma_endpoint}/v1/{project_id}/instances/{instance_id}/tags/create

{
  "tags" : [ {
    "key" : "aaa",
    "value" : "bbb"
  }, {
    "key" : "ccc",
    "value" : "ddd"
  } ]
}

Example Responses

Status code: 200

OK

{ }

Status code: 400

Bad Request

{
  "error_code" : "ROMA.00013000",
  "error_msg" : "Invalid parameter value,parameterName:name. Please refer to the support documentation"
}

Status code: 403

Forbidden

{
  "error_code" : "ROMA.00012000",
  "error_msg" : "No permissions to request this method"
}

Status code: 404

Not Found

{
  "error_code" : "ROMA.00000101",
  "error_msg" : "error summary",
  "error_details" : "some error details here",
  "suggestion" : ""
}

Status code: 500

Internal Server Error

{
  "error_code" : "ROMA.00011000",
  "error_msg" : "System error"
}

Status Codes

Status Code

Description

200

OK

400

Bad Request

403

Forbidden

404

Not Found

500

Internal Server Error

Error Codes

See Error Codes.