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);
        }
 public ActionResult HAProxyAdminGroup(string group, HAProxyAdmin.Action act)
 {
     return Json(HAProxyAdmin.PerformGroupAction(group, act));
 }
 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);