Help Center/ Data Replication Service/ API Reference/ Application Examples/ Scenario 1: Querying Task Statuses in Batches
Updated on 2024-08-23 GMT+08:00

Scenario 1: Querying Task Statuses in Batches

Scenarios

This section describes how to query the status of all tasks of a tenant by calling the API described in Querying Task Statuses in Batches.

Procedure

  1. Call an IAM API to obtain a user token by referring to Authentication.
  2. Obtain the ID of the task to be queried by referring to Obtaining a Task ID.
  3. URI format: /v3/{project_id}/jobs/batch-status

    • Example request:

      POST: https://{endpoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs/batch-status

      Obtain the endpoint from Regions and Endpoints.

    • Request example:
      https://{endpoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs/batch-status
      
      {
        "jobs" : [ "9a470239-2308-4bb5-a6bc-1040402fjb21", "dc67695a-ee3e-49b8-a022-a099bd81jb21" ],
        "page_req" : {
          "cur_page" : 1,
          "per_page" : 10
        }
      }
    • Example Response:
      {
        "results" : [ {
          "id" : "9a470239-2308-4bb5-a6bc-1040402fjb21",
          "status" : "INCRE_TRANSFER_STARTED"
        }, {
          "id" : "dc67695a-ee3e-49b8-a022-a099bd81jb21",
          "status" : "INCRE_TRANSFER_FAILED"
        } ],
        "count" : 2
      }