/// <summary> /// The Check Static IP operation retrieves the details for the /// availability of static IP addresses for the given virtual network. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.VirtualNetworks.IStaticIPOperations. /// </param> /// <param name='virtualNetworkName'> /// The name of the virtual network. /// </param> /// <param name='ipAddress'> /// The address of the static IP. /// </param> /// <returns> /// A response that indicates the availability of a static IP address, /// and if not, provide a list of suggestions. /// </returns> public static NetworkStaticIPAvailabilityResponse Check(this IStaticIPOperations operations, string virtualNetworkName, string ipAddress) { try { return(operations.CheckAsync(virtualNetworkName, ipAddress).Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// The Check Static IP operation retrieves the details for the /// availability of static IP addresses for the given virtual network. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.VirtualNetworks.IStaticIPOperations. /// </param> /// <param name='virtualNetworkName'> /// The name of the virtual network. /// </param> /// <param name='ipAddress'> /// The address of the static IP. /// </param> /// <returns> /// A response that indicates the availability of a static IP address, /// and if not, provide a list of suggestions. /// </returns> public static Task <NetworkStaticIPAvailabilityResponse> CheckAsync(this IStaticIPOperations operations, string virtualNetworkName, string ipAddress) { return(operations.CheckAsync(virtualNetworkName, ipAddress, CancellationToken.None)); }