/// <summary>
 /// List virtual networks in a given lab.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <VirtualNetwork> > ListNextAsync(this IVirtualNetworkOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// List virtual networks in a given lab.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='labName'>
 /// The name of the lab.
 /// </param>
 /// <param name='odataQuery'>
 /// OData parameters to apply to the operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <VirtualNetwork> > ListAsync(this IVirtualNetworkOperations operations, string resourceGroupName, string labName, ODataQuery <VirtualNetwork> odataQuery = default(ODataQuery <VirtualNetwork>), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, labName, odataQuery, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Modify properties of virtual networks.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='labName'>
 /// The name of the lab.
 /// </param>
 /// <param name='name'>
 /// The name of the virtual network.
 /// </param>
 /// <param name='virtualNetwork'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <VirtualNetwork> PatchResourceAsync(this IVirtualNetworkOperations operations, string resourceGroupName, string labName, string name, VirtualNetwork virtualNetwork, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.PatchResourceWithHttpMessagesAsync(resourceGroupName, labName, name, virtualNetwork, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Exemple #4
0
 /// <summary>
 /// Initializes a new instance of the NetworkResourceProviderClient
 /// class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 public NetworkResourceProviderClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._applicationGateways = new ApplicationGatewayOperations(this);
     this._expressRouteCircuitAuthorizations = new ExpressRouteCircuitAuthorizationOperations(this);
     this._expressRouteCircuits         = new ExpressRouteCircuitOperations(this);
     this._expressRouteCircuitPeerings  = new ExpressRouteCircuitPeeringOperations(this);
     this._expressRouteServiceProviders = new ExpressRouteServiceProviderOperations(this);
     this._loadBalancers         = new LoadBalancerOperations(this);
     this._localNetworkGateways  = new LocalNetworkGatewayOperations(this);
     this._networkInterfaces     = new NetworkInterfaceOperations(this);
     this._networkSecurityGroups = new NetworkSecurityGroupOperations(this);
     this._publicIpAddresses     = new PublicIpAddressOperations(this);
     this._routes        = new RouteOperations(this);
     this._routeTables   = new RouteTableOperations(this);
     this._securityRules = new SecurityRuleOperations(this);
     this._subnets       = new SubnetOperations(this);
     this._usages        = new UsageOperations(this);
     this._virtualNetworkGatewayConnections = new VirtualNetworkGatewayConnectionOperations(this);
     this._virtualNetworkGateways           = new VirtualNetworkGatewayOperations(this);
     this._virtualNetworks = new VirtualNetworkOperations(this);
     this._apiVersion      = "2015-05-01-preview";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
 /// <summary>
 /// The list VirtualNetwork returns all Virtual Networks in a
 /// subscription
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Network.IVirtualNetworkOperations.
 /// </param>
 /// <returns>
 /// Response for ListVirtualNetworks Api servive call
 /// </returns>
 public static VirtualNetworkListResponse ListAll(this IVirtualNetworkOperations operations)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IVirtualNetworkOperations)s).ListAllAsync();
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// The Put VirtualNetwork operation creates/updates a virtual network
 /// in the specified resource group.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Network.IVirtualNetworkOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group.
 /// </param>
 /// <param name='virtualNetworkName'>
 /// Required. The name of the virtual network.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the create/update Virtual Network
 /// operation
 /// </param>
 /// <returns>
 /// Response for PutVirtualNetworks API service calls.
 /// </returns>
 public static VirtualNetworkPutResponse BeginCreateOrUpdating(this IVirtualNetworkOperations operations, string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IVirtualNetworkOperations)s).BeginCreateOrUpdatingAsync(resourceGroupName, virtualNetworkName, parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// The Delete VirtualNetwork operation deletes the specifed virtual
 /// network
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Network.IVirtualNetworkOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group.
 /// </param>
 /// <param name='virtualNetworkName'>
 /// Required. The name of the virtual network.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static AzureOperationResponse Delete(this IVirtualNetworkOperations operations, string resourceGroupName, string virtualNetworkName)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IVirtualNetworkOperations)s).DeleteAsync(resourceGroupName, virtualNetworkName);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Exemple #8
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     this.Lab            = new LabOperations(this);
     this.ArtifactSource = new ArtifactSourceOperations(this);
     this.Artifact       = new ArtifactOperations(this);
     this.Cost           = new CostOperations(this);
     this.CustomImage    = new CustomImageOperations(this);
     this.Formula        = new FormulaOperations(this);
     this.GalleryImage   = new GalleryImageOperations(this);
     this.PolicySet      = new PolicySetOperations(this);
     this.Policy         = new PolicyOperations(this);
     this.Schedule       = new ScheduleOperations(this);
     this.VirtualMachine = new VirtualMachineOperations(this);
     this.VirtualNetwork = new VirtualNetworkOperations(this);
     this.BaseUri        = new Uri("https://management.azure.com");
     this.ApiVersion     = "2016-05-15";
     this.AcceptLanguage = "en-US";
     this.LongRunningOperationRetryTimeout = 30;
     this.GenerateClientRequestId          = true;
     SerializationSettings = new JsonSerializerSettings
     {
         Formatting            = Formatting.Indented,
         DateFormatHandling    = DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = DateTimeZoneHandling.Utc,
         NullValueHandling     = NullValueHandling.Ignore,
         ReferenceLoopHandling = ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     SerializationSettings.Converters.Add(new TransformationJsonConverter());
     DeserializationSettings = new JsonSerializerSettings
     {
         DateFormatHandling    = DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = DateTimeZoneHandling.Utc,
         NullValueHandling     = NullValueHandling.Ignore,
         ReferenceLoopHandling = ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     DeserializationSettings.Converters.Add(new TransformationJsonConverter());
     DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
 }
Exemple #9
0
 /// <summary>
 /// Initializes a new instance of the NetworkResourceProviderClient
 /// class.
 /// </summary>
 public NetworkResourceProviderClient()
     : base()
 {
     this._loadBalancers         = new LoadBalancerOperations(this);
     this._localNetworkGateways  = new LocalNetworkGatewayOperations(this);
     this._networkInterfaces     = new NetworkInterfaceOperations(this);
     this._networkSecurityGroups = new NetworkSecurityGroupOperations(this);
     this._publicIpAddresses     = new PublicIpAddressOperations(this);
     this._securityRules         = new SecurityRuleOperations(this);
     this._subnets = new SubnetOperations(this);
     this._usages  = new UsageOperations(this);
     this._virtualNetworkGatewayConnections = new VirtualNetworkGatewayConnectionOperations(this);
     this._virtualNetworkGateways           = new VirtualNetworkGatewayOperations(this);
     this._virtualNetworks = new VirtualNetworkOperations(this);
     this._apiVersion      = "2015-05-01-preview";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
 /// <summary>
 /// The Put VirtualNetwork operation creates/updates a virtual network
 /// in the specified resource group.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Network.IVirtualNetworkOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group.
 /// </param>
 /// <param name='virtualNetworkName'>
 /// Required. The name of the virtual network.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the create/update Virtual Network
 /// operation
 /// </param>
 /// <returns>
 /// Response for PutVirtualNetworks API service calls.
 /// </returns>
 public static Task <VirtualNetworkPutResponse> BeginCreateOrUpdatingAsync(this IVirtualNetworkOperations operations, string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters)
 {
     return(operations.BeginCreateOrUpdatingAsync(resourceGroupName, virtualNetworkName, parameters, CancellationToken.None));
 }
 /// <summary>
 /// The list VirtualNetwork returns all Virtual Networks in a
 /// subscription
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Network.IVirtualNetworkOperations.
 /// </param>
 /// <returns>
 /// Response for ListVirtualNetworks Api servive call
 /// </returns>
 public static Task <VirtualNetworkListResponse> ListAllAsync(this IVirtualNetworkOperations operations)
 {
     return(operations.ListAllAsync(CancellationToken.None));
 }
 /// <summary>
 /// List virtual networks in a given lab.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 public static IPage <VirtualNetwork> ListNext(this IVirtualNetworkOperations operations, string nextPageLink)
 {
     return(Task.Factory.StartNew(s => ((IVirtualNetworkOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// List virtual networks in a given lab.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='labName'>
 /// The name of the lab.
 /// </param>
 /// <param name='odataQuery'>
 /// OData parameters to apply to the operation.
 /// </param>
 public static IPage <VirtualNetwork> List(this IVirtualNetworkOperations operations, string resourceGroupName, string labName, ODataQuery <VirtualNetwork> odataQuery = default(ODataQuery <VirtualNetwork>))
 {
     return(Task.Factory.StartNew(s => ((IVirtualNetworkOperations)s).ListAsync(resourceGroupName, labName, odataQuery), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// The list VirtualNetwork returns all Virtual Networks in a resource
 /// group
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Network.IVirtualNetworkOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group.
 /// </param>
 /// <returns>
 /// Response for ListVirtualNetworks Api servive call
 /// </returns>
 public static Task <VirtualNetworkListResponse> ListAsync(this IVirtualNetworkOperations operations, string resourceGroupName)
 {
     return(operations.ListAsync(resourceGroupName, CancellationToken.None));
 }
 /// <summary>
 /// The Delete VirtualNetwork operation deletes the specifed virtual
 /// network
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Network.IVirtualNetworkOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group.
 /// </param>
 /// <param name='virtualNetworkName'>
 /// Required. The name of the virtual network.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <AzureOperationResponse> DeleteAsync(this IVirtualNetworkOperations operations, string resourceGroupName, string virtualNetworkName)
 {
     return(operations.DeleteAsync(resourceGroupName, virtualNetworkName, CancellationToken.None));
 }
 /// <summary>
 /// Get virtual network.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='labName'>
 /// The name of the lab.
 /// </param>
 /// <param name='name'>
 /// The name of the virtual network.
 /// </param>
 public static VirtualNetwork GetResource(this IVirtualNetworkOperations operations, string resourceGroupName, string labName, string name)
 {
     return(Task.Factory.StartNew(s => ((IVirtualNetworkOperations)s).GetResourceAsync(resourceGroupName, labName, name), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Delete virtual network. This operation can take a while to complete.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='labName'>
 /// The name of the lab.
 /// </param>
 /// <param name='name'>
 /// The name of the virtual network.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task BeginDeleteResourceAsync(this IVirtualNetworkOperations operations, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.BeginDeleteResourceWithHttpMessagesAsync(resourceGroupName, labName, name, null, cancellationToken).ConfigureAwait(false);
 }