/// <summary> /// Starts Test Failover Cleanup. /// </summary> /// <param name="fabricName">Fabric Name.</param> /// <param name="protectionContainerName">Protection Conatiner Name.</param> /// <param name="replicationProtectedItemName">Replication Protected Item.</param> /// <param name="input">Input for Test failover cleanup.</param> /// <returns>Job Response.</returns> public PSSiteRecoveryLongRunningOperation StartAzureSiteRecoveryTestFailoverCleanup( string fabricName, string protectionContainerName, string replicationProtectedItemName, TestFailoverCleanupInput input) { var op = this.GetSiteRecoveryClient() .ReplicationProtectedItems.BeginTestFailoverCleanupWithHttpMessagesAsync( fabricName, protectionContainerName, replicationProtectedItemName, input, this.GetRequestHeaders(true)) .GetAwaiter() .GetResult(); var result = SiteRecoveryAutoMapperProfile.Mapper.Map <PSSiteRecoveryLongRunningOperation>(op); return(result); }
/// <summary> /// Starts PE Test failover cleanup. /// </summary> private void StartRPITestFailoverCleanup() { this.protectionContainerName = Utilities.GetValueFromArmId( this.ReplicationProtectedItem.ID, ARMResourceTypeConstants.ReplicationProtectionContainers); this.fabricName = Utilities.GetValueFromArmId( this.ReplicationProtectedItem.ID, ARMResourceTypeConstants.ReplicationFabrics); var rpiName = Utilities.GetValueFromArmId( this.ReplicationProtectedItem.ID, ARMResourceTypeConstants.ReplicationProtectedItems); var testFailoverCleanupInputProperties = new TestFailoverCleanupInputProperties { Comments = this.Comment == null ? "" : this.Comment }; var input = new TestFailoverCleanupInput { Properties = testFailoverCleanupInputProperties }; var response = this.RecoveryServicesClient.StartAzureSiteRecoveryTestFailoverCleanup( this.fabricName, this.protectionContainerName, rpiName, input); var jobResponse = this.RecoveryServicesClient .GetAzureSiteRecoveryJobDetails( PSRecoveryServicesClient .GetJobIdFromReponseLocation(response.Location)); this.WriteObject(new ASRJob(jobResponse)); }