Querying Task Details in Batches

Function

This API is used to query task details in batches by task ID.

URI

POST /v3/{project_id}/jobs/batch-detail

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID of a tenant in a region

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

The content type.

The default value is application/json.

X-Auth-Token

Yes

String

User token obtained from IAM.

X-Language

No

String

Request language type

Default value: en-us

Values:

  • en-us

  • zh-cn

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

jobs

Yes

Array of strings

Querying task details in batches

page_req

No

PageReq object

Pagination information.

Table 4 PageReq

Parameter

Mandatory

Type

Description

cur_page

No

Integer

Current page number, which cannot exceed the maximum number of pages. (Number of pages = Number of transferred job IDs/Number of tasks on each page)

  • Minimum value: 1.

  • Default value: 1

per_page

No

Integer

Number of items on each page. If this parameter is set to 0, all items are obtained.

  • Minimum value: 0

  • Maximum value: 100

  • Default value: 5

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

count

Integer

Number of tasks.

results

Array of QueryJobResp objects

Task details.

Table 6 QueryJobResp

Parameter

Type

Description

id

String

Task ID.

parent_id

String

Parent task ID.

name

String

Task name.

status

String

Task status. Values:

  • CREATING: The task is being created.

  • CREATE_FAILED: The task fails to be created.

  • CONFIGURATION: The task is being configured.

  • STARTJOBING: The task is being started.

  • WAITING_FOR_START: The task is waiting to be started.

  • START_JOB_FAILED: The task fails to be started.

  • FULL_TRANSFER_STARTED: Full migration is in progress, and the DR scenario is initialized.

  • FULL_TRANSFER_FAILED: Full migration failed. Initialization failed in the DR scenario.

  • FULL_TRANSFER_COMPLETE: Full migration is complete, and the initialization is complete in the DR scenario.

  • INCRE_TRANSFER_STARTED: Incremental migration is being performed, and the DR task is in progress.

  • INCRE_TRANSFER_FAILED: Incremental migration fails and a DR exception occurs.

  • RELEASE_RESOURCE_STARTED: The task is being stopped.

  • RELEASE_RESOURCE_FAILED: Stop task failed.

  • RELEASE_RESOURCE_COMPLETE: The task is stopped.

  • CHANGE_JOB_STARTED: The task is being changed.

  • CHANGE_JOB_FAILED: Change task failed.

  • CHILD_TRANSFER_STARTING: The subtask is being started.

  • CHILD_TRANSFER_STARTED: The subtask is being migrated.

  • CHILD_TRANSFER_COMPLETE: The subtask migration is complete.

  • CHILD_TRANSFER_FAILED: Migrate subtask failed.

  • RELEASE_CHILD_TRANSFER_STARTED: The subtask is being stopped.

  • RELEASE_CHILD_TRANSFER_COMPLETE: The subtask is complete.

description

String

Description.

create_time

String

Creation time, in timestamp format.

task_type

String

Task mode. Values:

  • FULL_TRANS: full migration

  • INCR_TRANS: incremental migration

  • FULL_INCR_TRANS: full+incremental migration

source_endpoint

Endpoint object

Source database information.

dmq_endpoint

Endpoint object

DMQ information body.

source_sharding

Array of Endpoint objects

Information about the physical source database.

target_endpoint

Endpoint object

Information body of the destination database.

net_type

String

Network type. Values:

  • vpn

  • vpc

  • eip

failed_reason

String

Failure cause.

inst_info

InstInfo object

Replication instance information.

actual_start_time

String

Start time, in timestamp format.

full_transfer_complete_time

String

Full migration completion time, in timestamp format.

update_time

String

Update time, in timestamp format.

job_direction

String

Task direction. Values:

  • up: The current cloud is the standby cloud in the DR and to-the-cloud scenarios.

  • down: The current cloud is the active cloud in the DR and out-of-cloud scenarios.

  • non-dbs: self-built databases.

db_use_type

String

Migration scenario Values:

  • migration: real-time migration.

  • sync: real-time synchronization.

  • cloudDataGuard: real-time disaster recovery.

need_restart

Boolean

Whether the instance needs to be restarted.

is_target_readonly

Boolean

Whether the destination instance is restricted to read-only.

conflict_policy

String

Conflict policy. Values:

  • stop: The conflict fails.

  • overwrite: Conflicting data is overwritten.

  • ignore: The conflict is ignored.

filter_ddl_policy

String

DDL filtering policy. Values:

  • drop_database: Filters DDLs.

  • drop_databasefilter_all: Filters out all DLLs.

  • "": No filter.

speed_limit

Array of SpeedLimitInfo objects

Migration speed limit.

schema_type

String

Migration schemes. Values:

  • Replication: primary/standby replication.

  • Tungsten: parses logs.

  • PGBaseBackup: PostgreSQL backup.

node_num

String

The number of nodes.

object_switch

Boolean

Whether to select objects.

master_job_id

String

Main task ID

full_mode

String

Full snapshot mode.

struct_trans

Boolean

Whether to migrate the structure.

index_trans

Boolean

Whether to migrate indexes.

replace_definer

Boolean

Whether to replace the definer with the user of the destination database.

migrate_user

Boolean

Whether to migrate users.

sync_database

Boolean

Whether to perform database-level synchronization.

error_code

String

Error code, which is optional and indicates the returned information about the failure status.

error_message

String

Error message, which is optional and indicates the returned information about the failure status.

target_root_db

DefaultRootDb object

Information about the root node database of the destination instance.

az_code

String

AZ where the node is located.

vpc_id

String

VPC to which the node belongs.

subnet_id

String

Subnet where the node is located.

security_group_id

String

Security group to which the node belongs.

multi_write

Boolean

Whether the task is a multi-active DR task. The value is true when the task is a dual-active DR task.

support_ip_v6

Boolean

Whether IPv6 is supported

inherit_id

String

Inherited task ID.

gtid

String

GTID set of breakpoints.

alarm_notify

QuerySmnInfoResp object

Exception notification settings.

is_multi_az

Boolean

Whether the task is a cross-AZ synchronization task.

az_name

String

AZ name of the node.

master_az

String

Primary AZ of the cross-AZ task.

slave_az

String

Standby AZ of the cross-AZ task.

node_role

String

Primary/Standby role of a task.

incre_start_position

String

Start point of an incremental task.

Table 7 Endpoint

Parameter

Type

Description

db_type

String

Database type. Values:

  • mysql

  • mongodb

  • taurus

  • postgresql

az_code

String

Code of the AZ where the database is located.

region

String

Region where the DB instance is located. This parameter is mandatory when the database is a cloud instance, for example, an RDS or GaussDB(for MySQL) instance.

inst_id

String

DB instance ID. This parameter is mandatory when the database is a cloud instance, for example, an RDS or GaussDB(for MySQL) instance.

vpc_id

String

ID of the VPC where the database is located.

subnet_id

String

ID of the subnet where the database is located.

security_group_id

String

ID of the security group to which the database belongs.

project_id

String

Project ID of an RDS DB instance.

db_password

String

Database password.

db_port

Integer

Database port. The value is an integer ranging from 1 to 65535.

db_user

String

Database user.

inst_name

String

The name of an RDS or GaussDB(for MySQL) instance.

ip

String

Database IP address.

mongo_ha_mode

String

MongoDB HA mode.

ssl_cert_password

String

SSL certificate password. The certificate file name extension is .p12.

ssl_cert_check_sum

String

The checksum value of the SSL certificate, which is used for backend verification. This parameter is mandatory for secure connection to the source database.

ssl_cert_key

String

SSL certificate content, which is encrypted using Base64.

ssl_cert_name

String

SSL certificate name.

ssl_link

String

Whether SSL is enabled.

cluster_mode

String

For MongoDB 4.0 or later, if the cluster instance cannot obtain the IP address of the sharded node, set source_endpoint to Sharding4.0+.

Default value: Sharding4.0+

Enumerated value:

  • Sharding4.0+

Table 8 InstInfo

Parameter

Type

Description

engine_type

String

Engine type of a DRS task. Values:

  • mysql: used for migration and synchronization from MySQL to MySQL

  • mongodb: used for migration from MongoDB to DDS

  • cloudDataGuard-mysql: used for DR from MySQL to MySQL

  • mysql-to-taurus: used for synchronization from MySQL to GaussDB(for MySQL) primary/standby

  • postgresql: used for synchronization from PostgreSQL to PostgreSQL

inst_type

String

DB instance type. Values:

  • high

ip

String

Private IP address of the replication instance.

public_ip

String

EIP of the replication instance.

start_time

Integer

Scheduled start time of a replication instance task.

status

String

Replication instance status. Values:

  • active

  • deleted

volume_size

Integer

Storage space of a replication instance.

Table 9 SpeedLimitInfo

Parameter

Type

Description

begin

String

Start time of flow control.

end

String

End time of flow control.

is_utc

Boolean

Whether the UTC time is used.

speed

String

Flow control

Table 10 DefaultRootDb

Parameter

Type

Description

db_name

String

Database name.

db_encoding

String

Encoding format

Table 11 QuerySmnInfoResp

Parameter

Type

Description

subscriptions

Array of SubscriptionInfo objects

SMN information.

topic_name

String

Topic name.

delay_time

Long

Subscription delay.

rto_delay

Long

RTO delay.

rpo_delay

Long

RPO delay.

alarm_to_user

Boolean

Whether to notify users of alarms.

Table 12 SubscriptionInfo

Parameter

Type

Description

endpoints

Array of strings

SMS or email list.

protocol

String

Notification methods. sms: SMS; email: Email.

Enumerated value:

  • sms

  • email

Example Request

Request for querying task details:

https://{EndPoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs/batch-detail
{
  "jobs" : [ "24834eb6-be30-464e-a299-f7aa730jb101", "140b5236-88ad-43c8-811c-1268453jb101" ],
  "page_req" : {
    "cur_page" : 1,
    "per_page" : 10
  }
}

Example Response

Status code: 200

OK

{
  "count" : 2,
  "results" : [ {
    "id" : "24834eb6-be30-464e-a299-f7aa730jb101",
    "name" : "DRS-3999-lws",
    "status" : "STARTJOBING",
    "description" : "",
    "create_time" : "1608519469412",
    "task_type" : "FULL_INCR_TRANS",
    "source_endpoint" : {
      "ip" : "172.22.74.56",
      "region" : "eu-de",
      "db_type" : "mysql",
      "db_port" : 3306,
      "ssl_link" : false,
      "project_id" : "054ba152d480d55b2f5dc0069e7ddef0",
      "db_user" : "root"
    },
    "target_endpoint" : {
      "ip" : "172.21.176.219",
      "region" : "eu-de",
      "db_type" : "mysql",
      "db_port" : 3306,
      "ssl_link" : false,
      "inst_id" : "3ef57dbcc8db478a9e346d26ef2575bfin01",
      "project_id" : "054ba152d480d55b2f5dc0069e7ddef0",
      "inst_name" : "rds-lws-target",
      "db_user" : "root",
      "vpc_id" : "0ff8df7b-f0e9-4b16-ac16-1db3dacb69e4",
      "subnet_id" : "f857d371-2f03-4622-85f6-2b7d42d0d82c"
    },
    "inst_info" : {
      "ip" : "172.16.213.101",
      "inst_type" : "high",
      "engine_type" : "mysql",
      "volume_size" : 100,
      "public_ip" : "10.154.219.202",
      "start_time" : "0"
    },
    "actual_start_time" : "1608520069393",
    "update_time" : "1608520068979",
    "job_direction" : "up",
    "db_use_type" : "migration",
    "need_restart" : false,
    "is_target_readonly" : true,
    "speed_limit" : [ ],
    "schema_type" : "Tungsten",
    "object_switch" : true,
    "replace_definer" : true,
    "migrate_user" : false,
    "az_code" : "az2xahz",
    "vpc_id" : "0ff8df7b-f0e9-4b16-ac16-1db3dacb69e4",
    "subnet_id" : "f857d371-2f03-4622-85f6-2b7d42d0d82c",
    "security_group_id" : "d90c971b-4b9d-402c-9c59-5c239389b8dd",
    "support_ip_v6" : false
  }, {
    "id" : "140b5236-88ad-43c8-811c-1268453jb101",
    "name" : "DRS-0042-linxiaolu",
    "status" : "CONFIGURATION",
    "description" : "",
    "create_time" : "1608366204171",
    "task_type" : "FULL_INCR_TRANS",
    "source_endpoint" : {
      "ip" : "192.168.0.27",
      "region" : "eu-de",
      "db_type" : "mysql",
      "db_port" : 3306,
      "ssl_link" : false,
      "project_id" : "054ba152d480d55b2f5dc0069e7ddef0",
      "db_user" : "root"
    },
    "target_endpoint" : {
      "ip" : "192.168.0.131",
      "region" : "eu-de",
      "db_type" : "mysql",
      "db_port" : 3306,
      "ssl_link" : false,
      "inst_id" : "e05a3679efe241d8b5dee80b17c1a863in01",
      "project_id" : "054ba152d480d55b2f5dc0069e7ddef0",
      "inst_name" : "rds-1417-lxl",
      "db_user" : "root",
      "vpc_id" : "65f0391c-0582-44a6-aa50-248f97ed82e1",
      "subnet_id" : "352ad828-3467-4f03-987a-c55a5a9dd417"
    },
    "inst_info" : {
      "ip" : "192.168.0.229",
      "status" : "ACTIVE",
      "inst_type" : "high",
      "engine_type" : "mysql",
      "volume_size" : 100,
      "public_ip" : "10.154.219.72",
      "start_time" : "0"
    },
    "actual_start_time" : "1608369232412",
    "full_transfer_complete_time" : "1608369510202",
    "update_time" : "1608517066434",
    "job_direction" : "up",
    "db_use_type" : "migration",
    "need_restart" : false,
    "is_target_readonly" : true,
    "speed_limit" : [ ],
    "schema_type" : "Tungsten",
    "object_switch" : false,
    "replace_definer" : true,
    "migrate_user" : false,
    "az_code" : "az2xahz",
    "vpc_id" : "65f0391c-0582-44a6-aa50-248f97ed82e1",
    "subnet_id" : "352ad828-3467-4f03-987a-c55a5a9dd417",
    "security_group_id" : "d90c971b-4b9d-402c-9c59-5c239389b8dd",
    "support_ip_v6" : false
  } ]
}

Status Code

Status Code

Description

200

OK

Error Code

For details, see Error Code.