コード例 #1
0
        public void CreateApplicationGateway()
        {
            using (NetworkTestClient networkTestClient = new NetworkTestClient())
            {
                ApplicationGatewayOperationResponse result = new ApplicationGatewayOperationResponse();

                //CREATE gateway
                var createParams = new CreateApplicationGatewayParameters
                {
                    Name        = gatewayName,
                    Description = gatewayDescription,
                    VnetName    = vnet,
                    Subnets     = new List <string>()
                    {
                        subnet
                    }
                };

                result = networkTestClient.ApplicationGateways.CreateApplicationGateway(createParams);
                Assert.Equal(result.StatusCode, HttpStatusCode.OK);

                //SET gateway config
                ApplicationGatewaySetConfiguration config = GenerateConfig();

                result = networkTestClient.ApplicationGateways.SetConfigApplicationGateway(gatewayName, config);
                Assert.Equal(result.StatusCode, HttpStatusCode.OK);

                //START gateway
                result = networkTestClient.ApplicationGateways.StartApplicationGateway(gatewayName);
                Assert.Equal(result.StatusCode, HttpStatusCode.OK);
            }
        }
コード例 #2
0
        public ApplicationGatewayOperationResponse CreateApplicationGateway(CreateApplicationGatewayParameters parameters)
        {
            CreateApplicationGateway operation = new CreateApplicationGateway(applicationGatewayClient, parameters);

            testClient.InvokeTestOperation(operation);

            return(operation.InvokeResponse);
        }
コード例 #3
0
 /// <summary>
 /// The Begin Create Application Gateway operation  creates Application
 /// Gateway with the specified  parameters.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj154114.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.ApplicationGateway.IL7GatewayOperations.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the Begin CreateApplication
 /// Gateway request.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <GatewayOperationResponse> BeginCreateApplicationGatewayAsync(this IL7GatewayOperations operations, CreateApplicationGatewayParameters parameters)
 {
     return(operations.BeginCreateApplicationGatewayAsync(parameters, CancellationToken.None));
 }
コード例 #4
0
 /// <summary>
 /// The Begin Create Application Gateway operation  creates Application
 /// Gateway with the specified  parameters.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj154114.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.ApplicationGateway.IL7GatewayOperations.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the Begin CreateApplication
 /// Gateway request.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static GatewayOperationResponse BeginCreateApplicationGateway(this IL7GatewayOperations operations, CreateApplicationGatewayParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IL7GatewayOperations)s).BeginCreateApplicationGatewayAsync(parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
コード例 #5
0
 public CreateApplicationGateway(IApplicationGatewayOperations applicationGatewayClient, CreateApplicationGatewayParameters parameters)
 {
     this.applicationGatewayClient = applicationGatewayClient;
     this.parameters = parameters;
 }