Example #1
0
        public Activity _Fetch(System.DateTime?startDate = null, System.DateTime?endDate = null)
        {
            object query = new System.Collections.Generic.Dictionary <string, object> {
            };

            if (startDate != null)
            {
                (query as System.Collections.Generic.Dictionary <string, object>)["Start"] = Util.Date2str(startDate);
            }
            if (endDate != null)
            {
                (query as System.Collections.Generic.Dictionary <string, object>)["End"] = Util.Date2str(endDate);
            }
            string path = this._ApiPathPrefix() + "/" + Util.UrlEncode(this._SourceId) + this._ApiPathSuffix();
            object data = this._Client.Request("GET", path);

            if (data == null)
            {
                return(null);
            }
            data = (data as System.Collections.Generic.Dictionary <string, object>)["Data"];
            if (data == null)
            {
                return(null);
            }
            System.Collections.Generic.List <string> dates = Util.DictionaryKeys(data);
            dates = Util.SortArray(dates);
            for (int __it1 = 0; __it1 < (dates as System.Collections.IList).Count; __it1++)
            {
                var date = dates[__it1];
                this._AddSample(date, (data as System.Collections.Generic.Dictionary <string, object>)[date]);
            }
            return(this);
        }
Example #2
0
        /// <summary>このルータ+スイッチで利用できる未使用のIPアドレスを収集します。
        /// </summary>
        public System.Collections.Generic.List <string> CollectUnusedIpv4Addresses()
        {
            System.Collections.Generic.List <Ipv4Net> nets = this.Get_ipv4Nets();
            if (nets.Count < 1)
            {
                return(null);
            }
            object used = this._UsedIpv4AddressHash();

            System.Collections.Generic.List <string> ret = new System.Collections.Generic.List <string> {
            };
            for (int __it1 = 0; __it1 < (nets[System.Convert.ToInt32(0)].Get_range().Get_asArray() as System.Collections.IList).Count; __it1++)
            {
                var ip = nets[System.Convert.ToInt32(0)].Get_range().Get_asArray()[__it1];
                if (!(used as System.Collections.Generic.Dictionary <string, object>).ContainsKey(ip))
                {
                    (ret as System.Collections.IList).Add(ip);
                }
            }
            return(Util.SortArray(ret));
        }
Example #3
0
        /// <summary>このルータ+スイッチに接続中のインタフェースに割り当てられているIPアドレスを収集します。
        /// </summary>
        public System.Collections.Generic.List <string> CollectUsedIpv4Addresses()
        {
            object found = this._UsedIpv4AddressHash();

            return(Util.SortArray(Util.DictionaryKeys(found)));
        }