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

 

Response Headers

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>
        <Table>
            <Name>[dbo].[AspNetUserLogins]</Name>
            <SourceCount>0</SourceCount>
            <DestinationCount>0</DestinationCount>
            <PendingChanges>0</PendingChanges>
            <ChangeTracking>OK for Change Tracking</ChangeTracking>
        </Table>
        <Table>
            <Name>[dbo].[AspNetUserRoles]</Name>
            <SourceCount>2</SourceCount>
            <DestinationCount>2</DestinationCount>
            <PendingChanges>0</PendingChanges>
            <ChangeTracking>OK for Change Tracking</ChangeTracking>
        </Table>
        <Table>
            <Name>[dbo].[AspNetUsers]</Name>
            <SourceCount>2</SourceCount>
            <DestinationCount>2</DestinationCount>
            <PendingChanges>0</PendingChanges>
            <ChangeTracking>OK for Change Tracking</ChangeTracking>
        </Table>
        <Table>
            <Name>[dbo].[JobEntity]</Name>
            <SourceCount>38</SourceCount>
            <DestinationCount>38</DestinationCount>
            <PendingChanges>0</PendingChanges>
            <ChangeTracking>OK for Change Tracking</ChangeTracking>
        </Table>
        <Table>
            <Name>[dbo].[JobResponse]</Name>
            <SourceCount>1068056</SourceCount>
            <DestinationCount>1068056</DestinationCount>
            <PendingChanges>0</PendingChanges>
            <ChangeTracking>OK for Change Tracking</ChangeTracking>
        </Table>
        <Table>
            <Name>[dbo].[JobType]</Name>
            <SourceCount>3</SourceCount>
            <DestinationCount>3</DestinationCount>
            <PendingChanges>0</PendingChanges>
            <ChangeTracking>OK for Change Tracking</ChangeTracking>
        </Table>
        <Table>
            <Name>[HangFire].[AggregatedCounter]</Name>
            <SourceCount>59</SourceCount>
            <DestinationCount>59</DestinationCount>
            <PendingChanges>0</PendingChanges>
            <ChangeTracking>OK for Change Tracking</ChangeTracking>
        </Table>
        <Table>
            <Name>[HangFire].[Counter]</Name>
            <SourceCount>0</SourceCount>
            <DestinationCount>0</DestinationCount>
            <PendingChanges>0</PendingChanges>
            <ChangeTracking>OK for Change Tracking</ChangeTracking>
        </Table>
        <Table>
            <Name>[HangFire].[Hash]</Name>
            <SourceCount>198</SourceCount>
            <DestinationCount>198</DestinationCount>
            <PendingChanges>0</PendingChanges>
            <ChangeTracking>OK for Change Tracking</ChangeTracking>
        </Table>
        <Table>
            <Name>[HangFire].[Job]</Name>
            <SourceCount>3567</SourceCount>
            <DestinationCount>3567</DestinationCount>
            <PendingChanges>0</PendingChanges>
            <ChangeTracking>OK for Change Tracking</ChangeTracking>
        </Table>
        <Table>
            <Name>[HangFire].[JobParameter]</Name>
            <SourceCount>8702</SourceCount>
            <DestinationCount>8702</DestinationCount>
            <PendingChanges>0</PendingChanges>
            <ChangeTracking>OK for Change Tracking</ChangeTracking>
        </Table>
        <Table>
            <Name>[HangFire].[JobQueue]</Name>
            <SourceCount>0</SourceCount>
            <DestinationCount>0</DestinationCount>
            <PendingChanges>0</PendingChanges>
            <ChangeTracking>OK for Change Tracking</ChangeTracking>
        </Table>
        <Table>
            <Name>[HangFire].[List]</Name>
            <SourceCount>0</SourceCount>
            <DestinationCount>0</DestinationCount>
            <PendingChanges>0</PendingChanges>
            <ChangeTracking>OK for Change Tracking</ChangeTracking>
        </Table>
        <Table>
            <Name>[HangFire].[Schema]</Name>
            <SourceCount>1</SourceCount>
            <DestinationCount>1</DestinationCount>
            <PendingChanges>0</PendingChanges>
            <ChangeTracking>OK for Change Tracking</ChangeTracking>
        </Table>
        <Table>
            <Name>[HangFire].[Server]</Name>
            <SourceCount>1</SourceCount>
            <DestinationCount>1</DestinationCount>
            <PendingChanges>0</PendingChanges>
            <ChangeTracking>OK for Change Tracking</ChangeTracking>
        </Table>
        <Table>
            <Name>[HangFire].[Set]</Name>
            <SourceCount>33</SourceCount>
            <DestinationCount>33</DestinationCount>
            <PendingChanges>0</PendingChanges>
            <ChangeTracking>OK for Change Tracking</ChangeTracking>
        </Table>
        <Table>
            <Name>[HangFire].[State]</Name>
            <SourceCount>73460</SourceCount>
            <DestinationCount>73460</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

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
ReplicationTables When SeedingStatus is Running the list of the tables is not available
No report is generated if either the Seeding failed or it was canceled in UI
Yes
Name Name of the table
SourceCount Number of records in the source table
DestinationCount Number of records in the destination table
PendingChanges This value represents the counts at the time of the request submission (see RequestTimestamp)
ChangeTracking It indicates whether tha ChangeTracking is activated for the table
LastSuccessfulCtEndTime Time since pending changes (see PendingChanges) have been accumulating Yes

*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
}