执行任务组
功能介绍
执行任务组
调用方法
请参见如何调用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 |
任务列表 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
distance |
否 |
Integer |
循环间隔 |
beginTime |
否 |
Integer |
循环起始时间 |
concludingTime |
否 |
Integer |
循环结束时间 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
id |
否 |
String |
任务ID |
parentId |
否 |
String |
父任务组ID |
taskName |
否 |
String |
任务名称 |
ticcTaskType |
否 |
String |
功能自动化任务类型 |
maxTepNum |
否 |
String |
最大执行机数量 |
testServiceId |
否 |
String |
测试服务ID |
strategyId |
否 |
String |
策略ID |
executeType |
否 |
String |
执行类型 |
testType |
否 |
String |
测试类型 |
startTime |
否 |
String |
启动时间 |
endTime |
否 |
String |
结束时间 |
intervalTime |
否 |
String |
间隔时间 |
|
否 |
String |
邮箱 |
exeParam |
否 |
String |
执行参数 |
exeParamTemplateId |
否 |
String |
参数模板ID |
envSystem |
否 |
String |
环境系统 |
envDetails |
否 |
String |
环境详情 |
resourceType |
否 |
String |
资源类型 |
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
参数 |
参数类型 |
描述 |
---|---|---|
version_id |
String |
版本ID |
version_name |
String |
版本名称 |
task_id |
String |
任务ID |
author |
String |
创建人(用户ID) |
analyser |
String |
分析人员(用户ID) |
ticc_task_type |
String |
功能自动化任务类型 |
test_service_id |
String |
测试服务ID |
user_name |
String |
用户名称或用户ID |
task_group_name |
String |
任务分组名称 |
scheduled_time |
Long |
计划开始时间(时间戳,空为未指定) |
interval_time |
String |
间隔时间数值 |
interval_time_unit |
String |
间隔时间单位 |
task_policy |
Integer |
任务执行策略 |
task_group_exe_param |
task_group_exe_param object |
任务组额外参数 |
task_strategy |
task_strategy object |
任务策略参数 |
circle |
circle object |
循环策略参数 |
over_time_param |
over_time_param object |
超时策略参数 |
tmss_info |
tmss_info object |
用例管理服务 |
tasks |
Array of tasks objects |
任务列表 |
参数 |
参数类型 |
描述 |
---|---|---|
distance |
Integer |
间隔周期 |
begin_time |
Integer |
循环起始时间 |
concluding_time |
Integer |
循环结束时间 |
参数 |
参数类型 |
描述 |
---|---|---|
id |
String |
子任务ID |
parent_id |
String |
父任务ID |
task_name |
String |
子任务名称 |
ticc_task_type |
String |
功能自动化子任务类型 |
max_tep_num |
Integer |
最大TEP数 |
teps |
Array of teps objects |
执行机列表 |
resource_type |
String |
资源类型 |
testbeds |
Array of strings |
测试床 |
need_env_version |
Boolean |
是否需要环境版本 |
env |
Array of strings |
运行环境配置 |
exe_param_overridable |
Boolean |
执行参数是否可被覆盖 |
is_group_exe_param |
String |
是否启用任务组参数 |
task_policy |
Integer |
子任务策略 |
location |
String |
子任务位置 |
max_execute_time |
Integer |
最大执行时间 |
task_mode |
String |
模式 |
priority |
String |
优先级 |
task_strategy |
task_strategy object |
子任务策略 |
rg_id |
String |
区域ID |
uris |
Array of strings |
用例库URIs |
case_uris |
Array of strings |
用例URIs |
p_select |
Array of strings |
选中执行机列表 |
selected_teps |
Array of strings |
实际选中执行机列表 |
service_type |
String |
服务类型 |
userextend_param |
userextend_param object |
用户自定义拓展参数 |
pbi_name |
String |
PBI名称 |
ignore_env |
Boolean |
是否忽略环境 |
Env_Network_Area |
String |
环境网络分区 |
product_name |
String |
产品名称 |
scene |
String |
测试场景名称 |
test_activity_type |
String |
测试活动类型 |
serial_execution |
Boolean |
是否串行执行 |
jenkins_password |
String |
Jenkins密码 |
git_password |
String |
Git密码 |
sut_repo_url |
String |
SUT仓库URL |
env_system |
String |
环境系统 |
download_script_url |
String |
下载脚本URL(json字符串) |
rgid |
String |
区域ID(git存储用) |
ip |
String |
执行机 IP |
jenkins_username |
String |
Jenkins用户名 |
git_branch |
String |
Git分支名 |
pbi_id |
String |
PBI唯一标识 |
task_desc |
String |
任务描述 |
is_select_all_teps |
Boolean |
是否全选执行机 |
iterator_id |
String |
迭代ID |
iterator_name |
String |
迭代名称 |
jenkins_url |
String |
Jenkins地址 |
execute_type |
String |
执行类型 |
port |
String |
端口 |
jenkins_id |
String |
Jenkins唯一标识 |
is_person_config |
Boolean |
是否为个人配置 |
git_username |
String |
Git用户名 |
test_service_id |
String |
测试服务ID |
service_name |
String |
服务名称 |
exe_param |
String |
执行参数 |
exe_param_template_id |
String |
执行参数模板ID |
version_id |
String |
版本ID |
version_name |
String |
版本名称 |
参数 |
参数类型 |
描述 |
---|---|---|
rg_id |
String |
区域ID |
ip |
String |
执行机 IP |
group_id |
String |
执行机分组ID |
tepmanager_id |
String |
执行机管理器ID |
id |
String |
执行机主键 |
参数 |
参数类型 |
描述 |
---|---|---|
is_distribute_by_last_time_cost |
Boolean |
是否按上次耗时分配 |
case_exec_type |
Integer |
用例执行类型 |
check_env_switch |
Boolean |
检查环境开关 |
apply_env_first |
Boolean |
是否优先申请环境 |
parallel_scheduler_block_fields |
String |
并行调度阻断字段 |
one_block |
Boolean |
是否单块调度 |
parallel_batch_size |
Integer |
并行批次大小 |
test_case_block_re_run_type |
Integer |
用例失败重试类型 |
block_size |
Integer |
用例块数 |
extend_param |
String |
额外拓展参数 |
状态码:201
Created
状态码:401
参数 |
参数类型 |
描述 |
---|---|---|
status |
String |
请求状态 |
request_id |
String |
请求id |
server_ip |
String |
服务节点IP |
error_msg |
String |
错误信息 |
error_code |
String |
错误码 |
error_cause |
String |
错误原因 |
faq |
String |
faq内容 |
状态码:403
参数 |
参数类型 |
描述 |
---|---|---|
status |
String |
请求状态 |
request_id |
String |
请求id |
server_ip |
String |
服务节点IP |
error_msg |
String |
错误信息 |
error_code |
String |
错误码 |
error_cause |
String |
错误原因 |
faq |
String |
faq内容 |
状态码:404
参数 |
参数类型 |
描述 |
---|---|---|
status |
String |
请求状态 |
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",
"scheduledTime" : null,
"intervalTime" : "0",
"intervalTimeUnit" : "h",
"taskPolicy" : 3,
"taskGroupExeParam" : {
"exeParam" : "",
"exeParamTemplateId" : ""
},
"taskStrategy" : {
"extendParam" : null
},
"circle" : {
"distance" : 0,
"beginTime" : 0,
"concludingTime" : 0
},
"overTimeParam" : {
"maxExecuteTime" : 0
},
"tmssInfo" : {
"type" : "CloudTMSS",
"url" : {
"url" : null
},
"urlvpc" : ""
},
"tasks" : [ {
"id" : "2569626191665299456",
"parentId" : "2549123529622683648",
"taskName" : 1,
"ticcTaskType" : "executing",
"maxTepNum" : null,
"teps" : [ {
"rgId" : null,
"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,
"extendParam" : null
},
"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",
"maxTepNum" : null,
"teps" : [ {
"rgId" : null,
"ip" : "tep_agaent",
"groupId" : "tep_agaent",
"tepmanagerId" : "",
"id" : "tep_agaent"
}, {
"rgId" : null,
"ip" : "hello_ticc_test_agent",
"groupId" : "hello_ticc_test_agent",
"tepmanagerId" : "",
"id" : "hello_ticc_test_agent"
}, {
"rgId" : null,
"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,
"extendParam" : null
},
"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 |
错误码
请参见错误码。