Esempio n. 1
0
        public RestResponse AddResult(int monitorId, long checktime, List <MonResult> results)
        {
            var parameters = new Dictionary <String, Object>();

            parameters.Add("results", URLObject.ToUrlString(results));
            parameters.Add("monitorId", monitorId);
            parameters.Add("checktime", checktime);
            return(MakePostRequest(MonitorAction.addResult, parameters));
        }
Esempio n. 2
0
        public RestResponse EditMonitor(int monitorId, String name, String tag,
                                        List <MonitorParameter> monitorParams)
        {
            var parameters = new Dictionary <String, Object>();

            if (monitorParams != null)
            {
                parameters.Add("monitorParams", URLObject.ToUrlString(monitorParams));
            }
            parameters.Add("name", StringUtils.UrlEncode(name));
            parameters.Add("monitorId", monitorId);
            parameters.Add("tag", StringUtils.UrlEncode(tag));
            return(MakePostRequest(MonitorAction.editMonitor, parameters));
        }
Esempio n. 3
0
        public RestResponse AddMonitor(int customUserAgentId, String name, String tag, String type, List <MonitorParameter> monitorParams,
                                       List <MonResultParameter> resultParams, List <MonResultParameter> additionalResultParams)
        {
            var parameters = new Dictionary <String, Object>();

            if (monitorParams != null)
            {
                parameters.Add("monitorParams", URLObject.ToUrlString(monitorParams));
            }
            parameters.Add("resultParams", URLObject.ToUrlString(resultParams));
            if (additionalResultParams != null)
            {
                parameters.Add("additionalResultParams", URLObject.ToUrlString(additionalResultParams));
            }
            parameters.Add("customUserAgentId", customUserAgentId);
            parameters.Add("name", StringUtils.UrlEncode(name));
            parameters.Add("tag", StringUtils.UrlEncode(tag));
            if (type != null)
            {
                parameters.Add("type", StringUtils.UrlEncode(type));
            }
            return(MakePostRequest(MonitorAction.addMonitor, parameters));
        }