创建或执行任务组 - ExecuteTaskGroup
功能介绍
根据taskPolicy,创建功能自动化任务组,或者直接提交执行自动化任务组
调用方法
请参见如何调用API。
URI
POST /v3/task-group/execution
请求参数
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
X-Auth-Token | 是 | String | 参数解释: 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 约束限制: 必传。 取值范围: 字符串长度不少于1,不超过10万。 默认取值: 不涉及。 |
x-auth-groups | 否 | String | 参数解释 用户权限组。通过调用IAM服务 约束限制 不涉及 取值范围 字符串长度不少于1,不超过100000 默认取值 不涉及 |
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
branchId | 否 | String | 分支ID |
branchName | 否 | String | 分支名称 |
versionId | 否 | String | 版本ID |
versionName | 否 | String | 版本名称 |
id | 否 | String | 唯一ID |
author | 否 | String | 作者ID |
analyser | 否 | String | 分析者ID |
testServiceId | 否 | String | 测试服务ID |
userName | 否 | String | 用户ID |
taskGroupName | 否 | String | 任务组名称 |
scheduledTime | 否 | String | 定时调度时间 |
intervalTime | 否 | String | 调度间隔时间 |
intervalTimeUnit | 否 | String | 调度间隔时间单位 |
taskPolicy | 否 | Integer | 任务策略 |
taskGroupExeParam | 否 | taskGroupExeParam object | 任务组执行参数 |
taskStrategy | 否 | taskStrategy object | 任务策略 |
circle | 否 | circle object | 循环执行参数 |
overTimeParam | 否 | overTimeParam object | 超时参数 |
tmssInfo | 否 | tmssInfo object | 测试用例信息 |
tasks | 否 | Array of tasks objects | 任务列表 |
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
id | 否 | String | 任务ID |
parentId | 否 | String | 父任务组ID |
taskName | 否 | String | 任务名称 |
ticcTaskType | 否 | String | 功能自动化任务类型:serial - 串行,parallel - 并行,executing - 执行中 |
maxTepNum | 否 | String | 最大执行器数量 |
testServiceId | 否 | String | 测试服务ID |
strategyId | 否 | String | 策略ID |
executeType | 否 | String | 执行类型 |
testType | 否 | String | 测试类型:regression - 回归 |
startTime | 否 | String | 启动时间 |
endTime | 否 | String | 结束时间 |
intervalTime | 否 | String | 间隔时间 |
否 | String | 邮箱 | |
exeParam | 否 | String | 执行参数 |
exeParamTemplateId | 否 | String | 参数模板ID |
envSystem | 否 | String | 环境系统 |
envDetails | 否 | String | 环境详情 |
resourceType | 否 | String | 资源类型:"TestVersion" - 测试版本,"TestItem" - 测试项,"TaskFolder" - 任务目录,"TestCase" - 测试用例,"Task" - 任务,"UserDefined" - 用户定义 |
uris | 否 | Array of strings | 用例uri列表 |
ip | 否 | String | IP地址 |
port | 否 | String | 端口号 |
taskPolicy | 否 | String | 任务策略 |
isPersonConfig | 否 | Boolean | 是否个人配置 |
sutRepoUrl | 否 | String | SUT代码仓地址 |
gitUsername | 否 | String | git用户名 |
ignoreEnv | 否 | Boolean | 忽略环境 |
needEnvVersion | 否 | Boolean | 需要环境版本 |
rgId | 否 | String | 区域 |
testbeds | 否 | Array of strings | 测试床 |
location | 否 | String | 位置 |
inputHost | 否 | String | 输入主机 |
env | 否 | Array of strings | 环境变量 |
teps | 否 | Array of teps objects | 执行器数组 |
taskDesc | 否 | String | 任务描述 |
selectedTeps | 否 | Array of strings | 选中的执行器 |
pSelect | 否 | Array of strings | 选择执行器 |
caseUris | 否 | Array of strings | 用例URIs |
taskUris | 否 | Array of strings | 任务URIs |
isGroupExeParam | 否 | Boolean | 是否组执行参数 |
showPreCondition | 否 | String | 展示前置条件 |
showTermination | 否 | String | 展示终止条件 |
jenkinsUrl | 否 | String | Jenkins地址 |
jenkinsUsername | 否 | String | Jenkins用户名 |
jenkinsPassword | 否 | String | Jenkins密码 |
userextendParam | 否 | userextendParam object | 用户扩展参数 |
exe_param_overridable | 否 | Boolean | 执行参数可覆盖 |
user_init_sh | 否 | String | 用户初始化脚本 |
user_finalized_sh | 否 | String | 用户最终处理脚本 |
cpts_kpi_monitor | 否 | String | cpts kpi监控 |
serial_execution | 否 | Boolean | 串行执行 |
taskStrategy | 否 | taskStrategy object | 任务策略 |
author | 否 | String | 任务创建人 |
analyser | 否 | String | 任务分析人 |
jenkinsId | 否 | String | Jenkins任务ID |
stageId | 否 | Integer | 阶段ID |
git_branch | 否 | String | git分支 |
circle | 否 | Object | 循环信息 |
scene | 否 | String | 场景 |
coverageServer | 否 | String | 覆盖服务器 |
taskMode | 否 | String | 任务模式 |
isSelectAllTeps | 否 | Boolean | 是否全选执行器 |
downloadScriptUrl | 否 | String | 下载脚本url |
serviceName | 否 | String | 服务名称 |
branchId | 否 | String | 分支ID |
branchName | 否 | String | 分支名称 |
versionId | 否 | String | 版本ID |
versionName | 否 | String | 版本名称 |
响应参数
状态码:200
参数 | 参数类型 | 描述 |
|---|---|---|
result | result object | 任务结果 |
requestId | String | 请求唯一标识 |
serverIp | String | 服务端IP |
status | String | 状态:ok - 成功 |
状态码:201
Created
状态码:401
参数 | 参数类型 | 描述 |
|---|---|---|
status | String | 请求状态:"failed" - 失败 |
request_id | String | 请求id |
server_ip | String | 服务节点IP |
error_msg | String | 错误信息 |
error_code | String | 错误码 |
error_cause | String | 错误原因 |
faq | String | faq内容 |
状态码:403
参数 | 参数类型 | 描述 |
|---|---|---|
status | String | 请求状态:"failed" - 失败 |
request_id | String | 请求id |
server_ip | String | 服务节点IP |
error_msg | String | 错误信息 |
error_code | String | 错误码 |
error_cause | String | 错误原因 |
faq | String | faq内容 |
状态码:404
参数 | 参数类型 | 描述 |
|---|---|---|
status | String | 请求状态:"failed" - 失败 |
request_id | String | 请求id |
server_ip | String | 服务节点IP |
error_msg | String | 错误信息 |
error_code | String | 错误码 |
error_cause | String | 错误原因 |
faq | String | faq内容 |
请求示例
执行任务组
post https://{endpoint}/v3/task-group/execution
{
"versionId" : "v9050000tqu3e7e2",
"versionName" : "用例库",
"taskId" : "2549123529622683648",
"author" : "efdb403066474ab08836b9eeaaa23bca",
"analyser" : "efdb403066474ab08836b9eeaaa23bca",
"ticcTaskType" : "TiccTaskProject",
"testServiceId" : "c2d63f9d3af34177ab62545d841c78d7",
"userName" : "efdb403066474ab08836b9eeaaa23bca",
"taskGroupName" : "xxxxx",
"intervalTime" : "0",
"intervalTimeUnit" : "h",
"taskPolicy" : 3,
"taskGroupExeParam" : {
"exeParam" : "",
"exeParamTemplateId" : ""
},
"taskStrategy" : { },
"circle" : {
"distance" : 0,
"beginTime" : 0,
"concludingTime" : 0
},
"overTimeParam" : {
"maxExecuteTime" : 0
},
"tmssInfo" : {
"type" : "CloudTMSS",
"url" : { },
"urlvpc" : ""
},
"tasks" : [ {
"id" : "2569626191665299456",
"parentId" : "2549123529622683648",
"taskName" : 1,
"ticcTaskType" : "executing",
"teps" : [ {
"ip" : "10.10.10.10:3000",
"groupId" : "10.10.10.10:3000",
"tepmanagerId" : "",
"id" : "10.10.10.10:3000"
} ],
"resourceType" : "TestCase",
"testbeds" : [ ],
"needEnvVersion" : false,
"env" : [ ],
"exe_param_overridable" : false,
"isGroupExeParam" : "true",
"taskPolicy" : 3,
"location" : "",
"maxExecuteTime" : 0,
"taskMode" : "2+1",
"priority" : "",
"taskStrategy" : {
"isDistributeByLastTimeCost" : false,
"caseExecType" : 2,
"checkEnvSwitch" : true,
"applyEnvFirst" : false,
"parallelSchedulerBlockFields" : "exeplatform,envType,mapRestrict",
"oneBlock" : false,
"parallelBatchSize" : 2500,
"testCaseBlockReRunType" : 2,
"blockSize" : 10
},
"rgId" : "",
"uris" : [ "v92n00010cj7l81b" ],
"caseUris" : [ "v92n00010cj7l81b" ],
"pSelect" : [ "10.10.10.10:3000" ],
"selectedTeps" : [ "10.10.10.10:3000" ],
"serviceType" : "Single",
"userextendParam" : {
"platFromErrStrategy" : "no"
},
"pbiName" : "",
"ignoreEnv" : false,
"Env_Network_Area" : "networkArea",
"productName" : "productName",
"scene" : "",
"testActivityType" : "",
"serial_execution" : false,
"jenkinsPassword" : "",
"sutRepoUrl" : "",
"envSystem" : "",
"downloadScriptUrl" : "{\"downloadScriptUrl\":{\"api_host\":\"apigw.huawei.com\"}}",
"rgid" : "",
"ip" : "",
"jenkinsUsername" : "",
"pbiId" : "",
"taskDesc" : "",
"isSelectAllTeps" : false,
"iteratorId" : "v9050000tqu3e7e2",
"iteratorName" : "用例库",
"jenkinsUrl" : "",
"executeType" : "6",
"port" : "",
"jenkinsId" : "",
"isPersonConfig" : false,
"gitUsername" : "",
"git_branch" : "",
"testServiceId" : "c2d63f9d3af34177ab62545d841c78d7",
"serviceName" : "deng_test",
"exeParam" : "",
"exeParamTemplateId" : "",
"versionId" : "v9050000tqu3e7e2",
"versionName" : "用例库"
}, {
"id" : "2569626191665299457",
"parentId" : "2549123529622683648",
"taskName" : "test_三方仓库_copy_16r",
"ticcTaskType" : "executing",
"teps" : [ {
"ip" : "tep_agaent",
"groupId" : "tep_agaent",
"tepmanagerId" : "",
"id" : "tep_agaent"
}, {
"ip" : "hello_ticc_test_agent",
"groupId" : "hello_ticc_test_agent",
"tepmanagerId" : "",
"id" : "hello_ticc_test_agent"
}, {
"ip" : "10.10.10.10:3000",
"groupId" : "10.10.10.10:3000",
"tepmanagerId" : "",
"id" : "10.10.10.10:3000"
} ],
"resourceType" : "TestCase",
"testbeds" : [ ],
"needEnvVersion" : false,
"env" : [ ],
"exe_param_overridable" : false,
"isGroupExeParam" : "true",
"taskPolicy" : 3,
"location" : "",
"maxExecuteTime" : 0,
"taskMode" : "2+1",
"priority" : "",
"taskStrategy" : {
"isDistributeByLastTimeCost" : false,
"caseExecType" : 2,
"checkEnvSwitch" : true,
"applyEnvFirst" : false,
"parallelSchedulerBlockFields" : "exeplatform,envType,mapRestrict",
"oneBlock" : false,
"parallelBatchSize" : 2500,
"testCaseBlockReRunType" : 2,
"blockSize" : 10
},
"rgId" : "",
"uris" : [ "v92n000109d66hls", "v92t00010975ks7s" ],
"caseUris" : [ "v92n000109d66hls", "v92t00010975ks7s" ],
"pSelect" : [ "tep_agaent", "hello_ticc_test_agent", "10.10.10.10:3000" ],
"selectedTeps" : [ "tep_agaent", "hello_ticc_test_agent", "10.10.10.10:3000" ],
"serviceType" : "Single",
"userextendParam" : {
"platFromErrStrategy" : "no"
},
"pbiName" : "",
"ignoreEnv" : false,
"Env_Network_Area" : "networkArea",
"productName" : "productName",
"scene" : "",
"testActivityType" : "",
"serial_execution" : false,
"jenkinsPassword" : "",
"gitPassword" : "",
"sutRepoUrl" : "1231231122",
"envSystem" : "",
"downloadScriptUrl" : "{\"downloadScriptUrl\":{\"api_host\":\"apigw.huawei.com\"}}",
"rgid" : "",
"ip" : "",
"jenkinsUsername" : "",
"git_branch" : "123123111222",
"pbiId" : "",
"taskDesc" : "",
"isSelectAllTeps" : false,
"iteratorId" : "v9050000tqu3e7e2",
"iteratorName" : "用例库",
"jenkinsUrl" : "",
"executeType" : "6",
"port" : "",
"jenkinsId" : "",
"isPersonConfig" : true,
"gitUsername" : "",
"testServiceId" : "c2d63f9d3af34177ab62545d841c78d7",
"serviceName" : "deng_test",
"exeParam" : "",
"exeParamTemplateId" : "",
"versionId" : "v9050000tqu3e7e2",
"versionName" : "用例库"
} ]
} 响应示例
状态码:200
OK
{
"result" : {
"id" : "2549123529622683648"
},
"requestId" : "",
"serverIp" : "",
"status" : "ok"
} 状态码:401
Unauthorized
{
"error_code" : "DEV.00000003",
"error_msg" : "认证信息过期"
} 状态码
状态码 | 描述 |
|---|---|
200 | OK |
201 | Created |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
错误码
请参见错误码。

