2020-12-06 10:46:04 +01:00
|
|
|
// Copyright (c) Umbraco.
|
|
|
|
|
// See LICENSE for more details.
|
|
|
|
|
|
|
|
|
|
using System;
|
2020-10-30 13:56:13 +01:00
|
|
|
using System.Collections.Generic;
|
2021-07-05 14:27:49 +01:00
|
|
|
using System.ComponentModel;
|
2020-10-30 13:56:13 +01:00
|
|
|
using System.Linq;
|
|
|
|
|
|
2021-02-18 11:06:02 +01:00
|
|
|
namespace Umbraco.Cms.Core.Configuration.Models
|
2020-10-30 13:56:13 +01:00
|
|
|
{
|
2020-12-06 10:46:04 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// Typed configuration options for healthcheck notification settings.
|
|
|
|
|
/// </summary>
|
2020-10-30 13:56:13 +01:00
|
|
|
public class HealthChecksNotificationSettings
|
|
|
|
|
{
|
2021-07-05 14:27:49 +01:00
|
|
|
internal const bool StaticEnabled = false;
|
|
|
|
|
internal const string StaticPeriod = "1.00:00:00"; //TimeSpan.FromHours(24);
|
|
|
|
|
|
2020-12-06 10:46:04 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets a value indicating whether health check notifications are enabled.
|
|
|
|
|
/// </summary>
|
2021-07-05 14:27:49 +01:00
|
|
|
[DefaultValue(StaticEnabled)]
|
|
|
|
|
public bool Enabled { get; set; } = StaticEnabled;
|
2020-10-30 13:56:13 +01:00
|
|
|
|
2020-12-06 10:46:04 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets a value for the first run time of a healthcheck notification in crontab format.
|
|
|
|
|
/// </summary>
|
2020-10-30 13:56:13 +01:00
|
|
|
public string FirstRunTime { get; set; } = string.Empty;
|
|
|
|
|
|
2020-12-06 10:46:04 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets a value for the period of the healthcheck notification.
|
|
|
|
|
/// </summary>
|
2021-07-05 14:27:49 +01:00
|
|
|
[DefaultValue(StaticPeriod)]
|
|
|
|
|
public TimeSpan Period { get; set; } = TimeSpan.Parse(StaticPeriod);
|
2020-10-30 13:56:13 +01:00
|
|
|
|
2020-12-06 10:46:04 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets a value for the collection of health check notification methods.
|
|
|
|
|
/// </summary>
|
2020-10-30 13:56:13 +01:00
|
|
|
public IDictionary<string, HealthChecksNotificationMethodSettings> NotificationMethods { get; set; } = new Dictionary<string, HealthChecksNotificationMethodSettings>();
|
|
|
|
|
|
2020-12-06 10:46:04 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets a value for the collection of health checks that are disabled for notifications.
|
|
|
|
|
/// </summary>
|
2020-10-30 13:56:13 +01:00
|
|
|
public IEnumerable<DisabledHealthCheckSettings> DisabledChecks { get; set; } = Enumerable.Empty<DisabledHealthCheckSettings>();
|
|
|
|
|
}
|
|
|
|
|
}
|