获取自定义执行机列表
功能介绍
获取自定义执行机列表
调用方法
请参见如何调用API。
URI
GET /v1/tasks/{task_id}/resource-pool
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
task_id |
是 |
String |
任务ID,即新建检查任务接口的返回值,每个CodeArtsCheck任务及其下的分支任务、通过API创建的增量任务都有1个唯一的任务ID |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
page |
否 |
Integer |
页码,非必填 |
page_size |
否 |
Integer |
每页显示的数量,非必填 |
search |
否 |
String |
按自定义执行机名称查找的字符串 |
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
X-Auth-Token |
是 |
String |
用户Token通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 |
X-Language |
否 |
String |
参数解释: 语言,决定响应以哪种语言返回。 约束限制: 不涉及。 取值范围:
默认取值: zh-cn |
响应参数
状态码:200
参数 |
参数类型 |
描述 |
---|---|---|
httpStatus |
String |
响应状态 |
result |
ResourcePoolsResult object |
|
status |
String |
响应状态 |
参数 |
参数类型 |
描述 |
---|---|---|
resourcePoolId |
String |
启用的资源池id,使用内置执行机的情况下为空 |
resourcePoolName |
String |
启用的资源池名称,使用内置执行机的情况下为空 |
resourcePools |
Array of ResourcePoolsItem objects |
可选的资源池列表 |
resourceType |
String |
使用资源池:custom;使用内置执行机:default |
total |
Integer |
总数 |
参数 |
参数类型 |
描述 |
---|---|---|
id |
String |
资源池id |
isSelected |
Boolean |
是否被此任务启用 |
name |
String |
资源池名称 |
type |
String |
资源池类型 |
状态码:400
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
错误码 |
error_msg |
String |
错误描述 |
状态码:401
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
错误码 |
error_msg |
String |
错误描述 |
请求示例
查询task_id对应任务下的自定义执行机列表
GET https://{endpoint}/v1/tasks/{task_id}/resource-pool
响应示例
状态码:200
Request succeeded!
{ "httpStatus" : "OK", "result" : { "resourcePoolId" : "ab2exxxxc0ec4beb99b91629xxxxd380", "resourcePoolName" : "new_engine_4u8g", "resourcePools" : [ { "id" : "ab2exxxxc0ec4beb99b91629xxxxd380", "isSelected" : true, "name" : "new_engine_4u8g", "type" : "DOCKER" }, { "id" : "11223344xxxxxxxx11223344xxxxxxx1", "isSelected" : false, "name" : "Win7Custom", "type" : "WINDOWS_VM" } ], "resourceType" : "custom", "total" : 2 }, "status" : "success" }
状态码:400
Bad Request
{ "error_code" : "CC.00000000", "error_msg" : "网络繁忙,请稍后再试" }
状态码:401
Unauthorized
{ "error_code" : "CC.00000003", "error_msg" : "认证信息过期" }
状态码
状态码 |
描述 |
---|---|
200 |
Request succeeded! |
400 |
Bad Request |
401 |
Unauthorized |
错误码
请参见错误码。