/// <summary> /// Update the vCenter server. /// </summary> /// <param name="fabricName">Fabric ID.</param> /// <param name="vCenterName">vCenter Name.</param> /// <param name="input">Update vCenter input.</param> /// <returns>Job operation response</returns> public PSSiteRecoveryLongRunningOperation UpdateAzureRmSiteRecoveryvCenter( string fabricName, string vCenterName, UpdateVCenterRequest input) { var op = this.GetSiteRecoveryClient() .ReplicationvCenters.BeginUpdateWithHttpMessagesAsync( fabricName, vCenterName, input, this.GetRequestHeaders(true)) .GetAwaiter() .GetResult(); var result = SiteRecoveryAutoMapperProfile.Mapper.Map <PSSiteRecoveryLongRunningOperation>(op); return(result); }
/// <summary> /// Update the vCenter. /// </summary> private void UpdatevCenter() { var updatevCenterInput = new UpdateVCenterRequest(); var vcenterResponse = this.RecoveryServicesClient.GetAzureRmSiteRecoveryvCenter( fabricName, vCenterName); var updatevCenterProperties = new UpdateVCenterRequestProperties() { FriendlyName = vcenterResponse.Properties.FriendlyName, IpAddress = vcenterResponse.Properties.IpAddress, ProcessServerId = vcenterResponse.Properties.ProcessServerId, Port = vcenterResponse.Properties.Port, RunAsAccountId = vcenterResponse.Properties.RunAsAccountId }; if (this.Account != null && !string.IsNullOrEmpty(this.Account.AccountId)) { updatevCenterProperties.RunAsAccountId = this.Account.AccountId; } if (this.Port.HasValue) { updatevCenterProperties.Port = this.Port.ToString(); } updatevCenterInput.Properties = updatevCenterProperties; var response = this.RecoveryServicesClient.UpdateAzureRmSiteRecoveryvCenter( fabricName, vCenterName, updatevCenterInput); var jobResponse = this.RecoveryServicesClient.GetAzureSiteRecoveryJobDetails( PSRecoveryServicesClient.GetJobIdFromReponseLocation(response.Location)); this.WriteObject(new ASRJob(jobResponse)); }
/// <summary> /// Update vCenter operation. /// </summary> /// <remarks> /// The operation to update a registered vCenter. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='fabricName'> /// Fabric name. /// </param> /// <param name='vCenterName'> /// vCeneter name /// </param> /// <param name='updateVCenterRequest'> /// The input to the update vCenter operation. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <VCenter> BeginUpdateAsync(this IReplicationvCentersOperations operations, string fabricName, string vCenterName, UpdateVCenterRequest updateVCenterRequest, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(fabricName, vCenterName, updateVCenterRequest, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Update vCenter operation. /// </summary> /// <remarks> /// The operation to update a registered vCenter. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='fabricName'> /// Fabric name. /// </param> /// <param name='vCenterName'> /// vCeneter name /// </param> /// <param name='updateVCenterRequest'> /// The input to the update vCenter operation. /// </param> public static VCenter BeginUpdate(this IReplicationvCentersOperations operations, string fabricName, string vCenterName, UpdateVCenterRequest updateVCenterRequest) { return(operations.BeginUpdateAsync(fabricName, vCenterName, updateVCenterRequest).GetAwaiter().GetResult()); }