Synchronization Command
Function
This API is used to execute a synchronization command for an instance. Before calling this API, ensure that the tenant has purchased a KooPhone cloud phone instance. You can call this API to perform ADB operations on your KooPhone cloud phone instance. This API is used for synchronization. If time-consuming ADB operations are performed, you are advised to use the API for executing an asynchronization command for an instance.
URI
POST /v1/instances/sync-command
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
x-request-id |
Yes |
String |
Unique ID of a request. |
X-Auth-Token |
Yes |
String |
Tenant-level token. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
command |
Yes |
String |
Command. The value can contain up to 1,024 bytes, including only letters, digits, underscores (_), dots (.), slashes (/), colons (:), and hyphens (-). Maximum: 1024 |
instance_ids |
Yes |
Array of strings |
Instance list. Maximum: 32 |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Response code. The error code specification is KP.API.0001, and the number increases in ascending order. |
error_msg |
String |
Response description. |
data |
CmdResultWrapper object |
Command execution result. |
Parameter |
Type |
Description |
---|---|---|
cmd_results |
Array of CmdResult objects |
Command execution result. |
Parameter |
Type |
Description |
---|---|---|
instance_id |
String |
Instance ID. Maximum: 32 |
status |
Integer |
Task status. 1: Running. 2: Successful. -1: Failed. |
error_code |
String |
Task error code. |
error_msg |
String |
Task error code description. |
execute_msg |
String |
Content returned after a task is executed. The value can contain up to 1,024 bytes. The command output is returned regardless of whether the command is successfully executed. Maximum: 1024 |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Response code. The error code specification is KOOPHONE.API.0001, and the number increases in ascending order. If error_code is 0, the operation is successful. |
error_msg |
String |
Response description. |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Response code. The error code specification is KOOPHONE.API.0001, and the number increases in ascending order. If error_code is 0, the operation is successful. |
error_msg |
String |
Response description. |
Example Requests
/v1/instances/sync-command { "command" : "ls -l /system", "instance_ids" : [ "a44uhlf7", "efjy72gs" ] }
Example Responses
Status code: 200
OK
{ "data" : { "cmd_results" : [ { "instance_id" : "a44uhlf7", "status" : -1, "error_code" : "CPS.0191", "error_msg" : "Run command failed.", "execute_msg" : "ls: cannot access '/system': No such file or directory" }, { "instance_id" : "efjy72gs", "status" : 2, "error_code" : "", "error_msg" : "", "execute_msg" : "xxxxxx" } ] }, "error_code" : "0", "error_msg" : "ok" }
Status Codes
Status Code |
Description |
---|---|
200 |
OK |
400 |
Bad Request |
500 |
Internal Server Error |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot