public PathRule(string name, string path, BackendHttpSetting backendHttpSetting, BackendPool backendPool) { Name = name; Path = path; BackendHttpSetting = backendHttpSetting; BackendPool = backendPool; }
private void CreateBackendHttpSetting(string protocol, int port, string backendHttpSettingName) { _backendHttpSetting = new BackendHttpSetting { Protocol = protocol, Port = port, Name = backendHttpSettingName ?? _appService.Name }; }
public IDefineBackendProbe <IDefineRouting> Using(string protocol, int port, string backendHttpSettingName = null) { _backendHttpSetting = new BackendHttpSetting { Name = backendHttpSettingName ?? _appService.Name, Port = port, Protocol = protocol }; return(this); }
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); }
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); }
public UrlPathMap WithRule(string name, string path, BackendHttpSetting backendHttpSetting, BackendPool backendPool) { _rules.Add(new PathRule(name, path, backendHttpSetting, backendPool)); return(this); }
public UrlPathMap(string name, BackendHttpSetting defaultBackendHttpSetting, BackendPool defaultBackendPool) { Name = name; DefaultBackendHttpSetting = defaultBackendHttpSetting; DefaultBackendPool = defaultBackendPool; }
public BasicForwardRule(string name, Listener listener, BackendHttpSetting backendHttpSetting, BackendPool backendPool) : base(name, listener) { BackendHttpSetting = backendHttpSetting; BackendPool = backendPool; }