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

创建仿真任务配置

功能介绍

创建仿真任务配置。

URI

POST /v2/{project_id}/sim/pm/batch-configs

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

项目ID,获取方法请参见获取项目ID

请求参数

表2 请求Header参数

参数

是否必选

参数类型

描述

Content-Type

String

内容类型。填application/json

X-Auth-Token

String

用户Token,通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)

表3 请求Body参数

参数

是否必选

参数类型

描述

name

String

仿真任务配置名称,最大长度64位,支持中文,字母,数字及下划线命名

description

String

仿真任务配置描述,最大长度256位,支持中文,字母,数字及下划线命名

duration

String

  • 子任务最大运行时长,单位秒,最小为60,最大为1800

repeat_times

Integer

  • 重复运行次数,最小1次,最大100000次

record_mode

Integer

录制模式,可从以下状态选择:

  • 0 - 不录制
  • 1 - 录制

priority

Integer

优先级,取值越大,优先级越高。可从如下范围中选择:

  • 120 – S:至关重要
  • 100 – A:很重要
  • 80 – B:重要
  • 60 – C:普通

simulator_name

String

仿真器名称,如:B

builtins_evaluation

Boolean

是否使用内置评测

true:使用内置评测

false:不使用内置评测

algorithm

String

关联算法资源地址

datahub

Boolean

是否使用datahub

evaluations

Array of strings

关联评测管理项目列表

custom_evaluation_image

String

关联评测镜像资源地址

custom_simulator_image_id

Integer

镜像管理中的仿真器镜像的版本id

passing_score

Integer

融合评测通过分数,默认60

scenario_type

Integer

场景类型:

  • 0 - 场景库:从场景库选择场景
  • 1 - 逻辑场景:从泛化任务选择任务
  • 2 – 测试套件:从测试套件选择场景

scenarios

scenarios object

场景信息

scenario_set_id

Int

场景集合 id

表4 scenarios

参数

是否必选

参数类型

描述

group_ids

Array of integers

场景库id信息

generalization_ids

Array of integers

泛化任务id信息

suit_ids

Array of integers

测试套件id信息

响应参数

状态码:201

表5 响应Body参数

参数

参数类型

描述

url

String

仿真任务配置的资源地址

id

Integer

仿真任务配置ID

created_at

TimeStamp

创建时间

updated_at

TimeStamp

更新时间

algorithm

String

关联算法资源地址

algorithm_name

String

算法名称

builtins_evaluation

Boolean

是否使用内置评测

custom_evaluation_image

String

关联评测镜像资源地址

custom_simulator_image_id

Integer

镜像管理中的仿真器镜像的版本id

simulator_config

String

仿真器配置信息

evaluation_info

表6 object

评测配置信息

batch_size

Integer

任务数量

duration

String

子任务最大运行时长

repeat_times

Integer

重复运行次数

user_id

String

用户id

name

String

仿真任务配置名称

description

String

仿真任务配置描述

simulator_name

String

仿真器名称,如:B

record_mode

Integer

录制模式

  • 0 - 不录制
  • 1 - 录制

priority

Integer

优先级,取值越大,优先级越高。可从如下范围中选择:

  • 120 – S:至关重要
  • 100 – A:很重要
  • 80 – B:重要
  • 60 – C:普通

datahub

Boolean

是否使用datahub

passing_score

Integer

融合评测通过分数,默认60

scenario_type

Integer

场景类型:

  • 0 - 场景库:从场景库选择场景
  • 1 - 逻辑场景:从泛化任务选择任务
  • 2 – 测试套件:从测试套件选择场景

triggerable

Boolean

是否可通过流水线功能触发

evaluations

Array of strings

关联评测管理项目

scenario_set_id

Int

场景集合 id

traffic

String

交通流量

extensions

Array Of Strings

扩展文件资源地址列表

表6 evaluation_info

参数

参数类型

描述

image

表7 object

镜像信息

表7 image

参数

参数类型

描述

id

Integer

项目id

name

String

项目名称

image_id

Integer

镜像id

image_version

String

镜像版本

请求示例

创建仿真任务配置
POST https://{endpoint}/v2/{project_id}/sim/pm/batch-configs 
 
{
    "name": "batch_config_xxx",
    "description": "batch_config description",
    "duration": 600,
    "evaluations": [
        "/v2/54d37c8f25axxxxxxxe9772687bf/sim/pm/evaluations/74/"
    ],
    "priority": 60,
    "scenarios": {
     },
    "algorithm": "/v2/54d37c8f25axxxxxxxe9772687bf/sim/pm/algorithms/64/",
    "datahub": false,
    "simulator_name": "B",
    "repeat_times": 100000,
    "builtins_evaluation": false,
    "custom_evaluation_image": "/v2/54d37c8f25axxxxxxxe9772687bf/sim/pm/evaluation-images/11/",
    "passing_score": 60,
    "scenario_type": 0,
    "scenario_set_id": 41,
    "record_mode": 1,
    "custom_simulator_image_id": 303973
}

响应示例

状态码:201

{
    "url": "/v2/54d37c8f25axxxxxxxe9772687bf/sim/pm/batch-configs/357/",
    "id": 357,
    "created_at": 1747984785.434156,
    "updated_at": 1747984785.434175,
    "algorithm": "/v2/54d37c8f25axxxxxxxe9772687bf/sim/pm/algorithms/64/",
    "algorithm_name": "algorithm_xxx",
    "builtins_evaluation": false,
    "custom_evaluation_image": "/v2/54d37c8f25axxxxxxxe9772687bf/sim/pm/evaluation-images/11/",
    "custom_simulator_image_id": 303973,
    "simulator_config": "",
    "evaluation_info": {
        "IMAGE": {
            "id": 74,
            "name": "eva_xxx",
            "image_id": 11,
            "image_version": "1"
        }
    },
    "batch_size": 0,
    "duration": "00:10:00",
    "repeat_times": 100000,
    "passing_score": 60,
    "scenario_type": 0,
    "extensions": [],
    "user_id": "5ffa2cb7631xxxxxxx736284af7dc4",
    "name": "batch_config_xxx",
    "description": "batch_config description",
    "simulator_name": "B",
    "record_mode": 1,
    "priority": 60,
    "datahub": false,
    "scenario_set_id": 41,
    "triggerable": false,
    "traffic": null,
    "evaluations": [
        "/v2/54d37c8f25axxxxxxxe9772687bf/sim/pm/evaluations/74/"
    ]
}

状态码

状态码

描述

201

创建成功

错误码

请参见错误码

相关文档