/// <summary> /// The Failover Virtual network Gateway operation causes a network /// gateway failover for the specified virtual network in Windows /// Azure. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/jj154118.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.VirtualNetworks.IGatewayOperations. /// </param> /// <param name='virtualNetworkName'> /// The name of the virtual network in Azure. /// </param> /// <returns> /// A standard storage response including an HTTP status code and /// request ID. /// </returns> public static GatewayOperationResponse BeginFailover(this IGatewayOperations operations, string virtualNetworkName) { try { return operations.BeginFailoverAsync(virtualNetworkName).Result; } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// The Begin Failover Virtual Network Gateway operation causes a /// network gateway failover for the specified virtual network in /// Azure. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/jj154118.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Network.IGatewayOperations. /// </param> /// <param name='networkName'> /// Required. The name of the virtual network in Azure. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task<GatewayOperationResponse> BeginFailoverAsync(this IGatewayOperations operations, string networkName) { return operations.BeginFailoverAsync(networkName, CancellationToken.None); }
/// <summary> /// Begins failover of the Azure SQL Database Replication Link with the /// given id. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Sql.IReplicationLinkOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the Resource Group to which the Azure SQL /// Server belongs. /// </param> /// <param name='serverName'> /// Required. The name of the Azure SQL Server on which the Azure SQL /// Database is hosted. /// </param> /// <param name='databaseName'> /// Required. The name of the Azure SQL Database that has the /// replication link to be failed over. /// </param> /// <param name='linkId'> /// Required. The id of the replication link to be failed over. /// </param> /// <returns> /// Response for long running Azure Sql Database replication failover /// operations. /// </returns> public static Task<ReplicationLinkFailoverResponse> BeginFailoverAsync(this IReplicationLinkOperations operations, string resourceGroupName, string serverName, string databaseName, string linkId) { return operations.BeginFailoverAsync(resourceGroupName, serverName, databaseName, linkId, CancellationToken.None); }