Пример #1
0
        public ActionResult HAProxyAdminProxy(string group, string proxy, string server, HAProxyAdmin.Action act)
        {
            var haGroup = HAProxyGroup.GetGroup(group);
            var proxies = (haGroup != null ? haGroup.GetProxies() : HAProxyGroup.GetAllProxies()).Where(pr => pr.Name == proxy);

            return Json(HAProxyAdmin.PerformProxyAction(proxies, server, act));
        }
Пример #2
0
        public HAProxyModule(IOptions <HAProxySettings> settings) : base(settings)
        {
            var snapshot = settings.Value;

            Groups = snapshot.Groups.Select(g => new HAProxyGroup(this, g))
                     .Union(snapshot.Instances.Select(c => new HAProxyGroup(this, c)))
                     .ToList();
            Admin = new HAProxyAdmin(this);
        }
Пример #3
0
 public ActionResult HAProxyAdminGroup(string group, HAProxyAdmin.Action act)
 {
     return Json(HAProxyAdmin.PerformGroupAction(group, act));
 }
Пример #4
0
 public ActionResult HAProxyAdminServer(string server, HAProxyAdmin.Action act)
 {
     return Json(HAProxyAdmin.PerformServerAction(server, act));
 }
Пример #5
0
 public Task <bool> DisableAsync(string node) => HAProxyAdmin.PerformServerActionAsync(node, Action.Drain);
Пример #6
0
 public Task <bool> EnableAsync(string node) => HAProxyAdmin.PerformServerActionAsync(node, Action.Ready);