Beispiel #1
0
        public void fusionMgrTest()
        {
            //Settings.load();
            Settings.LoadFromFile();
            string testResUrl = "http://test.fengyh.cn/qiniu/files/hello.txt";
            Mac mac = new Mac(Settings.AccessKey, Settings.SecretKey);
            FusionManager target = new FusionManager(mac);

            //
        }
Beispiel #2
0
        /// <summary>
        /// 文件预取
        /// </summary>
        public static void prefetch()
        {
            Mac mac = new Mac(Settings.AccessKey, Settings.SecretKey);
            FusionManager fusionMgr = new FusionManager(mac);

            string[] urls = new string[] { "URL1", "URL2" };
            PrefetchRequest request = new PrefetchRequest(urls);
            PrefetchResult result = fusionMgr.Prefetch(request);
            Console.WriteLine(result);
        }
Beispiel #3
0
        /// <summary>
        /// 日志查询
        /// </summary>
        public static void loglist()
        {
            Mac mac = new Mac(Settings.AccessKey, Settings.SecretKey);
            FusionManager fusionMgr = new FusionManager(mac);

            LogListRequest request = new LogListRequest();
            request.Day = "DAY"; // "2016-09-01"
            request.Domains = "DOMAIN1"; // domains
            LogListResult result = fusionMgr.LogList(request);
            Console.WriteLine(result);
        }
Beispiel #4
0
        /// <summary>
        /// 缓存刷新
        /// </summary>
        public static void refresh()
        {
            Mac mac = new Mac(Settings.AccessKey, Settings.SecretKey);
            FusionManager fusionMgr = new FusionManager(mac);

            string[] urls = new string[] { "URL1", "URL2" };
            string[] dirs = new string[] { "DIR1", "DIR2" };
            RefreshRequest request = new RefreshRequest();
            request.AddUrls(urls);
            request.AddDirs(dirs);
            RefreshResult result = fusionMgr.Refresh(request);
            Console.WriteLine(result);
        }
Beispiel #5
0
        /// <summary>
        /// 流量
        /// </summary>
        public static void flux()
        {
            Mac mac = new Mac(Settings.AccessKey, Settings.SecretKey);
            FusionManager fusionMgr = new FusionManager(mac);

            FluxRequest request = new FluxRequest();
            request.StartDate = "START_DATE"; // "2016-09-01"
            request.EndDate = "END_DATE"; // "2016-09-20"
            request.Granularity = "GRANU"; // "day"
            request.Domains = "DOMAIN1;DOMAIN2"; // domains
            FluxResult result = fusionMgr.Flux(request);
            Console.WriteLine(result);
        }