private void PollLogMessages(HttpServer.IHttpRequest request, HttpServer.IHttpResponse response, HttpServer.Sessions.IHttpSession session, BodyWriter bw) { RESTHandler.DoProcess(request, response, session, "GET", typeof(RESTMethods.LogData).Name.ToLowerInvariant(), "poll"); }
private void SendCommand(HttpServer.IHttpRequest request, HttpServer.IHttpResponse response, HttpServer.Sessions.IHttpSession session, BodyWriter bw) { HttpServer.HttpInput input = request.Method.ToUpper() == "POST" ? request.Form : request.QueryString; string command = input["command"].Value ?? ""; switch (command.ToLowerInvariant()) { case "check-update": RESTHandler.DoProcess(request, response, session, "POST", typeof(RESTMethods.Updates).Name.ToLowerInvariant(), "check"); return; case "install-update": RESTHandler.DoProcess(request, response, session, "POST", typeof(RESTMethods.Updates).Name.ToLowerInvariant(), "install"); return; case "activate-update": RESTHandler.DoProcess(request, response, session, "POST", typeof(RESTMethods.Updates).Name.ToLowerInvariant(), "activate"); return; case "pause": RESTHandler.DoProcess(request, response, session, "POST", typeof(RESTMethods.ServerState).Name.ToLowerInvariant(), "pause"); return; case "resume": RESTHandler.DoProcess(request, response, session, "POST", typeof(RESTMethods.ServerState).Name.ToLowerInvariant(), "resume"); return; case "stop": case "abort": { var key = string.Format("{0}/{1}", input["taskid"].Value, command); RESTHandler.DoProcess(request, response, session, "POST", typeof(RESTMethods.Task).Name.ToLowerInvariant(), key); } return; case "is-backup-active": { var key = string.Format("{0}/isactive", Library.Utility.Uri.UrlPathEncode(input["id"].Value)); RESTHandler.DoProcess(request, response, session, "GET", typeof(RESTMethods.Backup).Name.ToLowerInvariant(), key); } return; case "run": case "run-backup": { var key = string.Format("{0}/start", Library.Utility.Uri.UrlPathEncode(input["id"].Value)); RESTHandler.DoProcess(request, response, session, "POST", typeof(RESTMethods.Backup).Name.ToLowerInvariant(), key); } return; case "run-verify": { var key = string.Format("{0}/verify", Library.Utility.Uri.UrlPathEncode(input["id"].Value)); RESTHandler.DoProcess(request, response, session, "POST", typeof(RESTMethods.Backup).Name.ToLowerInvariant(), key); } return; case "run-repair-update": { var key = string.Format("{0}/repairupdate", Library.Utility.Uri.UrlPathEncode(input["id"].Value)); RESTHandler.DoProcess(request, response, session, "POST", typeof(RESTMethods.Backup).Name.ToLowerInvariant(), key); } return; case "run-repair": { var key = string.Format("{0}/repair", Library.Utility.Uri.UrlPathEncode(input["id"].Value)); RESTHandler.DoProcess(request, response, session, "POST", typeof(RESTMethods.Backup).Name.ToLowerInvariant(), key); } return; case "create-report": { var key = string.Format("{0}/createreport", Library.Utility.Uri.UrlPathEncode(input["id"].Value)); RESTHandler.DoProcess(request, response, session, "POST", typeof(RESTMethods.Backup).Name.ToLowerInvariant(), key); } return; default: { var key = string.Format("{0}", Library.Utility.Uri.UrlPathEncode(input["command"].Value)); RESTHandler.DoProcess(request, response, session, "POST", typeof(RESTMethods.WebModule).Name.ToLowerInvariant(), key); return; } } }
private void GetUISettingSchemes(HttpServer.IHttpRequest request, HttpServer.IHttpResponse response, HttpServer.Sessions.IHttpSession session, BodyWriter bw) { RESTHandler.HandleControlCGI(request, response, session, bw, typeof(RESTMethods.UISettings)); }
private void GetBackupDefaults(HttpServer.IHttpRequest request, HttpServer.IHttpResponse response, HttpServer.Sessions.IHttpSession session, BodyWriter bw) { RESTHandler.HandleControlCGI(request, response, session, bw, typeof(RESTMethods.BackupDefaults)); }
private void GetNotifications(HttpServer.IHttpRequest request, HttpServer.IHttpResponse response, HttpServer.Sessions.IHttpSession session, BodyWriter bw) { RESTHandler.HandleControlCGI(request, response, session, bw, typeof(RESTMethods.Notifications)); }
private void DismissNotification(HttpServer.IHttpRequest request, HttpServer.IHttpResponse response, HttpServer.Sessions.IHttpSession session, BodyWriter bw) { request.Method = "DELETE"; RESTHandler.HandleControlCGI(request, response, session, bw, typeof(RESTMethods.Notification)); }
private void SetServerOptions(HttpServer.IHttpRequest request, HttpServer.IHttpResponse response, HttpServer.Sessions.IHttpSession session, BodyWriter bw) { request.Method = "PATCH"; RESTHandler.HandleControlCGI(request, response, session, bw, typeof(RESTMethods.ServerSettings)); }
private void ImportBackup(HttpServer.IHttpRequest request, HttpServer.IHttpResponse response, HttpServer.Sessions.IHttpSession session, BodyWriter bw) { RESTHandler.DoProcess(request, response, session, "POST", typeof(RESTMethods.Backups).Name.ToLowerInvariant(), "import"); }
private void ListApplicationSettings(HttpServer.IHttpRequest request, HttpServer.IHttpResponse response, HttpServer.Sessions.IHttpSession session, BodyWriter bw) { RESTHandler.HandleControlCGI(request, response, session, bw, typeof(RESTMethods.SystemWideSettings)); }
private void DownloadBugReport(HttpServer.IHttpRequest request, HttpServer.IHttpResponse response, HttpServer.Sessions.IHttpSession session, BodyWriter bw) { RESTHandler.HandleControlCGI(request, response, session, bw, typeof(RESTMethods.BugReport)); }
private void GetCurrentState(HttpServer.IHttpRequest request, HttpServer.IHttpResponse response, HttpServer.Sessions.IHttpSession session, BodyWriter bw) { RESTHandler.HandleControlCGI(request, response, session, bw, typeof(RESTMethods.ServerState)); }
private void ListSystemInfo(HttpServer.IHttpRequest request, HttpServer.IHttpResponse response, HttpServer.Sessions.IHttpSession session, BodyWriter bw) { RESTHandler.HandleControlCGI(request, response, session, bw, typeof(RESTMethods.SystemInfo)); }
private void GetAcknowledgements(HttpServer.IHttpRequest request, HttpServer.IHttpResponse response, HttpServer.Sessions.IHttpSession session, BodyWriter bw) { RESTHandler.HandleControlCGI(request, response, session, bw, typeof(RESTMethods.Acknowledgements)); }
private void UpdateBackup(HttpServer.IHttpRequest request, HttpServer.IHttpResponse response, HttpServer.Sessions.IHttpSession session, BodyWriter bw) { request.Method = HttpServer.Method.Put; RESTHandler.HandleControlCGI(request, response, session, bw, typeof(RESTMethods.Backup)); }
private void GetFolderContents(HttpServer.IHttpRequest request, HttpServer.IHttpResponse response, HttpServer.Sessions.IHttpSession session, BodyWriter bw) { RESTHandler.DoProcess(request, response, session, request.Method, typeof(RESTMethods.Filesystem).Name.ToLowerInvariant(), Library.Utility.Uri.UrlPathEncode(request.QueryString["path"].Value)); }