diff options
| author | 7illusions <z@7illusions.com> | 2014-08-30 19:06:58 +0200 |
|---|---|---|
| committer | 7illusions <z@7illusions.com> | 2014-08-30 19:06:58 +0200 |
| commit | 66ad1699e22029b605e17735e8d9450285d8748a (patch) | |
| tree | ffc92c88d24850b2f82b6b3a8bdd904a2ccc77a5 /MediaBrowser.Api/SystemService.cs | |
| parent | 34bc54263e886aae777a3537dc50a6535b51330a (diff) | |
| parent | 9d36f518182bc075c19d78084870f5115fa62d1e (diff) | |
Merge pull request #1 from MediaBrowser/master
Update to latest
Diffstat (limited to 'MediaBrowser.Api/SystemService.cs')
| -rw-r--r-- | MediaBrowser.Api/SystemService.cs | 90 |
1 files changed, 0 insertions, 90 deletions
diff --git a/MediaBrowser.Api/SystemService.cs b/MediaBrowser.Api/SystemService.cs deleted file mode 100644 index 2f0741434..000000000 --- a/MediaBrowser.Api/SystemService.cs +++ /dev/null @@ -1,90 +0,0 @@ -using MediaBrowser.Controller; -using MediaBrowser.Model.System; -using ServiceStack; -using System.Threading.Tasks; - -namespace MediaBrowser.Api -{ - /// <summary> - /// Class GetSystemInfo - /// </summary> - [Route("/System/Info", "GET", Summary = "Gets information about the server")] - public class GetSystemInfo : IReturn<SystemInfo> - { - - } - - /// <summary> - /// Class RestartApplication - /// </summary> - [Route("/System/Restart", "POST", Summary = "Restarts the application, if needed")] - public class RestartApplication - { - } - - [Route("/System/Shutdown", "POST", Summary = "Shuts down the application")] - public class ShutdownApplication - { - } - - /// <summary> - /// Class SystemInfoService - /// </summary> - public class SystemService : BaseApiService - { - /// <summary> - /// The _app host - /// </summary> - private readonly IServerApplicationHost _appHost; - - - /// <summary> - /// Initializes a new instance of the <see cref="SystemService" /> class. - /// </summary> - /// <param name="appHost">The app host.</param> - /// <exception cref="System.ArgumentNullException">jsonSerializer</exception> - public SystemService(IServerApplicationHost appHost) - { - _appHost = appHost; - } - - /// <summary> - /// Gets the specified request. - /// </summary> - /// <param name="request">The request.</param> - /// <returns>System.Object.</returns> - public object Get(GetSystemInfo request) - { - var result = _appHost.GetSystemInfo(); - - return ToOptimizedResult(result); - } - - /// <summary> - /// Posts the specified request. - /// </summary> - /// <param name="request">The request.</param> - public void Post(RestartApplication request) - { - Task.Run(async () => - { - await Task.Delay(100).ConfigureAwait(false); - await _appHost.Restart().ConfigureAwait(false); - }); - } - - /// <summary> - /// Posts the specified request. - /// </summary> - /// <param name="request">The request.</param> - public void Post(ShutdownApplication request) - { - Task.Run(async () => - { - await Task.Delay(100).ConfigureAwait(false); - await _appHost.Shutdown().ConfigureAwait(false); - }); - } - - } -} |
