mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-14 17:13:49 -07:00
added /system/status end point that returns environment information.
This commit is contained in:
parent
a0162d52f9
commit
a36216c73c
3 changed files with 39 additions and 1 deletions
37
NzbDrone.Api/System/SystemModule.cs
Normal file
37
NzbDrone.Api/System/SystemModule.cs
Normal file
|
@ -0,0 +1,37 @@
|
|||
using Nancy;
|
||||
using NzbDrone.Common;
|
||||
using NzbDrone.Api.Extensions;
|
||||
|
||||
namespace NzbDrone.Api.System
|
||||
{
|
||||
public class SystemModule : NzbDroneApiModule
|
||||
{
|
||||
private readonly IEnvironmentProvider _environmentProvider;
|
||||
|
||||
public SystemModule(IEnvironmentProvider environmentProvider)
|
||||
: base("system")
|
||||
{
|
||||
_environmentProvider = environmentProvider;
|
||||
Get["/status"] = x => GetStatus();
|
||||
}
|
||||
|
||||
private Response GetStatus()
|
||||
{
|
||||
return new
|
||||
{
|
||||
Version = _environmentProvider.Version,
|
||||
AppData = _environmentProvider.GetAppDataPath(),
|
||||
IsAdmin = _environmentProvider.IsAdmin,
|
||||
IsUserInteractive = _environmentProvider.IsUserInteractive,
|
||||
BuildTime = _environmentProvider.BuildDateTime,
|
||||
StartupPath = _environmentProvider.StartUpPath,
|
||||
OsVersion = _environmentProvider.GetOsVersion(),
|
||||
IsMono = EnvironmentProvider.IsMono,
|
||||
IsProduction = EnvironmentProvider.IsProduction,
|
||||
IsDebug = EnvironmentProvider.IsDebug,
|
||||
IsLinux = EnvironmentProvider.IsLinux
|
||||
}.AsResponse();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue