示例#1
0
 public NetworkClient(INetworkManagementClient client, IComputeManagementClient computeClient, IManagementClient managementClient, ICommandRuntime commandRuntime)
 {
     this.client           = client;
     this.computeClient    = computeClient;
     this.managementClient = managementClient;
     this.commandRuntime   = commandRuntime;
 }
 /// <summary>
 /// The Get Operation Status operation returns the status of the
 /// specified operation. After calling an asynchronous operation, you
 /// can call Get Operation Status to determine whether the operation
 /// has succeeded, failed, or is still in progress.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/ee460783.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Network.INetworkManagementClient.
 /// </param>
 /// <param name='requestId'>
 /// Required. The request ID for the request you wish to track. The
 /// request ID is returned in the x-ms-request-id response header for
 /// every request.
 /// </param>
 /// <returns>
 /// The response body contains the status of the specified asynchronous
 /// operation, indicating whether it has succeeded, is inprogress, or
 /// has failed. Note that this status is distinct from the HTTP status
 /// code returned for the Get Operation Status operation itself. If
 /// the asynchronous operation succeeded, the response body includes
 /// the HTTP status code for the successful request. If the
 /// asynchronous operation failed, the response body includes the HTTP
 /// status code for the failed request, and also includes error
 /// information regarding the failure.
 /// </returns>
 public static OperationStatusResponse GetOperationStatus(this INetworkManagementClient operations, string requestId)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((INetworkManagementClient)s).GetOperationStatusAsync(requestId);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
示例#3
0
 /// <summary>
 /// Returns the list of currently active sessions on the Bastion.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='bastionHostName'>
 /// The name of the Bastion Host.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <BastionActiveSession> > BeginGetActiveSessionsAsync(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.BeginGetActiveSessionsWithHttpMessagesAsync(resourceGroupName, bastionHostName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
示例#4
0
 /// <summary>
 /// Returns the list of currently active sessions on the Bastion.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='bastionHostName'>
 /// The name of the Bastion Host.
 /// </param>
 public static IPage <BastionActiveSession> BeginGetActiveSessions(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName)
 {
     return(operations.BeginGetActiveSessionsAsync(resourceGroupName, bastionHostName).GetAwaiter().GetResult());
 }
示例#5
0
 /// <summary>
 /// Deletes the Bastion Shareable Links for all the VMs specified in the
 /// request.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='bastionHostName'>
 /// The name of the Bastion Host.
 /// </param>
 /// <param name='bslRequest'>
 /// Post request for all the Bastion Shareable Link endpoints.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task BeginDeleteBastionShareableLinkAsync(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.BeginDeleteBastionShareableLinkWithHttpMessagesAsync(resourceGroupName, bastionHostName, bslRequest, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
示例#6
0
 /// <summary>
 /// Checks whether a domain name in the cloudapp.net zone is available for use.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='location'>
 /// The location of the domain name
 /// </param>
 /// <param name='domainNameLabel'>
 /// The domain name to be verified. It must conform to the following regular
 /// expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.
 /// </param>
 public static DnsNameAvailabilityResult CheckDnsNameAvailability(this INetworkManagementClient operations, string location, string domainNameLabel = default(string))
 {
     return(Task.Factory.StartNew(s => ((INetworkManagementClient)s).CheckDnsNameAvailabilityAsync(location, domainNameLabel), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
示例#7
0
 /// <summary>
 /// Deletes the Bastion Shareable Links for all the VMs specified in the
 /// request.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='bastionHostName'>
 /// The name of the Bastion Host.
 /// </param>
 /// <param name='bslRequest'>
 /// Post request for all the Bastion Shareable Link endpoints.
 /// </param>
 public static void DeleteBastionShareableLink(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest)
 {
     operations.DeleteBastionShareableLinkAsync(resourceGroupName, bastionHostName, bslRequest).GetAwaiter().GetResult();
 }
示例#8
0
 /// <summary>
 /// Returns the list of currently active sessions on the Bastion.
 /// </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 <BastionActiveSession> BeginGetActiveSessionsNext(this INetworkManagementClient operations, string nextPageLink)
 {
     return(operations.BeginGetActiveSessionsNextAsync(nextPageLink).GetAwaiter().GetResult());
 }
示例#9
0
 /// <summary>
 /// Creates a Bastion Shareable Links for all the VMs specified in the request.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='bastionHostName'>
 /// The name of the Bastion Host.
 /// </param>
 /// <param name='bslRequest'>
 /// Post request for all the Bastion Shareable Link endpoints.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <BastionShareableLink> > PutBastionShareableLinkAsync(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.PutBastionShareableLinkWithHttpMessagesAsync(resourceGroupName, bastionHostName, bslRequest, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
示例#10
0
 /// <summary>
 /// Checks whether a domain name in the cloudapp.azure.com zone is available
 /// for use.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='location'>
 /// The location of the domain name.
 /// </param>
 /// <param name='domainNameLabel'>
 /// The domain name to be verified. It must conform to the following regular
 /// expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.
 /// </param>
 public static DnsNameAvailabilityResult CheckDnsNameAvailability(this INetworkManagementClient operations, string location, string domainNameLabel)
 {
     return(operations.CheckDnsNameAvailabilityAsync(location, domainNameLabel).GetAwaiter().GetResult());
 }
示例#11
0
 /// <summary>
 /// Returns the list of currently active sessions on the Bastion.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='bastionHostName'>
 /// The name of the Bastion Host.
 /// </param>
 /// <param name='sessionIds'>
 /// The list of sessionids to disconnect.
 /// </param>
 public static IPage <BastionSessionState> DisconnectActiveSessions(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, SessionIds sessionIds)
 {
     return(operations.DisconnectActiveSessionsAsync(resourceGroupName, bastionHostName, sessionIds).GetAwaiter().GetResult());
 }
 /// <summary>
 /// The Get Operation Status operation returns the status of the
 /// specified operation. After calling an asynchronous operation, you
 /// can call Get Operation Status to determine whether the operation
 /// has succeeded, failed, or is still in progress.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/ee460783.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Network.INetworkManagementClient.
 /// </param>
 /// <param name='requestId'>
 /// Required. The request ID for the request you wish to track. The
 /// request ID is returned in the x-ms-request-id response header for
 /// every request.
 /// </param>
 /// <returns>
 /// The response body contains the status of the specified asynchronous
 /// operation, indicating whether it has succeeded, is inprogress, or
 /// has failed. Note that this status is distinct from the HTTP status
 /// code returned for the Get Operation Status operation itself. If
 /// the asynchronous operation succeeded, the response body includes
 /// the HTTP status code for the successful request. If the
 /// asynchronous operation failed, the response body includes the HTTP
 /// status code for the failed request, and also includes error
 /// information regarding the failure.
 /// </returns>
 public static Task <OperationStatusResponse> GetOperationStatusAsync(this INetworkManagementClient operations, string requestId)
 {
     return(operations.GetOperationStatusAsync(requestId, CancellationToken.None));
 }
 internal NetworkUsagesImpl(INetworkManagementClient client)
 {
     this.client = client;
 }
示例#14
0
 public NetworkClient(INetworkManagementClient NetworkManagementClient)
 {
     this.NetworkManagementClient = NetworkManagementClient;
 }
示例#15
0
 /// <summary>
 /// Generates a unique VPN profile for P2S clients for VirtualWan and
 /// associated VpnServerConfiguration combination in the specified resource
 /// group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group name.
 /// </param>
 /// <param name='virtualWANName'>
 /// The name of the VirtualWAN whose associated VpnServerConfigurations is
 /// needed.
 /// </param>
 /// <param name='vpnClientParams'>
 /// Parameters supplied to the generate VirtualWan VPN profile generation
 /// operation.
 /// </param>
 public static VpnProfileResponse BeginGeneratevirtualwanvpnserverconfigurationvpnprofile(this INetworkManagementClient operations, string resourceGroupName, string virtualWANName, VirtualWanVpnProfileParameters vpnClientParams)
 {
     return(operations.BeginGeneratevirtualwanvpnserverconfigurationvpnprofileAsync(resourceGroupName, virtualWANName, vpnClientParams).GetAwaiter().GetResult());
 }
示例#16
0
 /// <summary>
 /// Generates a unique VPN profile for P2S clients for VirtualWan and
 /// associated VpnServerConfiguration combination in the specified resource
 /// group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group name.
 /// </param>
 /// <param name='virtualWANName'>
 /// The name of the VirtualWAN whose associated VpnServerConfigurations is
 /// needed.
 /// </param>
 /// <param name='vpnClientParams'>
 /// Parameters supplied to the generate VirtualWan VPN profile generation
 /// operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <VpnProfileResponse> BeginGeneratevirtualwanvpnserverconfigurationvpnprofileAsync(this INetworkManagementClient operations, string resourceGroupName, string virtualWANName, VirtualWanVpnProfileParameters vpnClientParams, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.BeginGeneratevirtualwanvpnserverconfigurationvpnprofileWithHttpMessagesAsync(resourceGroupName, virtualWANName, vpnClientParams, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
示例#17
0
 /// <summary>
 /// Checks whether a domain name in the cloudapp.azure.com zone is available
 /// for use.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='location'>
 /// The location of the domain name.
 /// </param>
 /// <param name='domainNameLabel'>
 /// The domain name to be verified. It must conform to the following regular
 /// expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <DnsNameAvailabilityResult> CheckDnsNameAvailabilityAsync(this INetworkManagementClient operations, string location, string domainNameLabel, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CheckDnsNameAvailabilityWithHttpMessagesAsync(location, domainNameLabel, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
示例#18
0
 /// <summary>
 /// Creates a Bastion Shareable Links for all the VMs specified in the request.
 /// </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 <BastionShareableLink> BeginPutBastionShareableLinkNext(this INetworkManagementClient operations, string nextPageLink)
 {
     return(operations.BeginPutBastionShareableLinkNextAsync(nextPageLink).GetAwaiter().GetResult());
 }
示例#19
0
 /// <summary>
 /// Gives the supported security providers for the virtual wan.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group name.
 /// </param>
 /// <param name='virtualWANName'>
 /// The name of the VirtualWAN for which supported security providers are
 /// needed.
 /// </param>
 public static VirtualWanSecurityProviders SupportedSecurityProviders(this INetworkManagementClient operations, string resourceGroupName, string virtualWANName)
 {
     return(operations.SupportedSecurityProvidersAsync(resourceGroupName, virtualWANName).GetAwaiter().GetResult());
 }
示例#20
0
 /// <summary>
 /// Returns the list of currently active sessions on the Bastion.
 /// </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 <BastionActiveSession> > BeginGetActiveSessionsNextAsync(this INetworkManagementClient operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.BeginGetActiveSessionsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
示例#21
0
 /// <summary>
 /// Gives the supported security providers for the virtual wan.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group name.
 /// </param>
 /// <param name='virtualWANName'>
 /// The name of the VirtualWAN for which supported security providers are
 /// needed.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <VirtualWanSecurityProviders> SupportedSecurityProvidersAsync(this INetworkManagementClient operations, string resourceGroupName, string virtualWANName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.SupportedSecurityProvidersWithHttpMessagesAsync(resourceGroupName, virtualWANName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
示例#22
0
 public NetworkClient(INetworkManagementClient NetworkManagementClient)
 {
     this.NetworkManagementClient = NetworkManagementClient;
 }
示例#23
0
 /// <summary>
 /// Creates a Bastion Shareable Links for all the VMs specified in the request.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='bastionHostName'>
 /// The name of the Bastion Host.
 /// </param>
 /// <param name='bslRequest'>
 /// Post request for all the Bastion Shareable Link endpoints.
 /// </param>
 public static IPage <BastionShareableLink> BeginPutBastionShareableLink(this INetworkManagementClient operations, string resourceGroupName, string bastionHostName, BastionShareableLinkListRequest bslRequest)
 {
     return(operations.BeginPutBastionShareableLinkAsync(resourceGroupName, bastionHostName, bslRequest).GetAwaiter().GetResult());
 }