Esempio n. 1
0
 /// <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.Network.IStaticIPOperations.
 /// </param>
 /// <param name='networkName'>
 /// Required. The name of the virtual network.
 /// </param>
 /// <param name='ipAddress'>
 /// Required. The address of the static IP.
 /// </param>
 /// <returns>
 /// A response that indicates the availability of a static IP address,
 /// and if not, provides a list of suggestions.
 /// </returns>
 public static NetworkStaticIPAvailabilityResponse Check(this IStaticIPOperations operations, string networkName, string ipAddress)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IStaticIPOperations)s).CheckAsync(networkName, ipAddress);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the VirtualNetworkManagementClient
 /// class.
 /// </summary>
 private VirtualNetworkManagementClient()
     : base()
 {
     this._clientRootCertificates = new ClientRootCertificateOperations(this);
     this._gateways          = new GatewayOperations(this);
     this._networks          = new NetworkOperations(this);
     this._reservedIPs       = new ReservedIPOperations(this);
     this._staticIPs         = new StaticIPOperations(this);
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the NetworkManagementClient class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 private NetworkManagementClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._clientRootCertificates = new ClientRootCertificateOperations(this);
     this._gateways    = new GatewayOperations(this);
     this._networks    = new NetworkOperations(this);
     this._reservedIPs = new ReservedIPOperations(this);
     this._staticIPs   = new StaticIPOperations(this);
     this._apiVersion  = "2014-05-01";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
Esempio n. 4
0
 /// <summary>
 /// Initializes a new instance of the NetworkManagementClient class.
 /// </summary>
 public NetworkManagementClient()
     : base()
 {
     this._applicationGateways    = new ApplicationGatewayOperations(this);
     this._clientRootCertificates = new ClientRootCertificateOperations(this);
     this._gateways = new GatewayOperations(this);
     this._networks = new NetworkOperations(this);
     this._networkSecurityGroups = new NetworkSecurityGroupOperations(this);
     this._reservedIPs           = new ReservedIPOperations(this);
     this._routes     = new RouteOperations(this);
     this._staticIPs  = new StaticIPOperations(this);
     this._apiVersion = "2014-10-01";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
Esempio n. 5
0
 /// <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;
         }
     }
 }
Esempio n. 6
0
 /// <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));
 }