描述
当调用同步对象修改(ModifySynchronizationObject)接口修改同步对象后,可以调用这个接口查看同步对象修改的状态及具体进度。
请求参数
返回参数
PrecheckStatus参数定义
CheckItem的参数定义
StructureInitializationStatus参数定义
DataInitializationStatus参数定义
DataSynchronizationStatus参数定义
示例
下面简单演示通过JAVA SDK 查询同步对象变更任务状态的示例:
public void descObjectModifyStatus(String SyncJobId,String TaskId,DefaultAcsClient client) {
DescribeSynchronizationObjectModifyStatusRequest request = new DescribeSynchronizationObjectModifyStatusRequest();
request.setTaskId(TaskId);
DescribeSynchronizationObjectModifyStatusResponse response = new DescribeSynchronizationObjectModifyStatusResponse();
try {
response = client.getAcsResponse(request);
System.out.println("Describe Sync Object Modify Status Succeed!");
String status=response.getStatus();
PrecheckStatus precheckStatus = response.getPrecheckStatus();
StructureInitializationStatus strucInitStatus=response.getStructureInitializationStatus();
DataInitializationStatus dataInitStatus=response.getDataInitializationStatus();
DataSynchronizationStatus dataSyncStatus = response.getDataSynchronizationStatus();
String errorMSG=response.getErrorMessage();
//Get Precheck Status
System.out.println("The precheck status of SYNC Job "+SyncJobId);
String precheck_status=precheckStatus.getStatus();
String precheck_percent=precheckStatus.getPercent();
System.out.println("Precheck Status:"+precheckStatus.getStatus()
+"; Precheck Percent:"+precheckStatus.getPercent());
System.out.println("Precheck Detail:");
for (int i = 0; i < precheckStatus.getDetail().size(); i++) {
String ItemName=precheckStatus.getDetail().get(i).getItemName();
String CheckStatus=precheckStatus.getDetail().get(i).getCheckStatus();
String CheckErrorMsg=precheckStatus.getDetail().get(i).getErrorMessage();
String RepairMethod = precheckStatus.getDetail().get(i).getRepairMethod();
System.out.println("CheckItme:"+ItemName+"; Status:"+CheckStatus+"; ErrorMSG:"+CheckErrorMsg
+"; RepairMethod:"+RepairMethod);
}
// Get the status of the structure Initialization
String strucInit_Status=strucInitStatus.getStatus();
String strucInit_percent=strucInitStatus.getPercent();
String strucInit_progress=strucInitStatus.getProgress();
String strucInit_ErrMsg=strucInitStatus.getErrorMessage();
System.out.println("The Structure Init Status of SYNC Job "+SyncJobId);
System.out.println("Status:"+strucInit_Status+"; Percent:"+strucInit_percent
+"; Progress:"+strucInit_progress+"; ErrMSG:"+strucInit_ErrMsg);
// Get the status of the data Initialization
String dataInit_Status=dataInitStatus.getStatus();
String dataInit_Percent = dataInitStatus.getPercent();
String dataInit_Progress = dataInitStatus.getProgress();
String dataInit_ErrMSG = dataInitStatus.getErrorMessage();
System.out.println("The data Init Status of SYNC Job "+SyncJobId);
System.out.println("Status:"+dataInit_Status+"; Percent:"+dataInit_Percent
+"; Progress:"+dataInit_Progress+"; ErrMSG:"+dataInit_ErrMSG);
// Get the status of the data synchronization
String dataSync_Status=dataSyncStatus.getStatus();
String dataSync_Percent=dataSyncStatus.getPercent();
String dataSync_Delay=dataSyncStatus.getDelay();
String dataSync_ErrMSG=dataSyncStatus.getErrorMessage();
System.out.println("The data Init Status of SYNC Job "+SyncJobId);
System.out.println("Status:"+dataSync_Status+"; Percent:"+dataSync_Percent
+"; Delay:"+dataSync_Delay+"; ErrMSG:"+dataSync_ErrMSG);
} catch (Exception e) {
// TODO: handle exception
System.out.println("Describe Synchronization Objects Modify Status Failed");
System.out.println(e.toString());
}
}