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

Obtaining Resource Specifications

Function

Obtain resource specifications.

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.

Range: N/A

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.

Constraints: This parameter is optional.

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

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.

Range: N/A

spec

ResourceFlavorSpec object

Definition: Specifications of a resource flavor.

Range: N/A

status

ResourceFlavorStatus object

Definition: Status of a resource flavor.

Range: N/A

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.

Constraints: N/A

Range: N/A

Default Value: N/A

annotations

ResourceFlavorAnnotation object

Definition: Comments of a resource flavor.

Constraints: N/A

Range: N/A

Default Value: N/A

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.

Constraints: N/A

Range:

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

Default Value: N/A

cpuArch

String

Definition: Compute architecture of a resource flavor.

Constraints: N/A

Range:

  • x86: x86 architecture

  • arm64: Arm architecture

Default Value: N/A

cpu

String

Definition: Number of CPU cores of a resource flavor.

Constraints: N/A

Range: N/A

Default Value: N/A

memory

String

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

Constraints: N/A

Range: N/A

Default Value: N/A

gpu

gpu object

Definition: GPU resource information of a resource flavor.

Constraints: N/A

Range: N/A

Default Value: N/A

npu

npu object

Definition: GPU resource 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.

Constraints: N/A

Range: N/A

Default Value: N/A

billingModes

Array of integers

Definition: Billing mode supported by a resource flavor.

Constraints: N/A

Range:

  • 0: pay-per-use

  • 1: yearly/monthly

Default Value: N/A

billingCode

String

Definition: Billing code of a resource flavor.

Constraints: N/A

Range: N/A

Default Value: N/A

jobFlavors

Array of strings

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

Constraints: N/A

Range: N/A

Default Value: N/A

Table 10 gpu

Parameter

Type

Description

type

String

Definition: Type of GPUs of a resource flavor.

Constraints: N/A

Range: N/A

Default Value: N/A

size

String

Definition: Number of GPUs of a resource flavor.

Constraints: N/A

Range: N/A

Default Value: N/A

Table 11 npu

Parameter

Type

Description

type

String

Definition: Type of NPUs of a resource flavor.

Constraints: N/A

Range: N/A

Default Value: N/A

size

String

Definition: Number of NPUs of a resource flavor.

Constraints: N/A

Range: N/A

Default Value: N/A

Table 12 dataVolume

Parameter

Type

Description

volumeType

String

Definition: Disk type.

Constraints: N/A

Range:

  • SSD: ultra-high I/O disk

  • GPSSD: general-purpose SSD

  • SAS: high I/O disk

Default Value: N/A

size

String

Definition: Disk size, in GiB.

Constraints: N/A

Range: N/A

Default Value: 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: The flavor is sold out.

Constraints: N/A

Range: N/A

Default Value: N/A

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.