///GENMHASH:DE88BB19D1C1507E6EAAD715D1F861E6:F2935D4C9878DFEC3D331B356A794987
        private ApplicationGatewayRequestRoutingRuleImpl FromFrontendPort(int portNumber, ApplicationGatewayProtocol protocol, string name)
        {
            // Verify no conflicting listener exists
            var listenerByPort = (ApplicationGatewayListenerImpl)this.Parent.ListenerByPortNumber(portNumber);
            IApplicationGatewayListener listenerByName = null;

            if (name != null)
            {
                Parent.Listeners().TryGetValue(name, out listenerByName);
            }

            bool?needToCreate = Parent.NeedToCreate(listenerByName, listenerByPort, name);

            if (needToCreate != null && needToCreate.Value)
            {
                // If no listener exists for the requested port number yet and the name, create one
                if (name == null)
                {
                    name = SdkContext.RandomResourceName("listener", 13);
                }

                listenerByPort = this.Parent.DefineListener(name)
                                 .WithFrontendPort(portNumber);

                // Determine protocol
                if (ApplicationGatewayProtocol.Http.Equals(protocol))
                {
                    listenerByPort.WithHttp();
                }
                else if (ApplicationGatewayProtocol.Https.Equals(protocol))
                {
                    listenerByPort.WithHttps();
                }

                // Determine frontend
                if (associateWithPublicFrontend != null && associateWithPublicFrontend.Value)
                {
                    listenerByPort.WithPublicFrontend();
                    Parent.WithNewPublicIPAddress();
                }
                else if (associateWithPublicFrontend != null && !associateWithPublicFrontend.Value)
                {
                    listenerByPort.WithPrivateFrontend();
                }

                associateWithPublicFrontend = null; // Reset, indicating no frontend association need

                listenerByPort.Attach();
                return(FromListener(listenerByPort.Name()));
            }
            else
            {
                // If matching listener already exists then fail
                return(null);
            }
        }
コード例 #2
0
 ///GENMHASH:A473E8C551A81C93BD8EA73FE99E314B:D6F3848D67AE407B04179F01B8D24165
 public ApplicationGatewayBackendHttpConfigurationImpl WithProtocol(ApplicationGatewayProtocol protocol)
 {
     Inner.Protocol = protocol?.ToString();
     return(this);
 }
コード例 #3
0
 ///GENMHASH:D684E7477889A9013C81FAD82F69C54F:BD249A015EF71106387B78281489583A
 public ApplicationGatewayProtocol Protocol()
 {
     return(ApplicationGatewayProtocol.Parse(Inner.Protocol));
 }
コード例 #4
0
 /// <summary>
 /// Specifies the transport protocol.
 /// </summary>
 /// <param name="protocol">A transport protocol.</param>
 /// <return>The next stage of the definition.</return>
 ApplicationGatewayProbe.Definition.IWithTimeout <ApplicationGateway.Definition.IWithCreate> HasProtocol.Definition.IWithProtocol <ApplicationGatewayProbe.Definition.IWithTimeout <ApplicationGateway.Definition.IWithCreate>, Models.ApplicationGatewayProtocol> .WithProtocol(ApplicationGatewayProtocol protocol)
 {
     return(this.WithProtocol(protocol));
 }
コード例 #5
0
 /// <summary>
 /// Specifies the transport protocol.
 /// </summary>
 /// <param name="protocol">A transport protocol.</param>
 /// <return>The next stage of the update.</return>
 ApplicationGatewayProbe.Update.IUpdate HasProtocol.Update.IWithProtocol <ApplicationGatewayProbe.Update.IUpdate, Models.ApplicationGatewayProtocol> .WithProtocol(ApplicationGatewayProtocol protocol)
 {
     return(this.WithProtocol(protocol));
 }
コード例 #6
0
 ///GENMHASH:A473E8C551A81C93BD8EA73FE99E314B:8E47A7551FAA8958BCB5314D0E665506
 public ApplicationGatewayProbeImpl WithProtocol(ApplicationGatewayProtocol protocol)
 {
     Inner.Protocol = protocol.Value;
     return(this);
 }