13.Application management
1. Install apk
API address:/v2/command/instance
Request method:POST
Request data type:application/json
Response data type:*/*,application/json
Supported version:v1.1.1
callbackUrl provided by version v1.7.4
API description:
Batch container operation: install APK to the container
Request parameters:
| Parameter name | Parameter description | Location | Whether required | Data type | Description |
|---|---|---|---|---|---|
| instanceUuids | one or more container uuid | body | true | List<string> | |
| command | Command for installing apk | body | true | string | Fill in [ install ] here as a fixed value |
| content | Operation content object | body | true | object | |
| path | apk source path on the container (preferred) | body | false | string | [ path ] and [ url ], one of the two is required |
| url | apk http address | body | false | string | |
| removeApk | Whether to delete the apk source file after APK installation is complete. | body | false | boolean | true delete, false do not delete, default false |
| callbackUrl | Notification callback address | body | false | string | POST request |
Request example:
POST "/openapi/v2/command/instance"
body:
{
"command": "install",
"content": {
"url": "http://www.test.com/xapkazqxz.apk",
"removeApk": false
},
"instanceUuids": [
"0248c04cfb5a4442a636c903fa003dc8",
"0c70e660f6ee4590ad4b65112f4d7af0"
]
}
Response parameters:
| Parameter name | Parameter description | Type | Description |
|---|---|---|---|
| code | Return code | integer(int32) | integer(int32) |
| message | Return processing message | string | |
| result | Returned data object | list<object> | Specific data object for processing the request |
| jobId | Task ID | string | |
| code | Task submission status code | integer | 200 when the task is submitted successfully; otherwise, the task submission failed |
| message | Task submission description | string | |
| uuid | Container uuid | string | |
| command | Command | string | |
| nodeUuid | Node UUID | string | |
| timestamp | Timestamp | integer(int64) | integer(int64) |
| traceId | Request processing ID | string | Request ID; this traceId can be used to query task results under this request in batches |
Response example:
{
"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. Uninstall apk
API address:/v2/command/instance
Request method:POST
Request data type:application/json
Response data type:*/*,application/json
Supported version:v1.1.1
callbackUrl provided by version v1.7.4
API description:
Batch container operation: uninstall installed APKs in the container
Request parameters:
| Parameter name | Parameter description | Location | Whether required | Data type | Description |
|---|---|---|---|---|---|
| instanceUuids | one or more container uuid | body | true | list<string> | |
| command | Command for installing apk | body | true | string | Fill in [ uninstall ] here as a fixed value |
| content | Operation content object | body | true | object | |
| packageName | Package name of the target apk to uninstall | body | true | string | |
| callbackUrl | Notification callback address | body | false | string | POST request |
Request example:
POST "/openapi/v2/command/instance"
body:
{
"command":"uninstall",
"content":{
"packageName":"com.ioncannon.cpuburn.gpugflops"
},
"instanceUuids": [
"0248c04cfb5a4442a636c903fa003dc8","0c70e660f6ee4590ad4b65112f4d7af0"
]
}
Response parameters:
| Parameter name | Parameter description | Type | Description |
|---|---|---|---|
| code | Return code | integer(int32) | |
| message | Return processing message | string | |
| result | Returned data object | List | Specific data object for processing the request |
| jobId | Task ID | string | |
| code | Task submission status code | integer | 200 when the task is submitted successfully; otherwise, the task submission failed |
| message | Task submission description | string | |
| uuid | Container uuid | string | |
| command | Command | string | |
| nodeUuid | Node UUID | string | |
| timestamp | Timestamp | integer(int64) | |
| traceId | Request processing ID | string | Request ID; this traceId can be used to query task results under this request in batches |
Response example:
{
"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. Start APP
API address:/v2/command/instance
Request method:POST
Request data type:application/json
Response data type:*/*,application/json
Supported version:v1.6.0
API description:
Start an APP in the container
Request parameters:
| Parameter name | Parameter description | Location | Whether required | Data type | Description |
|---|---|---|---|---|---|
| instanceUuids | Container uuid | body | true | List<string> | |
| command | Operation command | body | true | string | Fixed value [ app-start ] |
| content | Specific execution command | body | true | object | |
| packageName | Package name of the app to be started | body | true | string | |
| callbackUrl | Notification callback address | body | false | string | POST request |
Request example:
POST "/openapi/v2/command/instance"
body:
{
"command": "app-start",
"content": {
"packageName": "com.tencent.mobileqq"
},
"instanceUuids": [
"i-67faf939d0cddd911be4de422f09e392"
]
}
Response parameters:
| Parameter name | Parameter description | Type | Description |
|---|---|---|---|
| code | Return code | integer(int32) | |
| message | Return processing message | string | |
| result | Returned data object | List | Specific data object for processing the request |
| jobId | Task ID | string | |
| code | Task submission status code | integer | 200 when the task is submitted successfully; otherwise, the task submission failed |
| message | Task submission description | string | |
| uuid | Container uuid | string | |
| command | Command | string | |
| nodeUuid | Node UUID | string | |
| timestamp | Timestamp | integer(int64) | |
| traceId | Request processing ID | string | Request ID; this traceId can be used to query task results under this request in batches |
Response example:
{
"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. Stop APP
API address:/v2/command/instance
Request method:POST
Request data type:application/json
Response data type:*/*,application/json
Supported version:v1.6.0
API description:
Stop an APP under the container
Request parameters:
| Parameter name | Parameter description | Location | Whether required | Data type | Description |
|---|---|---|---|---|---|
| instanceUuids | Container uuid | body | true | List<string> | |
| command | Operation command | body | true | string | Fixed value [ app-stop] |
| content | Specific execution command | body | true | object | |
| packageName | Package name of the app to be started | body | true | string | |
| callbackUrl | Notification callback address | body | false | string | POST request |
Request example:
POST "/openapi/v2/command/instance"
body:
{
"command": "app-stop",
"content": {
"packageName": "com.tencent.mobileqq"
},
"instanceUuids": [
"i-67faf939d0cddd911be4de422f09e392"
]
}
Response parameters:
| Parameter name | Parameter description | Type | Description |
|---|---|---|---|
| code | Return code | integer(int32) | |
| message | Return processing message | string | |
| result | Returned data object | List | Specific data object for processing the request |
| jobId | Task ID | string | |
| code | Task submission status code | integer | 200 when the task is submitted successfully; otherwise, the task submission failed |
| message | Task submission description | string | |
| uuid | Container uuid | string | |
| command | Command | string | |
| nodeUuid | Node UUID | string | |
| timestamp | Timestamp | integer(int64) | |
| traceId | Request processing ID | string | Request ID; this traceId can be used to query task results under this request in batches |
Response example:
{
"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. Set App to Enable
API address:/v2/command/instance
Request method:POST
Request data type:application/json
Response data type:*/*,application/json
Supported version:v1.6.0
API description:
Stop an APP under the container
Request parameters:
| Parameter name | Parameter description | Location | Whether required | Data type | Description |
|---|---|---|---|---|---|
| instanceUuids | Container uuid | body | true | List<string> | |
| command | Operation command | body | true | string | Fixed value [ app-enable] |
| content | Specific execution command | body | true | object | |
| packageName | Package name of the app to be displayed | body | true | string | |
| callbackUrl | Notification callback address | body | false | string | POST request |
Request example:
POST "/openapi/v2/command/instance"
body:
{
"command": "app-enable",
"content": {
"packageName": "com.tencent.mobileqq"
},
"instanceUuids": [
"i-67faf939d0cddd911be4de422f09e392"
]
}
Response parameters:
| Parameter name | Parameter description | Type | Description |
|---|---|---|---|
| code | Return code | integer(int32) | |
| message | Return processing message | string | |
| result | Returned data object | List | Specific data object for processing the request |
| jobId | Task ID | string | |
| code | Task submission status code | integer | 200 when the task is submitted successfully; otherwise, the task submission failed |
| message | Task submission description | string | |
| uuid | Container uuid | string | |
| command | Command | string | |
| nodeUuid | Node UUID | string | |
| timestamp | Timestamp | integer(int64) | |
| traceId | Request processing ID | string | Request ID; this traceId can be used to query task results under this request in batches |
Response example:
{
"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. Set APP to Disable
API address:/v2/command/instance
Request method:POST
Request data type:application/json
Response data type:*/*,application/json
Supported version:v1.6.0
API description:
Stop an APP under the container
Request parameters:
| Parameter name | Parameter description | Location | Whether required | Data type | Description |
|---|---|---|---|---|---|
| instanceUuids | Container uuid | body | true | List<string> | |
| command | Operation command | body | true | string | Fixed value [ app-disable] |
| content | Specific execution command | body | true | object | |
| packageName | Package name of the app to be hidden | body | true | string | |
| callbackUrl | Notification callback address | body | false | string | POST request |
Request example:
POST "/openapi/v2/command/instance"
body:
{
"command": "app-disable",
"content": {
"packageName": "com.tencent.mobileqq"
},
"instanceUuids": [
"i-67faf939d0cddd911be4de422f09e392"
]
}
Response parameters:
| Parameter name | Parameter description | Type | Description |
|---|---|---|---|
| code | Return code | integer(int32) | |
| message | Return processing message | string | |
| result | Returned data object | List | Specific data object for processing the request |
| jobId | Task ID | string | |
| code | Task submission status code | integer | 200 when the task is submitted successfully; otherwise, the task submission failed |
| message | Task submission description | string | |
| uuid | Container uuid | string | |
| command | Command | string | |
| nodeUuid | Node UUID | string | |
| timestamp | Timestamp | integer(int64) | |
| traceId | Request processing ID | string | Request ID; this traceId can be used to query task results under this request in batches |
Response example:
{
"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"
}