API Actions: RebuildDbReplicaIndexes

API Actions: RebuildDbReplicaIndexes

 

Request Syntax:

XML

POST /api/RebuildDbReplicaIndexes 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
 
<RebuildDbReplicaIndexesRequest>
	<ReplicationId>998acaec-9211-4dac-b90b-196fd1d17993</ReplicationId>
	<CancelRunningCtProcess>false</CancelRunningCtProcess>
</RebuildDbReplicaIndexesRequest>

JSON

POST /api/RebuildDbReplicaIndexes 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": "998acaec-9211-4dac-b90b-196fd1d17993",
	"cancelRunningCtProcess": false
}

 

Request Parameters

Parameter Description Required
ReplicationId The GUID value that uniquely identifies a Replication.

Important: This method initiates a rebuild process on the replica DB for all indexes in order to optimize DB performance and execution plans. Rebuild indexes process will be initiated even if there is a currently running process. If the workload on the server is unacceptable or fails due to this reason, the replication process can be temporarily stopped by calling the api/AlterReplication and then requesting the currently running Change Tracking process to be canceled via the <CancelRunningCtProcess> tag in this method.

Yes
Type: String
Default: None
CancelRunningCtProcess See above for details. Yes
Type: String
Default: false
Valid value: true/ false

 

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:

XML

HTTP/1.1 200
status: 200

<?xml version="1.0" encoding="utf-8"?>
<RebuildDbReplicaIndexesResponse>
    <RunningCtProcessCancelled>true</RunningCtProcessCancelled>
    <Status>Running</Status>
</RebuildDbReplicaIndexesResponse>

JSON

HTTP/1.1 200
status: 200

{
	"runningCtProcessCancelled": true,
	"status": "Running"
}


 

Response Parameters

Parameter Description Optional
RunningCtProcessCancelled It returns True when a running Change Tracking process had to be forcefully canceled either on this server or on a remote cluster server. See tag <CancelRunningCtProcess>> in api/RebuildDbReplicaIndexes method. No
Status Possible values include:

  • Running
  • Failed
  • Success

Note:
Even if the asynchronous process completes instantly with status Failed or Success, logs will not be returned. Logs can be requested via API/RebuildDbReplicaIndexesStatus method.

No

 

Error Response Syntax:

XML

HTTP/1.1 400
status: 400

<?xml version="1.0" encoding="utf-8"?>
<ErrorResponse> 
	<RequestId>26</RequestId> 
	<Errors> 
		<Error> Inaccessible destination DB connection. </Error> 
	</Errors> 
</ErrorResponse>

JSON

HTTP/1.1 400
status: 400

{
    "errors": [
        "Inaccessible destination DB connection."
    ],
    "requestId": "26"
}

XML

HTTP/1.1 400
status: 400

<?xml version="1.0" encoding="utf-8"?>
<ErrorResponse> 
	<RequestId>27</RequestId> 
	<Errors> 
		<Error> Rebuild process in progress. </Error> 
	</Errors> 
</ErrorResponse>

JSON

HTTP/1.1 400
status: 400

{
    "errors": [
        "Rebuild process in progress."
    ],
    "requestId": "27"
}