更新时间:2023-02-27 GMT+08:00
分享

获取notebook信息

使用get命令获取notebook列表、详情。

命令结构

health get notebook <notebook-id> [flags]
表1 参数说明

参数

简写

是否必选

说明

notebook-id

notebook id,不填写时表示获取notebook列表,填写时表示获取notebook详情。

--url

-u

获取打开notebook的地址。

--project

指定项目名。未填写则使用配置文件中的项目名。

命令示例

本节以Windows为例介绍eihealth-toolkit的使用过程,Linux和macOS环境使用方法基本相同,可参考。

  • 获取notebook列表
    health get notebook
    # 返回结果如下
    Name         ID   Status   Container Image      Created             Updated
    notebook-01  xxx  Running  mul-kernel-cpu-cp27  2021-02-01 11:11:27 2021-02-01 11:11:27
    notebook-02  xxx  Failed   mul-kernel-cpu-cp27  2021-02-01 11:11:27 2021-02-01 11:11:27
    notebook-03  xxx  Succeed  mul-kernel-cpu-cp27  2021-02-01 11:11:27 2021-02-01 11:11:27
  • 获取notebook详情
    health get notebook xxxx
    # 返回结果如下
    {
      "id": "439274bd-be09-4300...",
      "name": "a",
      "creator": "ei_eihealth_02",
      "url": "https://x.x.x.x/v1/0xxx/notebooks/xxx/services/notebook",
      "flavor": {
        "cpu": 1.0,
        "gpu": 0.0,
        "memory": 2.0
      },
      "status": "Creating",
      "image": {
        "image_type": "SYSTEM",
        "image_info": {
          "source_project_name": "",
          "image_name": "eihealth-notebook",
          "image_tag": "cuda11.0-custom-v1.0.6",
          "profile": "PY3"
        }
      },
      "storages": [
        {
          "path": "/home/health-user/work/wyq-test"
        }
      ],
      "create_time": "2022-06-30T11:25:43Z",
      "update_time": "2022-06-30T11:25:53Z",
      "failed_message": "pod failed for:Unschedulable, message:0/2 nodes are available: 2 Insufficient cpu.",
      "events": [
        {
          "type": "Warning",
          "count": 3,
          "reason": "FailedScheduling",
          "message": "0/2 nodes are available: 2 Insufficient cpu.",
          "first_timestamp": "2022-06-30T11:25:43Z",
          "last_timestamp": "2022-06-30T11:25:46Z"
        }
      ]
    }
  • 获取打开notebook的地址信息
    health get notebook xxxx --url
    # 返回结果如下https://x.x.x.x/v1/0xxx/notebooks/xxx/services/notebook?token=xxxx

相关文档