查询作业详情

发布时间:2021-12-28 14:19

方法: GET

PATH: /install/tasks/{batch_no}

cURL示例:

curl 'https://localhost:9931/api/lease/{suid}/start_install' \
  -H 'Authorization:Bearer UHUzcGhDY29JTnZSbGpxZm1EOU......'

响应参数:

参数 类型 说明 示例
request_id [string] 请求ID
body [object] 数据
body.batch_no [string] 安装批次号,可用于查询安装之详情 INST:f3d9264c-5375-4e3e-b437-6d50a184b7bc
body.node_id [int] 正在安装的节点ID 1
body.mac [string] 正在安装的节点的MAC地址 f0:4d:a2:71:2d:14
body.pxe_file [string] 本次安装使用的PXE配置文件 INITRD=xxx
system_file [string] 本次安装使用的系统模板文件 preseed 或 kickstart 或 unattend
is_timeout [bool] 本地任务是否超时,超时认为安装失败 fasle
complete_at [string] 安装完成时间 2021-06-24 11:19:28
edges.pipelines [array] 本次任务的安装流水线,由服务器自动上报,进度最小10最大100,100时认为安装完成。
edges.pipelines.task_id [int] 任务ID 4
edges.pipelines.process [int] 当前进度 30
edges.pipelines.title [string] 当前进度的标题 start install
edges.pipelines.contents [string] 进度提供的数据,例如当前采集的信息,使用的模板等
edges.pipelines.created_time [string] 进度上报时间

响应示例

{
    "request_id": "9e2d58b9-2b17-4663-a8cc-f9b2fe74bc95",
    "body": {
        "id": 1,
        "node_id": 1,
        "batch_no": "INST:f3d9264c-5375-4e3e-b437-6d50a184b7bc",
        "mac": "f0:4d:a2:71:2d:14",
        "pxe_file": "",
        "system_file": "",
        "is_timeout": false,
        "created_time": "2021-06-24 11:19:28",
        "complete_at": "",
        "edges": {
            "pipelines": [
                {
                    "id": 1,
                    "task_id": 4,
                    "process": 10,
                    "title": "start",
                    "contents": "\"\"",
                    "created_time": "2021-06-24 20:17:43",
                    "edges": {}
                }
            ]
        }
    }
}
本文导读