Files
duplicati/Duplicati/WebserverCore/Endpoints/V1/ProgressState.cs
T

23 lines
620 B
C#
Raw Normal View History

2024-06-07 15:56:43 +02:00
using Duplicati.Library.RestAPI;
using Duplicati.WebserverCore.Abstractions;
using Duplicati.WebserverCore.Exceptions;
namespace Duplicati.WebserverCore.Endpoints.V1;
public class ProgressState : IEndpointV1
{
public static void Map(RouteGroupBuilder group)
{
2024-06-19 13:54:10 +02:00
group.MapGet("/progressstate", Execute)
.RequireAuthorization();
2024-06-07 15:56:43 +02:00
}
private static Server.Serialization.Interface.IProgressEventData Execute()
{
if (FIXMEGlobal.GenerateProgressState == null)
throw new NotFoundException("No active backup");
return FIXMEGlobal.GenerateProgressState();
}
}