Ejemplo n.º 1
0
 public PathRule(string name, string path, BackendHttpSetting backendHttpSetting, BackendPool backendPool)
 {
     Name = name;
     Path = path;
     BackendHttpSetting = backendHttpSetting;
     BackendPool        = backendPool;
 }
Ejemplo n.º 2
0
 private void CreateBackendHttpSetting(string protocol, int port, string backendHttpSettingName)
 {
     _backendHttpSetting = new BackendHttpSetting
     {
         Protocol = protocol,
         Port     = port,
         Name     = backendHttpSettingName ?? _appService.Name
     };
 }
Ejemplo n.º 3
0
            public IDefineBackendProbe <IDefineRouting> Using(string protocol, int port, string backendHttpSettingName = null)
            {
                _backendHttpSetting = new BackendHttpSetting
                {
                    Name     = backendHttpSettingName ?? _appService.Name,
                    Port     = port,
                    Protocol = protocol
                };

                return(this);
            }
Ejemplo n.º 4
0
            public IDefineRouting WithProbe(string path             = "/", int interval = 30, int timeout = 30, int unhealthyThreshold = 3,
                                            string matchStatusCodes = "200-399", string probeName = null)
            {
                _applicationGateway.Listeners.Add(_listener);
                var probe = new Probe(probeName ?? _appService.Name, _backendHttpSetting.Protocol, path, interval, timeout, unhealthyThreshold, matchStatusCodes);

                if (!_applicationGateway.Probes.Contains(probe))
                {
                    _applicationGateway.Probes.Add(probe);
                }
                else
                {
                    probe = _applicationGateway.Probes.Single(p => Equals(p, probe));
                }

                _backendHttpSetting.Probe = probe;

                if (!_applicationGateway.BackendHttpSettings.Contains(_backendHttpSetting))
                {
                    _applicationGateway.BackendHttpSettings.Add(_backendHttpSetting);
                }
                else
                {
                    _backendHttpSetting = _applicationGateway.BackendHttpSettings.Single(p => Equals(p, _backendHttpSetting));
                }

                var backendPool = new BackendPool
                {
                    Name      = _backendPoolName,
                    Addresses = { new BackendPoolAddress(_appService) }
                };

                if (!_applicationGateway.BackendPools.Contains(backendPool))
                {
                    _applicationGateway.BackendPools.Add(backendPool);
                }
                else
                {
                    backendPool = _applicationGateway.BackendPools.Single(p => Equals(p, backendPool));
                }


                _applicationGateway.Rules.Add(new BasicForwardRule(_ruleName, _listener, _backendHttpSetting, backendPool));

                return(_defineRouting);
            }
Ejemplo n.º 5
0
            private BackendPool AddProbeAndBackendPool(string path, int interval, int timeout, int unhealthyThreshold, string matchStatusCodes, string probeName)
            {
                var probe = new Probe(probeName ?? _appService.Name, _backendHttpSetting.Protocol, path, interval, timeout, unhealthyThreshold, matchStatusCodes);

                if (!_applicationGateway.Probes.Contains(probe))
                {
                    _applicationGateway.Probes.Add(probe);
                }
                else
                {
                    probe = _applicationGateway.Probes.Single(p => Equals(p, probe));
                }

                _backendHttpSetting.Probe = probe;
                if (!_applicationGateway.BackendHttpSettings.Contains(_backendHttpSetting))
                {
                    _applicationGateway.BackendHttpSettings.Add(_backendHttpSetting);
                }
                else
                {
                    _backendHttpSetting = _applicationGateway.BackendHttpSettings.Single(p => Equals(p, _backendHttpSetting));
                }

                var backendPool = new BackendPool
                {
                    Name      = _backendPoolName,
                    Addresses = { new BackendPoolAddress(_appService) }
                };

                if (!_applicationGateway.BackendPools.Contains(backendPool))
                {
                    _applicationGateway.BackendPools.Add(backendPool);
                }
                else
                {
                    backendPool = _applicationGateway.BackendPools.Single(p => Equals(p, backendPool));
                }

                return(backendPool);
            }
Ejemplo n.º 6
0
 public UrlPathMap WithRule(string name, string path, BackendHttpSetting backendHttpSetting,
                            BackendPool backendPool)
 {
     _rules.Add(new PathRule(name, path, backendHttpSetting, backendPool));
     return(this);
 }
Ejemplo n.º 7
0
 public UrlPathMap(string name, BackendHttpSetting defaultBackendHttpSetting, BackendPool defaultBackendPool)
 {
     Name = name;
     DefaultBackendHttpSetting = defaultBackendHttpSetting;
     DefaultBackendPool        = defaultBackendPool;
 }
Ejemplo n.º 8
0
 public BasicForwardRule(string name, Listener listener, BackendHttpSetting backendHttpSetting, BackendPool backendPool) : base(name, listener)
 {
     BackendHttpSetting = backendHttpSetting;
     BackendPool        = backendPool;
 }