using Oqtane.Models; using System.Threading.Tasks; using System.Net.Http; using Oqtane.Documentation; using Oqtane.Shared; namespace Oqtane.Services { [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class InstallationService : ServiceBase, IInstallationService { private readonly SiteState _siteState; public InstallationService(HttpClient http, SiteState siteState) : base(http) { _siteState = siteState; } private string ApiUrl => CreateApiUrl("Installation", null); // tenant agnostic as SiteState does not exist public async Task IsInstalled() { return await GetJsonAsync($"{ApiUrl}/installed"); } public async Task Install(InstallConfig config) { return await PostJsonAsync(ApiUrl, config); } public async Task Upgrade() { return await GetJsonAsync($"{ApiUrl}/upgrade"); } public async Task RestartAsync() { await PostAsync($"{ApiUrl}/restart"); } } }