Updated on 2026-07-24 GMT+08:00

Creating Resource Pool Tags in Batches

Function

This API is used to add or update multiple tags for a specified resource pool. It is used when administrators need to manage resource pools by category (such as cost ownership and environment ID), configure metadata (such as project ownership and owner information) in batches, or update existing tag values. Before calling this API, ensure that the target resource pool exists and can be managed, you have the permissions to manage resource pool tags, and the submitted tag data complies with the format requirements (for example, the key is not empty and the value length is limited). After this API is called, the system adds a new tag to the resource pool or overwrites the value of the tag with the same name, and other configuration attributes of the resource pool are not affected. If the resource pool does not exist, you do not have the required permissions, the tag format is incorrect, or the system service is abnormal, an error message (such as "404 Not Found", "403 Forbidden", "400 Bad Request", or "503 Service Unavailable") is returned.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, no identity policy-based permission required for calling this API.

URI

POST /v1/{project_id}/pools/{pool_name}/tags/create

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition: Project ID. For details, see Obtaining a Project ID and Name.

Constraints: The value can contain 1 to 64 characters. Only letters, digits, and hyphens (-) are allowed.

Range: N/A

Default Value: N/A

pool_name

Yes

String

Definition: Resource pool name. The value is obtained from name in the metadata field of the resource pool details.

Constraints: N/A

Range: N/A

Default Value: N/A

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

tags

Yes

Array of Tag objects

Definition: Tags to be added.

Table 3 Tag

Parameter

Mandatory

Type

Description

key

Yes

String

Definition: Tag key.

Range: N/A

value

Yes

String

Definition: Tag value.

Range: N/A

Response Parameters

Status code: 204

Table 4 Response body parameters

Parameter

Type

Description

tags

Array of PoolTag objects

Definition: Resource tag list.

Table 5 PoolTag

Parameter

Type

Description

key

String

Definition: Tag of the resource type.

Range: N/A

values

Array of strings

Definition: Tag value of the resource type.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

  • Definition: ModelArts error code.

Range: N/A

error_msg

String

Definition: Error message.

Range: N/A

Status code: 401

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

  • Definition: ModelArts error code.

Range: N/A

error_msg

String

Definition: Error message.

Range: N/A

Status code: 403

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

  • Definition: ModelArts error code.

Range: N/A

error_msg

String

Definition: Error message.

Range: N/A

Status code: 404

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

  • Definition: ModelArts error code.

Range: N/A

error_msg

String

Definition: Error message.

Range: N/A

Example Requests

https://{endpoint}/v1/{project_id}/pools/a55eba18-1ebf-4e9a-8229-d2d3b593a3dc/tags/create

{
  "tags" : [ {
    "key" : "test",
    "value" : "service-gpu"
  }, {
    "key" : "model_version",
    "value" : "0.1"
  } ]
}

Example Responses

Status code: 204

Added.

{
  "tags" : [ {
    "key" : "test",
    "values" : [ "service-gpu", "service-cpu" ]
  }, {
    "key" : "model_version",
    "values" : [ "0.1", "0.2" ]
  } ]
}

Status Codes

Status Code

Description

204

Added.

400

Invalid parameter.

401

Authentication failed.

403

Insufficient permissions.

404

Resource not found.

Error Codes

See Error Codes.