Help Center/ Object Storage Migration Service/ API Reference/ Out-of-Date APIs/ Querying the Total Number of Migration Tasks of a Tenant
Updated on 2023-12-27 GMT+08:00

Querying the Total Number of Migration Tasks of a Tenant

Function

This API is used to query the total number of migration tasks of a tenant.

URI

GET /v1/{project_id}/objectstorage/task?totalcount={true}&state={state}

Table 1 describes the parameters in the URI.

Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

totalcount

Yes

Specifies the total number of tasks to be returned by the API. true indicates that the number of tasks that meet the criteria will be returned by the API.

state

No

Specifies the task status as follows:

  • 0: Not started
  • 1: Waiting to migrate
  • 2: Migrating
  • 3: Migration paused
  • 4: Migration failed
  • 5: Migration succeeded

Request

Request Parameters

None.

Response

Response Parameters

Table 2 describes the response parameters.

Table 2 Response parameters

Parameter

Type

Description

taskcount

long

Specifies the number of tasks.

Examples

Request example

GET /v1/{project_id}/objectstorage/task?totalcount=true&state=0

Response example

{
"taskcount": 35
}

Status Code

For details about the status code, see Status Code.