API Actions: AnalyzeReplication

API Actions: AnalyzeReplication

This action generates a report containing information about pending changes and discrepancies (SQL to SQL replications only).

Request Syntax:

XML

POST /api/AnalyzeReplication HTTP/1.1
Host: use.your.host.name:82
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Content-Type: application/xml
X-Amz-Date: 20171115T202130Z
Authorization: AWS4-HMAC-SHA256 Credential=UQOPWUVNBALABCABCABC/20171115/us-east-1/cloudbasic/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-content-sha256;x-amz-date, Signature=995374189c189e8e68ed3de82c1764ca11971711fb5179eeab2b19edd883dd74

<?xml version="1.0" encoding="utf-8"?>
<AnalyzeReplicationRequest>
	<ReplicationId>594ed5c8-e0aa-4fd0-987f-fcfd2aaf1763</ReplicationId>
</AnalyzeReplicationRequest>

JSON

POST /api/AnalyzeReplication HTTP/1.1
Host: use.your.host.name:82
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Content-Type: application/json
X-Amz-Date: 20171115T202130Z
Authorization: AWS4-HMAC-SHA256 Credential=UQOPWUVNBALABCABCABC/20171115/us-east-1/cloudbasic/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-content-sha256;x-amz-date, Signature=995374189c189e8e68ed3de82c1764ca11971711fb5179eeab2b19edd883dd74

{
	"replicationId": "594ed5c8-e0aa-4fd0-987f-fcfd2aaf1763"
}

Request Parameters

Parameter Description Required
ReplicationId The GUID that identifies the Replication to be analyzed as returned by CreateReplication API method. Yes
Type: String
Default: None

Request Headers

This implementation uses only request headers that are common to all operations. For more information please see the section Common Request Headers

Response Syntax:

Response Syntax with status Success for a Redshift Replication – using XML parameter encoding:

<?xml version="1.0" encoding="utf-8"?>
<AnalyzeReplicationResponse>
	<RequestTimestamp>Friday, February 2, 2018 1:38:24 AM</RequestTimestamp>
	<LastSuccessfulCtEndTime>Friday, February 2, 2018 1:37:31 AM</LastSuccessfulCtEndTime>
	<LastSuccessfulRedshiftEndTime>Friday, February 2, 2018 1:37:31 AM</LastSuccessfulRedshiftEndTime>
	<Tables>
		<Table>
			<Name>[dbo].[Departments]</Name>
			<SourceCount>113</SourceCount>
			<PendingChanges>0</PendingChanges>
			<ChangeTracking>OK for Change Tracking</ChangeTracking>
			<StagingCount>113</StagingCount>
			<RedshiftCount>13</RedshiftCount>
			<RedshiftPendingChanges>100</RedshiftPendingChanges>
		</Table>
		<Table>
			<Name>[dbo].[Managers]</Name>
			<SourceCount>1100</SourceCount>
			<PendingChanges>0</PendingChanges>
			<ChangeTracking>OK for Change Tracking</ChangeTracking>
			<StagingCount>1100</StagingCount>
			<RedshiftCount>1050</RedshiftCount>
			<RedshiftPendingChanges>50</RedshiftPendingChanges>
		</Table>
		<Table>
			<Name>[dbo].[NoPkTable]</Name>
			<SourceCount>0</SourceCount>
			<PendingChanges>0</PendingChanges>
			<ChangeTracking>Excluded from Change Tracking</ChangeTracking>
			<StagingCount>0</StagingCount>
			<RedshiftCount>0</RedshiftCount>
			<RedshiftPendingChanges>0</RedshiftPendingChanges>
		</Table>
		<Table>
			<Name>[dbo].[TempDepartments]</Name>
			<SourceCount>10</SourceCount>
			<PendingChanges>0</PendingChanges>
			<ChangeTracking>Excluded from Change Tracking</ChangeTracking>
			<StagingCount>0</StagingCount>
			<RedshiftCount>0</RedshiftCount>
			<TempTablePendingChanges>0</TempTablePendingChanges>
		</Table>
	</Tables>
</AnalyzeReplicationResponse>

Response Syntax with status Running – using XML parameter encoding:

<?xml version="1.0" encoding="utf-8"?>
<AnalyzeReplicationResponse>
   <RequestTimestamp>Wednesday, November 8, 2017 12:00:17 AM</RequestTimestamp>
   <SeedingStatus>Running</SeedingStatus>
   <ReplicationTables></ReplicationTables>
</AnalyzeReplicationResponse>

Response Syntax with status Success:

XML

HTTP/1.1 200
status: 200
<?xml version="1.0" encoding="utf-8"?>
<AnalyzeReplicationResponse>
	<RequestTimestamp>Wednesday, November 8, 2017 12:00:17 AM</RequestTimestamp>
	<SeedingStatus>Success</SeedingStatus>
	<LastSuccessfulCtEndTime>Wednesday, November 8, 2017 12:00:17 AM</LastSuccessfulCtEndTime>
	<ReplicationTables>
		<Table>
			<Name>[dbo].[__MigrationHistory]</Name>
			<SourceCount>1</SourceCount>
			<DestinationCount>1</DestinationCount>
			<PendingChanges>0</PendingChanges>
			<ChangeTracking>OK for Change Tracking</ChangeTracking>
		</Table>
		<Table>
			<Name>[dbo].[AspNetRoles]</Name>
			<SourceCount>1</SourceCount>
			<DestinationCount>1</DestinationCount>
			<PendingChanges>0</PendingChanges>
			<ChangeTracking>OK for Change Tracking</ChangeTracking>
		</Table>
		<Table>
			<Name>[dbo].[AspNetUserClaims]</Name>
			<SourceCount>0</SourceCount>
			<DestinationCount>0</DestinationCount>
			<PendingChanges>0</PendingChanges>
			<ChangeTracking>OK for Change Tracking</ChangeTracking>
		</Table>
	</ReplicationTables>
</AnaylzeReplicationResponse>

JSON

HTTP/1.1 200
status: 200
{
	"requestTimestamp":"Wednesday, November 8, 2017 12:00:17 AM",
	"seedingStatus":"Success",
	"lastSuccessfulCtEndTime": "Wednesday, November 8, 2017 9:00:17 AM",
	"replicationTables": [
        {
            "name": "[dbo].[__MigrationHistory]",
            "sourceCount": 1,
            "destinationCount": 1,
            "pendingChanges": 0,
            "changeTracking": "OK for Change Tracking"
        },
        {
            "name": "[dbo].[AspNetRoles]",
            "sourceCount": 1,
            "destinationCount": 1,
            "pendingChanges": 0,
            "changeTracking": "OK for Change Tracking"
        },
        {
            "name": "[dbo].[AspNetUserClaims]",
            "sourceCount": 0,
            "destinationCount": 0,
            "pendingChanges": 0,
            "changeTracking": "OK for Change Tracking"
        }
    ]
}

Response Parameters

Response Parameters for a Redshift Replication:

Parameter Description Optional
RequestTimestamp The time of the request submission. No
LastSuccessfulCtEndTime Time since pending changes (see PendingChanges) have been accumulating. Yes
LastSuccessfulRedshiftEndTime Last Successful Redshift export process end time. Yes
Tables The list of tables that are subject to replication along with status information.
When SeedingStatus is Running, the list of tables is not available.
No report is generated if either the Seeding failed or it was canceled in the UI.
Yes
Name The name of the table.
SourceCount Number of records in the source table.
PendingChanges Number of changes that still need to be replicated from the source to the staging SQL Server table. This value represents the counts at the time of the request submission (see RequestTimestamp).
ChangeTracking Indicates whether the ChangeTracking is activated for the table.
StagingCount Number of records in the staging SQL Server table.
RedshiftCount Number of records in the destination Redshift table.
RedshiftPendingChanges Number of changes that still need to be replicated from the staging SQL Server table to the Redshift table. This value represents the counts at the time of the request submission (see RequestTimestamp).

Response Parameters for a SQL-to-SQL Replication:

Parameter Description Optional
RequestTimestamp The time of the request submission. No
SeedingStatus The current status of the AnalyzeReplication process. Possible values include:

  • Running
  • RunningWithErrors
  • RunningWithWarnings
  • Failed
  • Canceled *
  • Success
  • CompletedWithError
  • CompletedWithWarning
No
LastSuccessfulCtEndTime Time since pending changes (see PendingChanges) have been accumulating. Yes
ReplicationTables The list of tables that are subject to replication along with status information.
When SeedingStatus is Running, the list of tables is not available.
No report is generated if either the Seeding failed or it was canceled in the UI.
Yes
Name The name of the table.
SourceCount Number of records in the source table.
DestinationCount Number of records in the destination table.
PendingChanges Number of changes that still need to be replicated from the staging to the destination table. This value represents the counts at the time of the request submission (see RequestTimestamp).
ChangeTracking Indicates whether the ChangeTracking is activated for the table.

*This status indicates that Seeding was canceled in the UI.

Error Response Syntax:

XML

HTTP/1.1 400
status: 400

<?xml version="1.0" encoding="utf-8"?>
<ErrorResponse> 
	<RequestId>request-id</RequestId> 
	<Errors> 
		<Error> {ReplicationId}:Replication not found </Error> 
	</Errors> 
</ErrorResponse>

JSON

HTTP/1.1 400
status: 400

{
   "errors": [
       "error 1"
	],
	"requestId": 20
}