Help Center/ ModelArts/ API Reference/ Model Training/ Training Management/ Querying the Maximum Available Resources of a Resource Pool
Updated on 2026-11-12 GMT+08:00

Querying the Maximum Available Resources of a Resource Pool

Function

This API is used to retrieve the maximum allocable CPU and memory resources for a specified resource flavor in a given resource pool.

This API is applicable to scenarios where you need to check the upper limit of available resources for a flavor in a resource pool before creating a training job, allowing you to select an appropriate flavor and node count. The prerequisite for using this API is that you know the resource pool ID and resource flavor ID, and possess the permissions to view training resources. After the query operation completes, the platform will return the maximum available CPU cores and memory size for that flavor in the resource pool. If the resource pool or flavor does not exist, or if you lack operation permissions, the API will return an error message.

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, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    modelarts:trainJob:getPoolFlavors

    Read

    -

    g:EnterpriseProjectId

    modelarts:trainJob:get

    -

URI

GET /v2/{project_id}/training-pool-flavors

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: N/A

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

Default Value: N/A

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

flavor_id

Yes

String

Definition: Resource flavor ID.

Constraints: N/A

Range: N/A

Default Value: N/A

pool_id

Yes

String

Definition: Resource pool ID.

Constraints: N/A

Range: N/A

Default Value: N/A

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

cpu_core_num

Integer

Definition: Maximum number of available CPU cores.

Range: N/A

mem_size

Integer

Definition: Maximum available memory size, in GB.

Range: N/A

Status code: 500

Table 4 Response body parameters

Parameter

Type

Description

error_msg

String

Error message

error_code

String

Error code

error_solution

String

Solution

Example Requests

Query the maximum available resources of the flavor modelarts.bm.gpu.v100 in the resource pool whose ID is pool-xxxx.

GET https://{endpoint}/v2/{project_id}/training-pool-flavors?flavor_id=modelarts.bm.gpu.v100&pool_id=pool-xxxx

Example Responses

Status code: 200

{
  "cpu_core_num" : 8,
  "mem_size" : 32
}

Status code: 500

{
  "error" : "get max available resource failed",
  "message" : "get pool from os error"
}

Status Codes

Status Code

Description

200

Response body for querying the maximum available resources of a resource pool flavor.

500

Internal service error.

Error Codes

See Error Codes.