All Products
Search
Document Center

Elastic Cloud Phone:ListTasks

Last Updated:Mar 01, 2024

Queries the list of tasks of an Elastic Cloud Phone (ECP) instance.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID.

cn-hangzhou
TaskIdarrayNo

The task IDs. Valid values of N: 1 to 100.

stringNo

The task ID. Valid values of N: 1 to 100.

t-bp67acfmxazb4p****
TaskStatusstringNo

The task state. Valid values:

  • Finished
  • Processing
  • Failed

This parameter is empty by default.

Note The system only queries tasks that are in the Finished, Processing, and Failed states and ignores other values.
Finished
TaskTypestringNo

The name of the operation that you can call to execute the task on the instance. Valid values:

  • Shell: runs a shell command.
  • InstallApplication: installs an application.
  • UninstallApplication: uninstalls an application.
  • SendFile: uploads a file.
  • ImportImage: imports an image.
Shell
InstanceIdstringNo

The instance ID.

cp-acfmxazb4p***
NextTokenstringNo

The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. You must specify the token that is obtained from the previous query as the value of NextToken.

55C15B1C-D507-45F0-B490-69D6E0F113C6
MaxResultsintegerNo

The maximum number of entries to return on each page. Valid values: 1 to 100. Default value: 50.

50

Response parameters

ParameterTypeDescriptionExample
object
NextTokenstring

A pagination token. It can be used in the next request to retrieve a new page of results.

ADBAAdDWBF2****
RequestIdstring

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E
TotalCountinteger

The total number of tasks.

1
MaxResultsinteger

The maximum number of entries that is returned on each page. Valid values: 1 to 200. Default value: 50.

50
RegionIdstring

The region ID.

cn-hangzhou
Tasksobject []

The tasks.

TaskTypestring

The task type.

Shell
Progressstring

The task progress.

100%
TaskStatusstring

The task state.

Finished
ExecuteMsgstring

The content that is returned after the task is executed. The content can be up to 1,024 bytes in length.

file1 file2
CreateTimestring

The time when the task was created.

2021-04-15 10:10:00
FinishedTimestring

The time when the task ended.

2021-04-15 10:10:01
InstanceIdstring

The instance ID.

cp-acfmxazb4p***
TaskIdstring

The task ID.

t-bp67acfmxazb4p****

Examples

Sample success responses

JSONformat

{
  "NextToken": "ADBAAdDWBF2****",
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
  "TotalCount": 1,
  "MaxResults": 50,
  "RegionId": "cn-hangzhou",
  "Tasks": {
    "Task": [
      {
        "TaskType": "Shell",
        "Progress": "100%",
        "TaskStatus": "Finished",
        "ExecuteMsg": "file1 file2",
        "CreateTime": "2021-04-15 10:10:00",
        "FinishedTime": "2021-04-15 10:10:01",
        "InstanceId": "cp-acfmxazb4p***",
        "TaskId": "t-bp67acfmxazb4p****"
      }
    ]
  }
}

Error codes

For a list of error codes, visit the Service error codes.