Esempio n. 1
0
        void updateIps()
        {
            traefikDAL   traefikDal   = new traefikDAL();
            ClodflareDAL clodflareDal = new ClodflareDAL();
            string       publicip     = clodflareDal.GetIP();
            var          a            = traefikDal.ProcessRepositories().Result;
            var          b            = clodflareDal.getDnsList();

            Dictionary <string, string> updateList = new Dictionary <string, string>();
            List <string> createList = new List <string>();

            foreach (var item in a)
            {
                if (b.ContainsKey(item))
                {
                    if (b[item].IPAddr != publicip)
                    {
                        updateList.Add(item, b[item].ID);
                    }
                }
                else
                {
                    createList.Add(item);
                }
            }
            clodflareDal.updateARecordes(updateList);
            clodflareDal.createNewARecordes(createList);
        }
Esempio n. 2
0
        public string Get()
        {
            ClodflareDAL dal = new ClodflareDAL();
            var          a   = dal.getDnsList();
            var          d   = JsonConvert.SerializeObject(a);

            return(d);
        }
Esempio n. 3
0
        public string Get()
        {
            updateIps();
            ClodflareDAL clodflareDal = new ClodflareDAL();
            var          a            = clodflareDal.getDnsList();
            var          d            = JsonConvert.SerializeObject(a);

            return(d);
        }