13.应用管理
1. 安装apk
接口地址:/v2/command/instance
请求方式:POST
请求数据类型:application/json
响应数据类型:*/*,application/json
支持版本:v1.1.1
callbackUrl 由 v1.7.4 版本提供
接口描述:
批量操作容器:安装APK到容器
请求参数:
| 参数名称 | 参数说明 | 位置 | 是否必须 | 数据类型 | 描述 |
|---|---|---|---|---|---|
| instanceUuids | 一个或多个容器uuid | body | true | List<string> | |
| command | 安装apk操作命令 | body | true | string | 此处固定填写 [ install ] |
| content | 操作内容对象 | body | true | object | |
| path | 容器上的apk源路径 (优先使用) | body | false | string | [ path ] 和 [ url ] 二选一必传 |
| url | apk http地址 | body | false | string | |
| removeApk | 安装完APK是否删除apk源文件。 | body | false | boolean | true 删除 ,false不删除,默认false |
| callbackUrl | 通知回调地址 | body | false | string | POST请求 |
请求示例:
POST "/openapi/v2/command/instance"
body:
{
"command": "install",
"content": {
"url": "http://www.test.com/xapkazqxz.apk",
"removeApk": false
},
"instanceUuids": [
"0248c04cfb5a4442a636c903fa003dc8",
"0c70e660f6ee4590ad4b65112f4d7af0"
]
}
响应参数:
| 参数名称 | 参数说明 | 类型 | 描述 |
|---|---|---|---|
| code | 返回代码 | integer(int32) | integer(int32) |
| message | 返回处理消息 | string | |
| result | 返回数据对象 | list<object> | 处理请求的具体数据对象 |
| jobId | 任务ID | string | |
| code | 任务提交状态码 | integer | 任务提交成功时为200,其他为任务提交失败 |
| message | 任务提交描述 | string | |
| uuid | 容器uuid | string | |
| command | 指令 | string | |
| nodeUuid | 节点UUID | string | |
| timestamp | 时间戳 | integer(int64) | integer(int64) |
| traceId | 请求处理ID | string | 请求ID,可用此traceId批量查询该请求下任务结果 |
响应示例:
{
"message": "操作成功",
"code": 200,
"result": [
{
"jobId": "99df88be558e4fee9a029181ed7d770d",
"code": 200,
"message": "success",
"uuid": "0248c04cfb5a4442a636c903fa003dc8",
"command": "install",
"nodeUuid": "7a3eacab1939fefec0c1998e37d87ae2"
},
{
"jobId": "2fdb77cd25054c1491e9792729bbc023",
"code": 200,
"message": "success",
"uuid": "0c70e660f6ee4590ad4b65112f4d7af0",
"command": "install",
"nodeUuid": "7a3eacab1939fefec0c1998e37d87ae2"
}
],
"timestamp": 1691370882363,
"traceId": "E75720230807091442338"
}
2. 卸载apk
接口地址:/v2/command/instance
请求方式:POST
请求数据类型:application/json
响应数据类型:*/*,application/json
支持版本:v1.1.1
callbackUrl 由 v1.7.4 版本提供
接口描述:
批量操作容器:卸载容器下已安装APK
请求参数:
| 参数名称 | 参数说明 | 位置 | 是否必须 | 数据类型 | 描述 |
|---|---|---|---|---|---|
| instanceUuids | 一个或多个容器 uuid | body | true | list<string> | |
| command | 安装apk操作命令 | body | true | string | 此处固定填写 [ uninstall ] |
| content | 操作内容对象 | body | true | object | |
| packageName | 卸载目标apk的包名 | body | true | string | |
| callbackUrl | 通知回调地址 | body | false | string | POST请求 |
请求示例:
POST "/openapi/v2/command/instance"
body:
{
"command":"uninstall",
"content":{
"packageName":"com.ioncannon.cpuburn.gpugflops"
},
"instanceUuids": [
"0248c04cfb5a4442a636c903fa003dc8","0c70e660f6ee4590ad4b65112f4d7af0"
]
}
响应参数:
| 参数名称 | 参数说明 | 类型 | 描述 |
|---|---|---|---|
| code | 返回代码 | integer(int32) | |
| message | 返回处理消息 | string | |
| result | 返回数据对象 | List | 处理请求的具体数据对象 |
| jobId | 任务ID | string | |
| code | 任务提交状态码 | integer | 任务提交成功时为200,其他为任务提交失败 |
| message | 任务提交描述 | string | |
| uuid | 容器 uuid | string | |
| command | 指令 | string | |
| nodeUuid | 节点UUID | string | |
| timestamp | 时间戳 | integer(int64) | |
| traceId | 请求处理ID | string | 请求ID,可用此traceId批量查询该请求下任务结果 |
响应示例:
{
"message": "操作成功",
"code": 200,
"result": [
{
"jobId": "2bb246e78fba43ad8d07fd55aef55ecf",
"code": 200,
"message": "success",
"uuid": "0248c04cfb5a4442a636c903fa003dc8",
"command": "uninstall",
"nodeUuid": "7a3eacab1939fefec0c1998e37d87ae2"
},
{
"jobId": "b88f839b104446a0a87ab4d3fc61338f",
"code": 200,
"message": "success",
"uuid": "0c70e660f6ee4590ad4b65112f4d7af0",
"command": "uninstall",
"nodeUuid": "7a3eacab1939fefec0c1998e37d87ae2"
}
],
"timestamp": 1691370955888,
"traceId": "E75820230807091555866"
}
3. 启动APP
接口地址:/v2/command/instance
请求方式:POST
请求数据类型:application/json
响应数据类型:*/*,application/json
支持版本:v1.6.0
接口描述:
启动容器下某个APP
请求参数:
| 参数名称 | 参数说明 | 位置 | 是否必须 | 数据类型 | 描述 |
|---|---|---|---|---|---|
| instanceUuids | 容器uuid | body | true | List<string> | |
| command | 操作命令 | body | true | string | 固定填写 [ app-start ] |
| content | 具体执行命令 | body | true | object | |
| packageName | 待启动的app的包名 | body | true | string | |
| callbackUrl | 通知回调地址 | body | false | string | POST请求 |
请求示例:
POST "/openapi/v2/command/instance"
body:
{
"command": "app-start",
"content": {
"packageName": "com.tencent.mobileqq"
},
"instanceUuids": [
"i-67faf939d0cddd911be4de422f09e392"
]
}
响应参数:
| 参数名称 | 参数说明 | 类型 | 描述 |
|---|---|---|---|
| code | 返回代码 | integer(int32) | |
| message | 返回处理消息 | string | |
| result | 返回数据对象 | List | 处理请求的具体数据对象 |
| jobId | 任务ID | string | |
| code | 任务提交状态码 | integer | 任务提交成功时为200,其他为任务提交失败 |
| message | 任务提交描述 | string | |
| uuid | 容器uuid | string | |
| command | 指令 | string | |
| nodeUuid | 节点UUID | string | |
| timestamp | 时间戳 | integer(int64) | |
| traceId | 请求处理ID | string | 请求ID,可用此traceId批量查询该请求下任务结果 |
响应示例:
{
"message": "操作成功",
"code": 200,
"result": [
{
"jobId": "ec1c2ac1d5e544428c66a0f4f0d9f603",
"code": 200,
"message": "success",
"uuid": "165b41ce26fd406cab7cac868262df44",
"command": "app-start",
"nodeUuid": "7a3eacab1939fefec0c1998e37d87ae2"
},
{
"jobId": "43c7740d8f484b36b08623adac3f6f1d",
"code": 200,
"message": "success",
"uuid": "20271b8ef9674bd2ab59cededc9d3e49",
"command": "app-start",
"nodeUuid": "7a3eacab1939fefec0c1998e37d87ae2"
}
],
"timestamp": 1691371028402,
"traceId": "E75920230807091708379"
}
4. 停止APP
接口地址:/v2/command/instance
请求方式:POST
请求数据类型:application/json
响应数据类型:*/*,application/json
支持版本:v1.6.0
接口描述:
停止容器下某个APP
请求参数:
| 参数名称 | 参数说明 | 位置 | 是否必须 | 数据类型 | 描述 |
|---|---|---|---|---|---|
| instanceUuids | 容器uuid | body | true | List<string> | |
| command | 操作命令 | body | true | string | 固定填写 [ app-stop] |
| content | 具体执行命令 | body | true | object | |
| packageName | 待启动的app的包名 | body | true | string | |
| callbackUrl | 通知回调地址 | body | false | string | POST请求 |
请求示例:
POST "/openapi/v2/command/instance"
body:
{
"command": "app-stop",
"content": {
"packageName": "com.tencent.mobileqq"
},
"instanceUuids": [
"i-67faf939d0cddd911be4de422f09e392"
]
}
响应参数:
| 参数名称 | 参数说明 | 类型 | 描述 |
|---|---|---|---|
| code | 返回代码 | integer(int32) | |
| message | 返回处理消息 | string | |
| result | 返回数据对象 | List | 处理请求的具体数据对象 |
| jobId | 任务ID | string | |
| code | 任务提交状态码 | integer | 任务提交成功时为200,其他为任务提交失败 |
| message | 任务提交描述 | string | |
| uuid | 容器uuid | string | |
| command | 指令 | string | |
| nodeUuid | 节点UUID | string | |
| timestamp | 时间戳 | integer(int64) | |
| traceId | 请求处理ID | string | 请求ID,可用此traceId批量查询该请求下任务结果 |
响应示例:
{
"message": "操作成功",
"code": 200,
"result": [
{
"jobId": "ec1c2ac1d5e544428c66a0f4f0d9f603",
"code": 200,
"message": "success",
"uuid": "165b41ce26fd406cab7cac868262df44",
"command": "app-stop",
"nodeUuid": "7a3eacab1939fefec0c1998e37d87ae2"
},
{
"jobId": "43c7740d8f484b36b08623adac3f6f1d",
"code": 200,
"message": "success",
"uuid": "20271b8ef9674bd2ab59cededc9d3e49",
"command": "app-stop",
"nodeUuid": "7a3eacab1939fefec0c1998e37d87ae2"
}
],
"timestamp": 1691371028402,
"traceId": "E75920230807091708379"
}
5. 设置App为Enable
接口地址:/v2/command/instance
请求方式:POST
请求数据类型:application/json
响应数据类型:*/*,application/json
支持版本:v1.6.0
接口描述:
停止容器下某个APP
请求参数:
| 参数名称 | 参数说明 | 位置 | 是否必须 | 数据类型 | 描述 |
|---|---|---|---|---|---|
| instanceUuids | 容器uuid | body | true | List<string> | |
| command | 操作命令 | body | true | string | 固定填写 [ app-enable] |
| content | 具体执行命令 | body | true | object | |
| packageName | 需要显示的app的包名 | body | true | string | |
| callbackUrl | 通知回调地址 | body | false | string | POST请求 |
请求示例:
POST "/openapi/v2/command/instance"
body:
{
"command": "app-enable",
"content": {
"packageName": "com.tencent.mobileqq"
},
"instanceUuids": [
"i-67faf939d0cddd911be4de422f09e392"
]
}
响应参数:
| 参数名称 | 参数说明 | 类型 | 描述 |
|---|---|---|---|
| code | 返回代码 | integer(int32) | |
| message | 返回处理消息 | string | |
| result | 返回数据对象 | List | 处理请求的具体数据对象 |
| jobId | 任务ID | string | |
| code | 任务提交状态码 | integer | 任务提交成功时为200,其他为任务提交失败 |
| message | 任务提交描述 | string | |
| uuid | 容器uuid | string | |
| command | 指令 | string | |
| nodeUuid | 节点UUID | string | |
| timestamp | 时间戳 | integer(int64) | |
| traceId | 请求处理ID | string | 请求ID,可用此traceId批量查询该请求下任务结果 |
响应示例:
{
"message": "操作成功",
"code": 200,
"result": [
{
"jobId": "ec1c2ac1d5e544428c66a0f4f0d9f603",
"code": 200,
"message": "success",
"uuid": "165b41ce26fd406cab7cac868262df44",
"command": "app-enable",
"nodeUuid": "7a3eacab1939fefec0c1998e37d87ae2"
},
{
"jobId": "43c7740d8f484b36b08623adac3f6f1d",
"code": 200,
"message": "success",
"uuid": "20271b8ef9674bd2ab59cededc9d3e49",
"command": "app-enable",
"nodeUuid": "7a3eacab1939fefec0c1998e37d87ae2"
}
],
"timestamp": 1691371028402,
"traceId": "E75920230807091708379"
}
6. 设置APP为Disable
接口地址:/v2/command/instance
请求方式:POST
请求数据类型:application/json
响应数据类型:*/*,application/json
支持版本:v1.6.0
接口描述:
停止容器下某个APP
请求参数:
| 参数名称 | 参数说明 | 位置 | 是否必须 | 数据类型 | 描述 |
|---|---|---|---|---|---|
| instanceUuids | 容器uuid | body | true | List<string> | |
| command | 操作命令 | body | true | string | 固定填写 [ app-disable] |
| content | 具体执行命令 | body | true | object | |
| packageName | 需要隐藏的app的包名 | body | true | string | |
| callbackUrl | 通知回调地址 | body | false | string | POST请求 |
请求示例:
POST "/openapi/v2/command/instance"
body:
{
"command": "app-disable",
"content": {
"packageName": "com.tencent.mobileqq"
},
"instanceUuids": [
"i-67faf939d0cddd911be4de422f09e392"
]
}
响应参数:
| 参数名称 | 参数说明 | 类型 | 描述 |
|---|---|---|---|
| code | 返回代码 | integer(int32) | |
| message | 返回处理消息 | string | |
| result | 返回数据对象 | List | 处理请求的具体数据对象 |
| jobId | 任务ID | string | |
| code | 任务提交状态码 | integer | 任务提交成功时为200,其他为任务提交失败 |
| message | 任务提交描述 | string | |
| uuid | 容器uuid | string | |
| command | 指令 | string | |
| nodeUuid | 节点UUID | string | |
| timestamp | 时间戳 | integer(int64) | |
| traceId | 请求处理ID | string | 请求ID,可用此traceId批量查询该请求下任务结果 |
响应示例:
{
"message": "操作成功",
"code": 200,
"result": [
{
"jobId": "ec1c2ac1d5e544428c66a0f4f0d9f603",
"code": 200,
"message": "success",
"uuid": "165b41ce26fd406cab7cac868262df44",
"command": "app-disable",
"nodeUuid": "7a3eacab1939fefec0c1998e37d87ae2"
},
{
"jobId": "43c7740d8f484b36b08623adac3f6f1d",
"code": 200,
"message": "success",
"uuid": "20271b8ef9674bd2ab59cededc9d3e49",
"command": "app-disable",
"nodeUuid": "7a3eacab1939fefec0c1998e37d87ae2"
}
],
"timestamp": 1691371028402,
"traceId": "E75920230807091708379"
}