Help Center/ ModelArts/ API Reference/ Resource Management/ Obtaining Resource Specifications
Updated on 2025-11-19 GMT+08:00

Obtaining Resource Specifications

Function

This API is used to obtain available resource specifications. This API is used when you need to view or select resource specifications to create resource pools, allocate resources, or learn available resource specifications. Before using this API, ensure that you have the required permissions (such as administrator permissions or resource management permissions). After the API is called, the system returns the resource specifications, including the specification ID, name, number of CPUs, memory size, and storage capacity. If you do not have the required permission or the resource specifications are not configured, 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.

URI

GET /v1/{project_id}/resourceflavors

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

Default Value: N/A

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

continue

No

String

Definition: Offset parameter of the pagination query

Constraints: N/A

Range: The value is obtained from the metadata.continue field in the response to the last pagination query. An empty value indicates no offset.

Default Value: N/A

limit

No

Integer

Definition: Number of resources returned in a single pagination query

Constraints: N/A

Range: 0 to 500

Default Value: 500

labelSelector

No

String

Definition: Tag filtering query

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

apiVersion

String

Definition: API version of a resource.

Range:

  • v1: The current resource version is v1.

kind

String

Definition: Resource type.

Range:

  • ResourceFlavorList: resource flavors

metadata

metadata object

Definition: Metadata of a resource flavor list.

items

Array of ResourceFlavor objects

Definition: Resource flavor list.

Range: N/A

Table 4 metadata

Parameter

Type

Description

continue

String

Definition: Offset parameter of the pagination query.

Range: The value is obtained from the metadata.continue field in the response to the last pagination query. An empty value indicates no offset.

remainingItemCount

Integer

Definition: Number of remaining resources in a pagination query.

Default Value: N/A

Table 5 ResourceFlavor

Parameter

Type

Description

apiVersion

String

Definition: API version of a resource.

Range:

  • v1: The current resource version is v1.

kind

String

Definition: Resource type.

Range:

  • ResourceFlavor: resource flavor

metadata

metadata object

Definition: Metadata of a resource flavor.

spec

ResourceFlavorSpec object

Definition: Specifications of a resource flavor.

status

ResourceFlavorStatus object

Definition: Status of a resource flavor.

Table 6 metadata

Parameter

Type

Description

name

String

Definition: Resource flavor ID.

Constraints: N/A

Range: N/A

Default Value: N/A

labels

ResourceFlavorLabel object

Definition: Tags of a resource flavor.

annotations

ResourceFlavorAnnotation object

Definition: Comments of a resource flavor.

Table 7 ResourceFlavorLabel

Parameter

Type

Description

os.modelarts/scope

String

Definition: Job types supported by the resource flavor. Use periods (.) to separate multiple job types.

Constraints: N/A

Range: N/A

Default Value: N/A

Table 8 ResourceFlavorAnnotation

Parameter

Type

Description

os.modelarts.flavor/image.filter

String

Definition: Filter criteria of private images supported by the resource flavor.

Constraints: N/A

Range: N/A

Default Value: N/A

Table 9 ResourceFlavorSpec

Parameter

Type

Description

type

String

Definition: Resource flavor type.

Range:

  • Dedicate: physical resource flavor Physical resource flavors can be used to create node resources.

[- Logical: logical resource flavor] (tag:hcso)

cpuArch

String

Definition: Compute architecture of a resource flavor.

Range:

  • x86: x86 architecture

  • arm64: Arm architecture

cpu

String

Definition: Number of CPU cores of a resource flavor.

Range: N/A

memory

String

Definition: Memory size of a resource flavor, in GiB.

Range: N/A

gpu

gpu object

Definition: GPU resource information of a resource flavor.

npu

npu object

Definition: NPU information of a resource flavor.

Constraints: N/A

Range: N/A

Default Value: N/A

dataVolume

Array of dataVolume objects

Definition: Storage resource information of a resource flavor.

billingModes

Array of integers

Definition: Billing mode supported by a resource flavor.

billingCode

String

Definition: Billing code of a resource flavor.

Range: N/A

jobFlavors

Array of strings

Definition: List of job types supported by a resource flavor.

Table 10 gpu

Parameter

Type

Description

type

String

Definition: Type of GPUs of a resource flavor.

Range: N/A

size

String

Definition: Number of GPUs of a resource flavor.

Range: N/A

Table 11 npu

Parameter

Type

Description

type

String

Definition: Type of NPUs of a resource flavor.

Range: N/A

size

String

Definition: Number of NPUs of a resource flavor.

Range: N/A

Table 12 dataVolume

Parameter

Type

Description

volumeType

String

Definition: Disk type.

Range:

  • SSD: ultra-high I/O disk

  • GPSSD: general-purpose SSD

  • SAS: high I/O disk

size

String

Definition: Disk size, in GiB.

Range: N/A

Table 13 ResourceFlavorStatus

Parameter

Type

Description

phase

Map<String,String>

Definition: Capacity status of a resource flavor. The value is in the key-value pair format. The key is the AZ code, and the value is the resource status of the AZ. The options are as follows:

  • normal: normal

  • soldout

Status code: 401

Table 14 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 15 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

This API is used to obtain resource specifications.

GET https://{endpoint}/v1/{project_id}/resourceflavors

{ }

Example Responses

Status code: 200

OK

{
  "kind" : "ResourceFlavorList",
  "apiVersion" : "v1",
  "metadata" : { },
  "items" : [ {
    "kind" : "ResourceFlavor",
    "apiVersion" : "v1",
    "metadata" : {
      "name" : "modelarts.vm.cpu8u32g",
      "labels" : { }
    },
    "spec" : {
      "cpuArch" : "x86",
      "cpu" : "8",
      "memory" : "32Gi",
      "type" : "Dedicate",
      "billingCode" : "modelarts.vm.cpu.8ud",
      "billingModes" : [ 0 ]
    },
    "status" : {
      "phase" : {
        "cn-north-7a" : "soldout",
        "cn-north-7b" : "soldout",
        "cn-north-7c" : "normal"
      }
    }
  } ]
}

Status code: 401

Authorization failed.

{
  "error_code" : "ModelArts.50001000",
  "error_msg" : "token is invalid"
}

Status code: 404

Not found.

{
  "error_code" : "ModelArts.50005101",
  "error_msg" : "Resourceflavor not found."
}

Status Codes

Status Code

Description

200

OK

401

Authorization failed.

404

Not found.

Error Codes

See Error Codes.