Exemplo n.º 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));
        }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
 public ActionResult HAProxyAdminGroup(string group, HAProxyAdmin.Action act)
 {
     return Json(HAProxyAdmin.PerformGroupAction(group, act));
 }
Exemplo n.º 4
0
 public ActionResult HAProxyAdminServer(string server, HAProxyAdmin.Action act)
 {
     return Json(HAProxyAdmin.PerformServerAction(server, act));
 }
Exemplo n.º 5
0
 public Task <bool> DisableAsync(string node) => HAProxyAdmin.PerformServerActionAsync(node, Action.Drain);
Exemplo n.º 6
0
 public Task <bool> EnableAsync(string node) => HAProxyAdmin.PerformServerActionAsync(node, Action.Ready);