示例#1
0
        protected Operation WaitForGatewayOperation(string opdesc)
        {
            Operation        operation           = null;
            String           operationId         = RetrieveOperationId();
            SubscriptionData currentSubscription = this.GetCurrentSubscription();

            try
            {
                IGatewayServiceManagement channel = (IGatewayServiceManagement)Channel;
                operation = RetryCall(s => channel.GetGatewayOperation(currentSubscription.SubscriptionId, operationId));

                var activityId = new Random().Next(1, 999999);
                var progress   = new ProgressRecord(activityId, opdesc, "Operation Status: " + operation.Status);
                while (string.Compare(operation.Status, OperationState.Succeeded, StringComparison.OrdinalIgnoreCase) != 0 &&
                       string.Compare(operation.Status, OperationState.Failed, StringComparison.OrdinalIgnoreCase) != 0)
                {
                    WriteProgress(progress);
                    Thread.Sleep(1 * 1000);
                    operation = RetryCall(s => channel.GetGatewayOperation(currentSubscription.SubscriptionId, operationId));
                }

                if (string.Compare(operation.Status, OperationState.Failed, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    var errorMessage = string.Format(CultureInfo.InvariantCulture, "{0}: {1}", operation.Status, operation.Error.Message);
                    var exception    = new Exception(errorMessage);
                    WriteError(new ErrorRecord(exception, string.Empty, ErrorCategory.CloseError, null));
                }
            }
            catch (CommunicationException ex)
            {
                WriteErrorDetails(ex);
            }

            return(operation);
        }
 public GetAzureVNetGatewayKeyCommand(IGatewayServiceManagement channel)
 {
     Channel = channel;
 }
示例#3
0
 public static Operation GetGatewayOperation(this IGatewayServiceManagement proxy, string subscriptionId, string operationId)
 {
     return(proxy.EndGetGatewayOperation(proxy.BeginGetGatewayOperation(subscriptionId, operationId, null, null)));
 }
示例#4
0
 public static GatewayOperationAsyncResponse UpdateVirtualNetworkGatewayConnection(this IGatewayServiceManagement proxy, string subscriptionId, string virtualNetworkName, string localNetworkSiteName, UpdateConnection updateConnection)
 {
     return(proxy.EndUpdateConnection(proxy.BeginUpdateConnection(subscriptionId, virtualNetworkName, localNetworkSiteName, updateConnection, null, null)));
 }
示例#5
0
 public static Stream GetVirtualNetworkSupportedDevices(this IGatewayServiceManagement proxy, string subscriptionId)
 {
     return(proxy.EndListSupportedDevices(proxy.BeginListSupportedDevices(subscriptionId, null, null)));
 }
示例#6
0
 public static VnetGateway GetVirtualNetworkGateway(this IGatewayServiceManagement proxy, string subscriptionId, string virtualNetworkName)
 {
     return(proxy.EndGetGateway(proxy.BeginGetGateway(subscriptionId, virtualNetworkName, null, null)));
 }
示例#7
0
 public static SharedKey GetVirtualNetworkSharedKey(this IGatewayServiceManagement proxy, string subscriptionId, string virtualNetworkName, string localNetworkSiteName)
 {
     return(proxy.EndGetSharedKey(proxy.BeginGetSharedKey(subscriptionId, virtualNetworkName, localNetworkSiteName, null, null)));
 }
示例#8
0
 public static ConnectionCollection ListVirtualNetworkConnections(this IGatewayServiceManagement proxy, string subscriptionId, string virtualNetworkName)
 {
     return(proxy.EndListConnections(proxy.BeginListConnections(subscriptionId, virtualNetworkName, null, null)));
 }
示例#9
0
 public static GatewayOperationAsyncResponse DeleteVirtualNetworkGateway(this IGatewayServiceManagement proxy, string subscriptionId, string virtualNetworkName)
 {
     return(proxy.EndDeleteGateway(proxy.BeginDeleteGateway(subscriptionId, virtualNetworkName, null, null)));
 }
 public RemoveAzureVNetGatewayCommand(IGatewayServiceManagement channel)
 {
     Channel = channel;
 }
示例#11
0
 public GetAzureVNetGatewayCommand(IGatewayServiceManagement channel)
 {
     Channel = channel;
 }
 public NewAzureVNetGatewayCommand(IGatewayServiceManagement channel)
 {
     base.Channel = channel;
 }
 public GetAzureVNetConnectionCommand(IGatewayServiceManagement channel)
 {
     Channel = channel;
 }
 public GetAzureVNetConnectionCommand(IGatewayServiceManagement channel)
 {
     base.Channel = channel;
 }
示例#15
0
		public NewAzureVNetGatewayCommand(IGatewayServiceManagement channel)
		{
			base.Channel = channel;
		}