Update API Docs

This commit is contained in:
Qstick 2022-12-03 23:17:34 -06:00
parent 7e48ea0231
commit 859e48ff5c
4 changed files with 191 additions and 5 deletions

View File

@ -55,9 +55,9 @@ namespace Sonarr.Api.V3.System
[HttpGet("status")]
[Produces("application/json")]
public object GetStatus()
public SystemResource GetStatus()
{
return new
return new SystemResource
{
AppName = BuildInfo.AppName,
InstanceName = _configFileProvider.InstanceName,

View File

@ -0,0 +1,41 @@
using System;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Core.Authentication;
using NzbDrone.Core.Update;
namespace Sonarr.Api.V3.System
{
public class SystemResource
{
public string AppName { get; set; }
public string InstanceName { get; set; }
public string Version { get; set; }
public DateTime BuildTime { get; set; }
public bool IsDebug { get; set; }
public bool IsProduction { get; set; }
public bool IsAdmin { get; set; }
public bool IsUserInteractive { get; set; }
public string StartupPath { get; set; }
public string AppData { get; set; }
public string OsName { get; set; }
public string OsVersion { get; set; }
public bool IsNetCore { get; set; }
public bool IsLinux { get; set; }
public bool IsOsx { get; set; }
public bool IsWindows { get; set; }
public bool IsDocker { get; set; }
public RuntimeMode Mode { get; set; }
public string Branch { get; set; }
public AuthenticationType Authentication { get; set; }
public Version SqliteVersion { get; set; }
public int MigrationVersion { get; set; }
public string UrlBase { get; set; }
public Version RuntimeVersion { get; set; }
public string RuntimeName { get; set; }
public DateTime StartTime { get; set; }
public string PackageVersion { get; set; }
public string PackageAuthor { get; set; }
public UpdateMechanism PackageUpdateMechanism { get; set; }
public string PackageUpdateMechanismMessage { get; set; }
}
}

View File

@ -4471,7 +4471,14 @@
],
"responses": {
"200": {
"description": "Success"
"description": "Success",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PingResource"
}
}
}
}
}
}
@ -6236,7 +6243,14 @@
],
"responses": {
"200": {
"description": "Success"
"description": "Success",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SystemResource"
}
}
}
}
}
}
@ -9200,6 +9214,16 @@
},
"additionalProperties": false
},
"PingResource": {
"type": "object",
"properties": {
"status": {
"type": "string",
"nullable": true
}
},
"additionalProperties": false
},
"PrivacyLevel": {
"enum": [
"normal",
@ -10023,6 +10047,14 @@
},
"additionalProperties": false
},
"RuntimeMode": {
"enum": [
"console",
"service",
"tray"
],
"type": "string"
},
"SeasonPassResource": {
"type": "object",
"properties": {
@ -10478,6 +10510,118 @@
],
"type": "string"
},
"SystemResource": {
"type": "object",
"properties": {
"appName": {
"type": "string",
"nullable": true
},
"instanceName": {
"type": "string",
"nullable": true
},
"version": {
"type": "string",
"nullable": true
},
"buildTime": {
"type": "string",
"format": "date-time"
},
"isDebug": {
"type": "boolean"
},
"isProduction": {
"type": "boolean"
},
"isAdmin": {
"type": "boolean"
},
"isUserInteractive": {
"type": "boolean"
},
"startupPath": {
"type": "string",
"nullable": true
},
"appData": {
"type": "string",
"nullable": true
},
"osName": {
"type": "string",
"nullable": true
},
"osVersion": {
"type": "string",
"nullable": true
},
"isNetCore": {
"type": "boolean"
},
"isLinux": {
"type": "boolean"
},
"isOsx": {
"type": "boolean"
},
"isWindows": {
"type": "boolean"
},
"isDocker": {
"type": "boolean"
},
"mode": {
"$ref": "#/components/schemas/RuntimeMode"
},
"branch": {
"type": "string",
"nullable": true
},
"authentication": {
"$ref": "#/components/schemas/AuthenticationType"
},
"sqliteVersion": {
"$ref": "#/components/schemas/Version"
},
"migrationVersion": {
"type": "integer",
"format": "int32"
},
"urlBase": {
"type": "string",
"nullable": true
},
"runtimeVersion": {
"$ref": "#/components/schemas/Version"
},
"runtimeName": {
"type": "string",
"nullable": true
},
"startTime": {
"type": "string",
"format": "date-time"
},
"packageVersion": {
"type": "string",
"nullable": true
},
"packageAuthor": {
"type": "string",
"nullable": true
},
"packageUpdateMechanism": {
"$ref": "#/components/schemas/UpdateMechanism"
},
"packageUpdateMechanismMessage": {
"type": "string",
"nullable": true
}
},
"additionalProperties": false
},
"TagDetailsResource": {
"type": "object",
"properties": {

View File

@ -16,7 +16,8 @@ namespace NzbDrone.Http
}
[HttpGet("/ping")]
public IActionResult GetStatus()
[Produces("application/json")]
public ActionResult<PingResource> GetStatus()
{
try
{