All Products
Search
Document Center

Elastic Cloud Phone:ListTasks

Last Updated:Jan 05, 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.

Debug

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
cloudphone:ListTasksRead
  • Instance
    acs:cloudphone:{#regionId}:{#accountId}:instance/*
    none
none

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.