Class HealthCheck
Provides a base class for health checks, filling in the healthcheck metadata on construction.
Inheritance
Namespace: Umbraco.Cms.Core.HealthChecks
Assembly: Umbraco.Core.dll
Syntax
[DataContract(Name = "healthCheck", Namespace = "")]
public abstract class HealthCheck : IDiscoverable
Constructors
View SourceHealthCheck()
Initializes a new instance of the HealthCheck class.
Declaration
protected HealthCheck()
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Thrown when the health check does not have a HealthCheckAttribute. |
Properties
View SourceDescription
Gets the description of the health check.
Declaration
[DataMember(Name = "description")]
public string? Description { get; }
Property Value
| Type | Description |
|---|---|
| string |
Group
Gets the group this health check belongs to.
Declaration
[DataMember(Name = "group")]
public string? Group { get; }
Property Value
| Type | Description |
|---|---|
| string |
Id
Gets the unique identifier of the health check.
Declaration
[DataMember(Name = "id")]
public Guid Id { get; }
Property Value
| Type | Description |
|---|---|
| Guid |
Name
Gets the name of the health check.
Declaration
[DataMember(Name = "name")]
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
View SourceExecuteAction(HealthCheckAction)
Executes the action and returns its status.
Declaration
public virtual HealthCheckStatus ExecuteAction(HealthCheckAction action)
Parameters
| Type | Name | Description |
|---|---|---|
| HealthCheckAction | action | The action to execute. |
Returns
| Type | Description |
|---|---|
| HealthCheckStatus | The health check status after executing the action. |
ExecuteActionAsync(HealthCheckAction)
Executes the action asynchronously and returns its status.
Declaration
public virtual Task<HealthCheckStatus> ExecuteActionAsync(HealthCheckAction action)
Parameters
| Type | Name | Description |
|---|---|---|
| HealthCheckAction | action | The action to execute. |
Returns
| Type | Description |
|---|---|
| Task<HealthCheckStatus> | A task that represents the asynchronous operation containing the health check status. |
GetStatusAsync()
Gets the status for this health check.
Declaration
public virtual Task<IEnumerable<HealthCheckStatus>> GetStatusAsync()
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<HealthCheckStatus>> | A task that represents the asynchronous operation containing the collection of health check statuses. |
Remarks
If there are possible actions to take to rectify this check, this method must be overridden by a sub class in order to explicitly provide those actions.