更新时间:2024-05-09 GMT+08:00
分享

获取notebook列表

功能介绍

获取notebook列表

调试

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

URI

GET /v1/{project_id}/eihealth-projects/{eihealth_project_id}/notebooks

表1 路径参数

参数

是否必选

参数类型

描述

eihealth_project_id

String

平台项目ID,您可以在平台单击所需的项目名称,进入项目设置页面查看。

最小长度:1

最大长度:128

project_id

String

华为云项目ID,您可以从获取项目ID中获取。

最小长度:1

最大长度:128

表2 Query参数

参数

是否必选

参数类型

描述

limit

Integer

读取条数

最小值:1

最大值:1000

缺省值:100

name

String

notebook名称

最小长度:1

最大长度:200

offset

Integer

读取偏移量

最小值:0

最大值:100000000

缺省值:0

status

String

notebook状态

请求参数

表3 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

用户Token。Token认证就是在调用API的时候将Token加到请求消息头,从而通过身份认证,获得操作API的权限,获取Token接口响应消息头中X-Subject-Token的值即为Token。

最小长度:1

最大长度:32768

响应参数

状态码: 200

表4 响应Body参数

参数

参数类型

描述

count

Integer

notebook总数

notebooks

Array of NotebookEntity objects

notebook详情列表

表5 NotebookEntity

参数

参数类型

描述

id

String

notebook ID

name

String

notebook名称

description

String

notebook描述

creator

String

notebook所属用户

url

String

notebook访问URL

flavor

FlavorInfo object

notebook规格

status

String

notebook状态

枚举值:

  • Running

  • Abnormal

  • Hibernate

  • Succeeded

  • Creating

  • Deleting

  • Updating

  • CreatedFailed

  • DeletedFailed

  • UpdatedFailed

  • Unknown

image

NotebookImage object

notebook镜像信息

storages

Array of NotebookStorage objects

notebook存储信息

create_time

String

notebook创建时间

update_time

String

notebook更新时间

failed_message

String

notebook失败信息

events

Array of TaskEventRsp objects

cce事件

表6 FlavorInfo

参数

参数类型

描述

cpu

Float

notebook占用的cpu,0.1核为100m,单位为"C"

最小值:1

最大值:128

缺省值:1

gpu

Float

notebook占用的gpu,0.1为使用单卡10%,1为占满单个显卡,1+为使用多个显卡

最小值:0

最大值:16

缺省值:0

memory

Float

notebook占用的内存,单位为"G"

最小值:2

最大值:512

缺省值:2

表7 NotebookImage

参数

参数类型

描述

image_type

String

镜像类型

枚举值:

  • SYSTEM

  • CUSTOMER

image_info

ImageInfo object

镜像信息

表8 ImageInfo

参数

参数类型

描述

source_project_name

String

源项目名

最小长度:1

最大长度:128

image_name

String

镜像名

最小长度:1

最大长度:128

image_tag

String

镜像tag名

最小长度:1

最大长度:64

profile

String

系统镜像名

枚举值:

  • PY3

表9 NotebookStorage

参数

参数类型

描述

path

String

notebook存储路径

最小长度:1

最大长度:4096

mount_path

String

挂载路径,由于目前暂不支持自定义挂载,暂不开放

最小长度:1

最大长度:4096

表10 TaskEventRsp

参数

参数类型

描述

type

String

任务启动事件类型

count

Integer

任务启动事件发生次数

reason

String

任务启动事件状态

message

String

任务启动事件详细信息

first_timestamp

String

任务启动事件首次上报时间

last_timestamp

String

任务启动事件末次上报时间

请求示例

获取notebook列表

https://eihealth.cn-north-4.myhuaweicloud.com/v1/{project_id}/eihealth-projects/{eihealth_project_id}/notebooks

响应示例

状态码: 200

OK

{
  "count" : 1,
  "notebooks" : [ {
    "id" : "DE-7d558ef8-c73d-11ea-964c-0255ac100033",
    "name" : "notebook-example",
    "description" : "notebook description in here",
    "creator" : "notebook_creator",
    "url" : "https://0.0.0.0:0000/0951eb641.../notebook/e4a3b97a.../services/notebook",
    "flavor" : {
      "cpu" : "1",
      "gpu" : "0",
      "memory" : "100"
    },
    "status" : "Running",
    "image" : {
      "image_type" : "SYSTEM",
      "image_info" : {
        "source_project_name" : "eihealth-project",
        "image_name" : "eihealth-notebook",
        "image_tag" : "3.1.0-latest",
        "profile" : "PY3"
      }
    },
    "storages" : [ {
      "path" : "project_name:/example",
      "mount_path" : "/example"
    } ],
    "create_time" : "2020-09-10T10:07:17Z",
    "update_time" : "2020-09-10T10:07:17Z",
    "failed_message" : "failed massage in here"
  } ]
}

状态码

状态码

描述

200

OK

错误码

请参见错误码

分享:

    相关文档

    相关产品