在一个或多个云手机实例中同步执行命令。
使用 POST 方式发起请求。
下表仅列出了接口特有的请求参数和部分公共参数。完整的公共参数列表,参考 公共请求参数。
字段 | 位置 | 类型 | 必填 | 说明 | 值 |
|---|---|---|---|---|---|
| Action | Query | String | 是 | 公共参数,OpenAPI 接口名称 | RunSyncCommand |
| Version | Query | String | 是 | 公共参数,OpenAPI 接口版本 | 2022-08-01 |
字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| product_id | string | 是 | 实例所归属的业务 ID |
| pod_id_list | []string | 是 | 实例 ID 列表,对多个实例批量执行命令操作时,支持的最大实例数量为 100 |
| command | string | 是 | 待执行的命令;支持的最大长度为1024字节 |
通用返回参数,请参考 ResponseMetadata 结构说明。
Result 字段包含以下参数:
字段 | 类型 | 说明 |
|---|---|---|
| product_id | string | 实例所归属的业务 ID |
| command | string | 对指定的实例执行的命令 |
| status | list | 命令执行状态,参考以下 Status 数据格式说明 |
Status 数据格式
| 字段 | 类型 | 说明 |
|---|---|---|
| pod_id | string | 实例 ID |
| success | bool | 命令是否执行成功 |
| detail | string | 命令执行结果详情 |
POST https://open.volcengineapi.com?Action=RunSyncCommand &Version=2022-08-01 &<通过header传入的公共请求参数> { "product_id":"1608456935646xxxxxx", "pod_id_list":["7299381659819xxxxxx", "7297074858797xxxxxx"], "command":"ls" }
{ "ResponseMetadata": { "Action": "RunSyncCommand", "Region": "cn-north-1", "RequestId": "202311141957287BA1B88E6834E96FD0A7", "Service": "ACEP", "Version": "2022-08-01" }, "Result": { "product_id": "1608456935646xxxxxx", "command": "ls", "status": [ { "pod_id": "7299381659819xxxxxx", "success": true, "detail": "acct\napex\nbin\nvendor\n" }, { "pod_id": "7297074858797xxxxxx", "success": true, "detail": "acct\napex\nbin\nvendor\n" } ] } }