更新时间:2025-06-24 GMT+08:00
分享

创建仿真任务

功能介绍

本接口用于创建仿真任务。

URI

POST https://{hostURL}/v2/{project_id}/sim/pm/batches

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

项目ID。

请求参数

表2 请求Body参数

参数

是否必选

参数类型

描述

name

String

任务名称。

description

String

描述的内容。

batch_config

String

任务配置信息。

algorithm_image

String

关联算法镜像,如果任务配置了算法,该字段必填。

响应参数

状态码:201

表3 响应Body参数

参数

参数类型

描述

url

String

仿真任务的资源地址。

id

Integer

仿真任务ID。

created_at

TimeStamp

创建时间。

updated_at

TimeStamp

更新时间。

passing_score

Integer

融合评测通过分数。

algorithm_name

String

关联算法名称。

algorithm_image

String

关联算法镜像。

algorithm_image_version

String

关联算法镜像版本。

started_at

Double

任务开始时间。

ended_at

Double

任务结束时间。

success

Integer

子任务成功数量

fail

Integer

子任务失败数量

simulation_size

Integer

子任务数量

status

Integer

任务状态:

  • 0 - 成功
  • 1 - 等待中
  • 2 - 调度中
  • 3 - 运行中
  • 4 - 已取消
  • 5 - 全部失败
  • 6 - 部分失败
  • 7 - 启动失败
  • 8 - 任务冲突
  • 10 - 未运行
  • 11 - CPU不足
  • 12 - 内存不足
  • 13 - GPU不足
  • 14 - 初始化集群失败
  • 15 - 未购买SKU
  • 31 - 超时
  • 32 - 未知
  • 100 - 初始化中
  • 101 - 初始化失败
  • 102 - 任务丢失
  • 103 - 反馈失败
  • 104 - 排队中
  • 105 - 算法镜像丢失
  • 106 - 评测镜像丢失
  • 107 - 仿真器镜像丢失

name

String

任务名称。

description

String

任务描述。

user_id

String

用户id。

designated_simulation_ids

Array of objects

用户指定重跑子任务ids

batch_config

String

关联batch配置

请求示例

创建仿真任务
POST https://{endpoint}/v2/{project_id}/sim/pm/batches/

{
  "name": "test_batches_create",
  "description": "test_batches_create",
  "algorithm_image": "/v2/my_project_id/sim/pm/algorithm-images/56/",
  "batch_config": "/v2/my_project_id/sim/pm/batch-configs/257/"
}

响应示例

状态码:201

请求成功

{
  "url": "/v2/my_project_id/sim/pm/batches/938/",
  "id": 938,
  "created_at": 1747035787.805102,
  "updated_at": 1747035787.805121,
  "passing_score": 60,
  "algorithm_name": "kyber_to_simpro",
  "algorithm_image": "/v2/my_project_id/sim/pm/algorithm-images/56/",
  "algorithm_image_version": "1",
  "started_at": null,
  "ended_at": null,
  "success": 0,
  "fail": 0,
  "simulation_size": 0,
  "status": 100,
  "name": "test_batches_create",
  "description": "test_batches_create",
  "user_id": "xxxx",
  "designated_simulation_ids": null,
  "batch_config": "/v2/my_project_id/sim/pm/batch-configs/257/"
}

状态码

状态码

描述

201

请求成功

错误码

请参见错误码

相关文档