文档首页> AI开发平台ModelArts> API参考> 开发环境管理> 查询支持可切换规格列表
更新时间:2024-03-22 GMT+08:00

查询支持可切换规格列表

功能介绍

查询Notebook实例可切换的规格列表。

接口约束

暂无约束

调试

您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。

URI

GET /v1/{project_id}/notebooks/{id}/flavors

表1 路径参数

参数

是否必选

参数类型

描述

id

String

Notebook实例ID

project_id

String

用户项目ID,获取方法请参见获取项目ID和名称

表2 Query参数

参数

是否必选

参数类型

描述

limit

Integer

每一页的数量,默认不限制。

offset

Integer

分页记录的起始位置偏移量。

请求参数

响应参数

状态码: 200

表3 响应Body参数

参数

参数类型

描述

current

Integer

当前页数。

data

Array of NotebookFlavor objects

分页数据。

flavors

Array of NotebookFlavor objects

支持切换的规格列表。

pages

Integer

总的页数。

size

Integer

每一页的数量。

total

Long

总的记录数量。

表4 NotebookFlavor

参数

参数类型

描述

arch

String

架构类型:

  • X86_64

  • AARCH64

ascend

AscendInfo object

NPU信息。

billing

BillingInfo object

话单信息。

category

String

规格处理器类型。

  • CPU

  • GPU

  • ASCEND

description

String

规格描述信息。

feature

String

规格类别,可选值如下:

  • DEFAULT:CodeLab规格。

  • NOTEBOOK:Notebook规格。

free

Boolean

是否为免费规格。

gpu

GPUInfo object

GPU信息。

id

String

规格ID。

memory

Long

内存大小。

name

String

规格名称。

sold_out

Boolean

资源是否充足。

  • true 资源不足

  • false 资源充足

storages

Array of strings

规格支持的存储类型。

  • EFS

  • EVS

vcpus

Integer

CPU核数。

表5 AscendInfo

参数

参数类型

描述

npu

Integer

NPU数量

npu_memory

String

NPU内存

type

String

NPU类型

表6 BillingInfo

参数

参数类型

描述

code

String

计费码

unit_num

Integer

计费单元

表7 GPUInfo

参数

参数类型

描述

gpu

Integer

GPU卡数

gpu_memory

String

GPU内存

type

String

GPU类型

请求示例

GET https://{endpoint}/v1/{project_id}/notebooks/{id}/flavors

响应示例

状态码: 200

OK

{
  "current" : 1,
  "data" : [ {
    "arch" : "aarch64",
    "ascend" : {
      "npu_memory" : "32",
      "npu" : 2,
      "type" : "ascend-snt9"
    },
    "billing" : {
      "code" : "modelarts.kat1.xlarge",
      "unit_num" : 2
    },
    "category" : "ASCEND",
    "description" : "The Ascend specification is suitable for deep learning code running and debugging",
    "feature" : "NOTEBOOK",
    "free" : false,
    "id" : "modelarts.bm.snt9.xlarge.2",
    "memory" : 201326592,
    "name" : "Ascend: 2*Ascend snt9|CPU: 48vCPUs 192GB",
    "sold_out" : false,
    "storages" : [ "EFS" ],
    "vcpus" : 48
  }, {
    "arch" : "aarch64",
    "ascend" : {
      "npu_memory" : "128",
      "npu" : 8,
      "type" : "ascend-snt9"
    },
    "billing" : {
      "code" : "modelarts.kat1.8xlarge",
      "unit_num" : 1
    },
    "category" : "ASCEND",
    "description" : "The Ascend specification is suitable for deep learning code running and debugging",
    "feature" : "NOTEBOOK",
    "free" : false,
    "id" : "modelarts.bm.snt9.xlarge.8",
    "memory" : 805306368,
    "name" : "Ascend: 8*Ascend snt9|CPU: 192vCPUs 768GB",
    "sold_out" : false,
    "storages" : [ "EFS" ],
    "vcpus" : 192
  } ],
  "flavors" : [ {
    "arch" : "aarch64",
    "ascend" : {
      "npu_memory" : "32",
      "npu" : 2,
      "type" : "ascend-snt9"
    },
    "billing" : {
      "code" : "modelarts.kat1.xlarge",
      "unit_num" : 2
    },
    "category" : "ASCEND",
    "description" : "The Ascend specification is suitable for deep learning code running and debugging",
    "feature" : "NOTEBOOK",
    "free" : false,
    "id" : "modelarts.bm.snt9.xlarge.2",
    "memory" : 201326592,
    "name" : "Ascend: 2*Ascend snt9|CPU: 48vCPUs 192GB",
    "sold_out" : false,
    "storages" : [ "EFS" ],
    "vcpus" : 48
  }, {
    "arch" : "aarch64",
    "ascend" : {
      "npu_memory" : "128",
      "npu" : 8,
      "type" : "ascend-snt9"
    },
    "billing" : {
      "code" : "modelarts.kat1.8xlarge",
      "unit_num" : 1
    },
    "category" : "ASCEND",
    "description" : "The Ascend specification is suitable for deep learning code running and debugging",
    "feature" : "NOTEBOOK",
    "free" : false,
    "id" : "modelarts.bm.snt9.xlarge.8",
    "memory" : 805306368,
    "name" : "Ascend: 8*Ascend snt9|CPU: 192vCPUs 768GB",
    "sold_out" : false,
    "storages" : [ "EFS" ],
    "vcpus" : 192
  } ],
  "pages" : 1,
  "size" : 2,
  "total" : 2
}

状态码

状态码

描述

200

OK

401

Unauthorized

403

Forbidden

404

Not Found

错误码

请参见错误码