Exemple #1
0
        public static void AddNode(NodePool nodePool)
        {
            var nodepollurl = MySettings.nodepoolsurl + nodePool.id;
            var json        = GetJsonData.GetJson(nodepollurl, MySettings.token);
            var q           = json["quantity"];

            json["quantity"] = (int)q + 1;
            var resault = PutJsonData.PutJson(nodepollurl, MySettings.token, json.ToString());

            Console.WriteLine("AddNode " + resault);
        }
Exemple #2
0
        public static void RemoveNode(NodePool nodePool)
        {
            foreach (var node in nodePool.Nodes)
            {
                if (node.hostName == nodePool.hostnamePrefix + nodePool.quantity.ToString())
                {
                    Console.WriteLine("DrainNode " + node.hostName);
                    DrainNode(node);
                }
            }
            var nodepollurl = MySettings.nodepoolsurl + nodePool.id;
            var json        = GetJsonData.GetJson(nodepollurl, MySettings.token);
            var q           = json["quantity"];

            json["quantity"] = (int)q - 1;
            var resault = PutJsonData.PutJson(nodepollurl, MySettings.token, json.ToString());

            Console.WriteLine("RemoveNode " + resault);
        }