/// <summary> /// This method triggers the Data Move operation on Target vault. /// </summary> /// <param name="vaultName"></param> /// <param name="resourceGroupName"></param> /// <param name="triggerMoveRequest"></param> public void TriggerDataMove(string vaultName, string resourceGroupName, TriggerDataMoveRequest triggerMoveRequest) { //trigger move var triggerMoveOperationResponse = ServiceClientAdapter.BmsAdapter.Client.BeginBMSTriggerDataMoveWithHttpMessagesAsync( vaultName, resourceGroupName, triggerMoveRequest).Result; // track trigger-move operation to success var operationStatus = TrackingHelpers.GetOperationStatusDataMove( triggerMoveOperationResponse, operationId => ServiceClientAdapter.GetDataMoveOperationStatus(operationId, vaultName, resourceGroupName)); Logger.Instance.WriteDebug("Trigger move operation: " + operationStatus.Body.Status); }
/// <summary> /// This method prepares the source vault for Data Move operation. /// </summary> /// <param name="vaultName"></param> /// <param name="resourceGroupName"></param> /// <param name="prepareMoveRequest"></param> public string PrepareDataMove(string vaultName, string resourceGroupName, PrepareDataMoveRequest prepareMoveRequest) { // prepare move var prepareMoveOperationResponse = ServiceClientAdapter.BmsAdapter.Client.BeginBMSPrepareDataMoveWithHttpMessagesAsync( vaultName, resourceGroupName, prepareMoveRequest).Result; // track prepare-move operation to success var operationStatus = TrackingHelpers.GetOperationStatusDataMove( prepareMoveOperationResponse, operationId => ServiceClientAdapter.GetDataMoveOperationStatus(operationId, vaultName, resourceGroupName)); Logger.Instance.WriteDebug("Prepare move operation: " + operationStatus.Body.Status); // get the correlation Id and return it for trigger data move var operationResult = TrackingHelpers.GetCorrelationId( prepareMoveOperationResponse, operationId => ServiceClientAdapter.GetPrepareDataMoveOperationResult(operationId, vaultName, resourceGroupName)); Logger.Instance.WriteDebug("Prepare move - correlationId:" + operationResult.CorrelationId); return(operationResult.CorrelationId); }