Obtaining Resource Specifications

Function

Obtain resource specifications.

URI

GET /v1/{project_id}/resourceflavors

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

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

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

continue

No

String

Previous query location in pagination query.

labelSelector

No

String

Filter by label.

limit

No

Integer

Number of records on each page.

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

apiVersion

String

API version. Options:

  • v1

kind

String

Resource type. Options:

  • ResourceFlavorList: resource specifications

metadata

ResourceFlavorListMetadata object

Metadata of resource specifications.

items

Array of ResourceFlavor objects

Resource specifications.

Table 4 ResourceFlavorListMetadata

Parameter

Type

Description

continue

String

Next query position in pagination query.

remainingItemCount

Integer

Remaining resources.

Table 5 ResourceFlavor

Parameter

Type

Description

apiVersion

String

API version. Options:

  • v1

kind

String

Resource type. Options:

  • ResourceFlavor: resource specification

metadata

ResourceFlavorMetadata object

Metadata of a resource specification.

spec

ResourceFlavorSpec object

Description of a resource specification.

status

ResourceFlavorStatus object

Status of a resource specification.

Table 6 ResourceFlavorMetadata

Parameter

Type

Description

name

String

Resource flavor name.

labels

ResourceFlavorLabel object

Labels of a resource flavor.

annotations

ResourceFlavorAnnotations object

Annotations of a resource flavor.

Table 7 ResourceFlavorLabel

Parameter

Type

Description

os.modelarts/scope

String

Job types supported by a resource specification

os.modelarts.flavor/baremetal

String

BMS flavor label. true indicates that the flavor is a BMS flavor.

os.modelarts.flavor/localdisk

String

Whether a local disk is contained. true indicates that the flavor contains local disks.

Table 8 ResourceFlavorAnnotations

Parameter

Type

Description

os.modelarts.resourceflavor/volume.configs

String

Constraints on additional disks attached to the resource flavor.

Table 9 ResourceFlavorSpec

Parameter

Type

Description

type

String

Resource specification type.

cpuArch

String

Computer architecture. Options:

  • x86

  • arm64

cpu

String

Number of CPU cores.

memory

String

Memory size in GiB.

gpu

ResourceFlavorXpu object

GPU information.

npu

ResourceFlavorXpu object

NPU information.

dataVolumes

Array of DataVolumeItem objects

Data disks

rootVolume

RootVolume object

System disk information.

jobFlavors

Array of strings

Training job types supported by resource specifications.

nodeConfigTemplate

String

Node configuration template used by resource flavor

creatingSteps

Array of FlavorCreatingStepVO objects

Information about the resource flavor for creating nodes by step.

flavorBootType

String

Boot type of a BMS. The options are as follows:

  • LocalDisk: local disk

  • Volume: cloud hard disk (quick provisioning)

localDiskDetail

String

Physical disk specifications.

Table 10 ResourceFlavorXpu

Parameter

Type

Description

type

String

XPU type.

size

String

Number of XPUs.

memory

String

XPU memory.

Table 11 DataVolumeItem

Parameter

Type

Description

volumeType

String

Disk type. The options are as follows:

  • SSD: ultra-high I/O disk

  • GPSSD: general-purpose SSD

  • SAS: high I/O disk

  • SATA: common disk

size

String

Disk size, in GiB.

Table 12 RootVolume

Parameter

Type

Description

volumeType

String

Disk type. The options are as follows:

  • SSD: ultra-high I/O disk

  • GPSSD: general-purpose SSD

  • SAS: high I/O disk

  • SATA: common disk

size

String

Disk size, in GiB.

Table 13 FlavorCreatingStepVO

Parameter

Type

Description

displayInfo

DisplayInfo object

Name of the step displayed externally.

step

Integer

Step.

type

String

Batch type.

Table 14 DisplayInfo

Parameter

Type

Description

en_US

String

English name.

Table 15 ResourceFlavorStatus

Parameter

Type

Description

phase

Map<String,String>

Sales status of a resource specification in each AZ. The value is (AZ, Status). Options for Status:

  • normal: The specification is on-sales.

  • soldout: The specification is sold out.

Status code: 401

Table 16 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 404

Table 17 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

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",
      "billingModes" : [ 0 ],
      "dataVolumes" : [ {
        "volumeType" : "SSD",
        "size" : "500Gi"
      } ]
    },
  } ]
}

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.