/// <summary> /// Creates an Azure Sql Server Disaster Recovery Configuration. /// </summary> /// <param name="resourceGroup">The name of the resource group</param> /// <param name="serverName">The name of the Azure Sql Server</param> /// <param name="partnerServerId">The id (path) of the partner Azure Sql Server</param> /// <param name="model">A model containing parameters for the Server Disaster Recovery Configuration</param> /// <returns>The created Azure Sql Server Disaster Recovery Configuration</returns> internal AzureSqlServerDisasterRecoveryConfigurationModel CreateServerDisasterRecoveryConfiguration(string resourceGroup, string serverName, string partnerServerId, AzureSqlServerDisasterRecoveryConfigurationModel model) { var resp = Communicator.Create(resourceGroup, serverName, model.ServerDisasterRecoveryConfigurationName, Util.GenerateTracingId(), new ServerDisasterRecoveryConfigurationCreateOrUpdateParameters() { Location = model.Location, Properties = new ServerDisasterRecoveryConfigurationCreateOrUpdateProperties() { PartnerServerId = partnerServerId } }); return CreateServerDisasterRecoveryConfigurationModelFromResponse(resourceGroup, serverName, resp); }
/// <summary> /// Starts failover for an Azure Sql Server Disaster Recovery Configuration. /// </summary> /// <param name="resourceGroup">The name of the resource group</param> /// <param name="serverName">The name of the Azure Sql Server</param> /// <param name="model">The input parameters for the create/update operation</param> /// <param name="allowDataLoss">Whether or not potential data loss is allowed during the failover</param> internal void FailoverServerDisasterRecoveryConfiguration(string resourceGroup, string serverName, AzureSqlServerDisasterRecoveryConfigurationModel model, bool allowDataLoss) { Communicator.Failover(resourceGroup, serverName, model.ServerDisasterRecoveryConfigurationName, allowDataLoss, Util.GenerateTracingId()); }