You can call the DescribeCloudMigrationResult operation to query the details about the cloud migration tasks of an ApsaraDB RDS for PostgreSQL instance.

Prerequisites

Before you call the DescribeCloudMigrationResult operation, make sure that cloud migration tasks are created by calling the CreateCloudMigrationTask operation.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeCloudMigrationResult

The operation that you want to perform. Set the value to DescribeCloudMigrationResult.

DBInstanceName String Yes pgm-bp102g323jd4****

The ID of the instance. You can call the DescribeDBInstances operation to query the ID of the instance.

TaskId Long No 440437220

The ID of the task. You can obtain the ID of a task from the response that is returned when you call the CreateCloudMigrationTask operation to create the task.

TaskName String No 362c6c7a-4d20-4eac-898c-1495ceab374c

The name of the task. You can obtain the name of a task from the response that is returned when you call the CreateCloudMigrationTask operation to create the task.

SourceIpAddress String No 172.16.XX.XX

The private IP address that is used to connect to the self-managed PostgreSQL instance.

  • If the self-managed PostgreSQL instance resides on an Elastic Compute Service (ECS) instance, enter the private IP address of the ECS instance. For more information, see View IP addresses.
  • If the self-managed PostgreSQL instance resides in an on-premises data center, enter the private IP address of the on-premises data center.
  • If the self-managed PostgreSQL instance resides on a device that is connected over the Internet, enter the public IP address of the device.
SourcePort Long No 5432

The port number that is used to connect to the self-managed PostgreSQL instance. You can run the netstat -a grep PGSQL command to obtain the port number.

PageNumber Long Yes 10

The number of entries to return on each page.

PageSize Long Yes 1

The number of the page to return.

Response parameters

Parameter Type Example Description
TotalSize Integer 1

The total number of tasks that are returned.

RequestId String 1B983C48-9793-5EAA-8F7F-00EAEC517675

The ID of the request.

Items Array of Tasks

An array that consists of the details about the cloud migration tasks.

GmtCreated String 2022-02-25T08:53:13Z

The time when the task was created.

GmtModified String 2022-03-01T06:39:51Z

The time when the task was modified.

TaskId Long 440437220

The ID of the task.

TaskName String 362c6c7a-4d20-4eac-898c-1495ceab374c

The name of the task.

MigrateStage String switch

The migration phase in which the task stays.

  • precheck: precheck
  • basebackup: full data backup
  • startup: link establishment
  • increment: incremental data synchronization
  • switch: cloud migration-triggered switchover
  • success: cloud migration completed
SourceCategory String ecsonvpc

The environment in which the self-managed PostgreSQL instance runs.

  • idcOnVpc: The self-managed PostgreSQL instance resides in an on-premises data center, which can communicate with the virtual private cloud (VPC) to which the ApsaraDB RDS for PostgreSQL instance resides.
  • ecsOnVpc: The self-managed PostgreSQL instance resides on an ECS instance.
  • internet: The self-managed PostgreSQL instance resides on a device that is connected over the Internet.
SourceIpAddress String 172.16.XX.XX

The private IP address that is used to connect to the self-managed PostgreSQL instance.

SourcePort Long 5432

The port number that is used to connect to the self-managed PostgreSQL instance.

SourceAccount String migratetest

The username of the account that is used for cloud migration.

SourcePassword String 123456

The password of the preceding account.

TargetEip String null

A reserved parameter. The return value is null.

TargetInstanceName String pgm-bp102g323jd4****

The ID of the instance.

ReplicationState String streaming

The status of data replication.

  • unstarted
  • catchup
  • streaming
  • disconnect
  • finish
ReplicationInfo String {\"Status\":\"streaming\",\"ReceiveStartLsn\":\"0/3000000\",\"ReceivedTli\":\"1\",\"LatestEndTime\":\"2022-02-25 17:03:59.3344+08\",\"Synced\":\"true\",\"IsSlave\":\"true\",\"ReplayTimestamp\":\"null\",\"LastMsgSendTime\":\"2022-03-01 14:42:57.967537+08\",\"Conninfo\":\"user=migratetest password=******** channel_binding=prefer dbname=replication host=172.16.254.203 port=5432 application_name=rds_db_instance fallback_application_name=walreceiver sslmode=prefer sslcompression=1 sslsni=1 ssl_min_protocol_version=TLSv1.2 gssencmode=prefer krbsrvname=postgres target_session_attrs=any\",\"LastMsgReceiptTime\":\"2022-03-01 14:42:57.96727+08\",\"LatestEndLsn\":\"0/3000148\",\"ReceivedLsn\":\"0/3000148\",\"ReplayLsn\":\"0/3000148\",\"ReceiveStartTli\":\"1\",\"ReplayLag\":\"0\"}

The information about the replication link.

Detail String [Check rds empty]\nCheck rds databases: success\n[Check source connectivity]\nCheck ip connectable: success\nCheck port connectable: success\nCheck database connectable: success\nCheck account replication privilege: success\nCheck account createrole privilege: success\nCheck account monitor privilege: success\n[Check source version]\nCheck major version consistent: success\n[Check source glibc version]\nCheck source glibc version compatible: warning(warning:source glibc version is not compatible with rds pg)\n[Check disk size]\nCheck disk size enough: success\n[Check wal keep size]\nCheck wal keep size large enough: success\n[Check spec params]\nCheck if spec params too large: success\n[Start RDS instance]\n2022-02-25 17:00:29 --- Start RDS instance as slave for data replication\n[Synchronize data]\n2022-02-25 17:01:05 --- Synchronize data from source to RDS by streaming replication \n

The details about the task.

SwitchTime String 2022-03-01T06:40:51Z

The time of a switchover.

PageNumber Long 1

The page number of the returned page.

PageSize Long 10

The number of entries returned per page.

Examples

Sample requests

http(s)://rds.aliyuncs.com/?Action=DescribeCloudMigrationResult
&DBInstanceName=pgm-bp102g323jd4****
&TaskId=440437220
&TaskName=362c6c7a-4d20-4eac-898c-1495ceab374c
&SourceIpAddress=172.16.XX.XX
&SourcePort=5432
&PageNumber=10
&PageSize=1
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribeCloudMigrationResultResponse>
    <TotalSize>1</TotalSize>
    <RequestId>1B983C48-9793-5EAA-8F7F-00EAEC517675</RequestId>
    <Items>
        <GmtCreated>2022-02-25T08:53:13Z</GmtCreated>
        <GmtModified>2022-03-01T06:39:51Z</GmtModified>
        <TaskId>440437220</TaskId>
        <TaskName>362c6c7a-4d20-4eac-898c-1495ceab374c</TaskName>
        <MigrateStage>increment</MigrateStage>
        <SourceCategory>ecsonvpc</SourceCategory>
        <SourceIpAddress>172.16.XX.XX</SourceIpAddress>
        <SourcePort>5432</SourcePort>
        <SourceAccount>migratetest</SourceAccount>
        <SourcePassword>123456</SourcePassword>
        <TargetEip>null</TargetEip>
        <TargetInstanceName>pgm-bp102g323jd4****</TargetInstanceName>
        <ReplicationState>streaming</ReplicationState>
        <ReplicationInfo>{\"Status\":\"streaming\",\"ReceiveStartLsn\":\"0/3000000\",\"ReceivedTli\":\"1\",\"LatestEndTime\":\"2022-02-25 17:03:59.3344+08\",\"Synced\":\"true\",\"IsSlave\":\"true\",\"ReplayTimestamp\":\"null\",\"LastMsgSendTime\":\"2022-03-01 14:42:57.967537+08\",\"Conninfo\":\"user=migratetest password=******** channel_binding=prefer dbname=replication host=172.16.254.203 port=5432 application_name=rds_db_instance fallback_application_name=walreceiver sslmode=prefer sslcompression=1 sslsni=1 ssl_min_protocol_version=TLSv1.2 gssencmode=prefer krbsrvname=postgres target_session_attrs=any\",\"LastMsgReceiptTime\":\"2022-03-01 14:42:57.96727+08\",\"LatestEndLsn\":\"0/3000148\",\"ReceivedLsn\":\"0/3000148\",\"ReplayLsn\":\"0/3000148\",\"ReceiveStartTli\":\"1\",\"ReplayLag\":\"0\"}</ReplicationInfo>
        <Detail>[Check rds empty]\nCheck rds databases: success\n[Check source connectivity]\nCheck ip connectable: success\nCheck port connectable: success\nCheck database connectable: success\nCheck account replication privilege: success\nCheck account createrole privilege: success\nCheck account monitor privilege: success\n[Check source version]\nCheck major version consistent: success\n[Check source glibc version]\nCheck source glibc version compatible: warning(warning:source glibc version is not compatible with rds pg)\n[Check disk size]\nCheck disk size enough: success\n[Check wal keep size]\nCheck wal keep size large enough: success\n[Check spec params]\nCheck if spec params too large: success\n[Start RDS instance]\n2022-02-25 17:00:29 --- Start RDS instance as slave for data replication\n[Synchronize data]\n2022-02-25 17:01:05 --- Synchronize data from source to RDS by streaming replication \n</Detail>
        <SwitchTime>2022-03-01T06:40:51Z</SwitchTime>
    </Items>
    <PageNumber>1</PageNumber>
    <PageSize>10</PageSize>
</DescribeCloudMigrationResultResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "TotalSize" : 1,
  "RequestId" : "1B983C48-9793-5EAA-8F7F-00EAEC517675",
  "Items" : {
    "GmtCreated" : "2022-02-25T08:53:13Z",
    "GmtModified" : "2022-03-01T06:39:51Z",
    "TaskId" : 440437220,
    "TaskName" : "362c6c7a-4d20-4eac-898c-1495ceab374c",
    "MigrateStage" : "increment",
    "SourceCategory" : "ecsonvpc",
    "SourceIpAddress" : "172.16.XX.XX",
    "SourcePort" : 5432,
    "SourceAccount" : "migratetest",
    "SourcePassword" : 123456,
    "TargetEip" : "null",
    "TargetInstanceName" : "pgm-bp102g323jd4****",
    "ReplicationState" : "streaming",
    "ReplicationInfo" : "{\\\"Status\\\":\\\"streaming\\\",\\\"ReceiveStartLsn\\\":\\\"0/3000000\\\",\\\"ReceivedTli\\\":\\\"1\\\",\\\"LatestEndTime\\\":\\\"2022-02-25 17:03:59.3344+08\\\",\\\"Synced\\\":\\\"true\\\",\\\"IsSlave\\\":\\\"true\\\",\\\"ReplayTimestamp\\\":\\\"null\\\",\\\"LastMsgSendTime\\\":\\\"2022-03-01 14:42:57.967537+08\\\",\\\"Conninfo\\\":\\\"user=migratetest password=******** channel_binding=prefer dbname=replication host=172.16.254.203 port=5432 application_name=rds_db_instance fallback_application_name=walreceiver sslmode=prefer sslcompression=1 sslsni=1 ssl_min_protocol_version=TLSv1.2 gssencmode=prefer krbsrvname=postgres target_session_attrs=any\\\",\\\"LastMsgReceiptTime\\\":\\\"2022-03-01 14:42:57.96727+08\\\",\\\"LatestEndLsn\\\":\\\"0/3000148\\\",\\\"ReceivedLsn\\\":\\\"0/3000148\\\",\\\"ReplayLsn\\\":\\\"0/3000148\\\",\\\"ReceiveStartTli\\\":\\\"1\\\",\\\"ReplayLag\\\":\\\"0\\\"}",
    "Detail" : "[Check rds empty]\\nCheck rds databases: success\\n[Check source connectivity]\\nCheck ip connectable: success\\nCheck port connectable: success\\nCheck database connectable: success\\nCheck account replication privilege: success\\nCheck account createrole privilege: success\\nCheck account monitor privilege: success\\n[Check source version]\\nCheck major version consistent: success\\n[Check source glibc version]\\nCheck source glibc version compatible: warning(warning:source glibc version is not compatible with rds pg)\\n[Check disk size]\\nCheck disk size enough: success\\n[Check wal keep size]\\nCheck wal keep size large enough: success\\n[Check spec params]\\nCheck if spec params too large: success\\n[Start RDS instance]\\n2022-02-25 17:00:29 --- Start RDS instance as slave for data replication\\n[Synchronize data]\\n2022-02-25 17:01:05 --- Synchronize data from source to RDS by streaming replication \\n",
    "SwitchTime" : "2022-03-01T06:40:51Z"
  },
  "PageNumber" : 1,
  "PageSize" : 10
}

Error codes

HTTP status code Error code Error message Description
404 InvalidDBInstanceName.NotFound The database instance does not exist. The error message returned because the instance name that you specified cannot be found. Verify the instance name and try again.

For a list of error codes, visit the API Error Center.