2020-05-26 18:50:32 +02:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Runtime.Serialization;
|
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
2020-05-27 08:19:48 +02:00
|
|
|
|
using Umbraco.Core;
|
2020-05-26 18:50:32 +02:00
|
|
|
|
using Umbraco.Web.BackOffice.Filters;
|
2020-05-27 08:19:48 +02:00
|
|
|
|
using Umbraco.Web.Common.Attributes;
|
2020-05-26 18:50:32 +02:00
|
|
|
|
using Umbraco.Web.Common.Controllers;
|
2018-12-14 11:28:00 +00:00
|
|
|
|
|
2020-05-26 18:50:32 +02:00
|
|
|
|
namespace Umbraco.Web.BackOffice.Controllers
|
2018-12-14 11:28:00 +00:00
|
|
|
|
{
|
2020-05-27 08:19:48 +02:00
|
|
|
|
[PluginController(Constants.Web.Mvc.BackOfficeApiArea)]
|
|
|
|
|
|
[IsBackOffice]
|
2018-12-14 11:28:00 +00:00
|
|
|
|
public class KeepAliveController : UmbracoApiController
|
|
|
|
|
|
{
|
2019-01-23 12:34:41 +01:00
|
|
|
|
[OnlyLocalRequests]
|
2018-12-14 11:28:00 +00:00
|
|
|
|
[HttpGet]
|
|
|
|
|
|
public KeepAlivePingResult Ping()
|
|
|
|
|
|
{
|
|
|
|
|
|
return new KeepAlivePingResult
|
|
|
|
|
|
{
|
|
|
|
|
|
Success = true,
|
|
|
|
|
|
Message = "I'm alive!"
|
|
|
|
|
|
};
|
2018-12-20 13:27:57 +01:00
|
|
|
|
}
|
2018-12-14 11:28:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2020-05-26 18:50:32 +02:00
|
|
|
|
|
2018-12-14 11:28:00 +00:00
|
|
|
|
public class KeepAlivePingResult
|
|
|
|
|
|
{
|
|
|
|
|
|
[DataMember(Name = "success")]
|
|
|
|
|
|
public bool Success { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[DataMember(Name = "message")]
|
|
|
|
|
|
public string Message { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|