Class HealthEndpoint
- Namespace
- Steeltoe.Management.Endpoint.Health
- Assembly
- Steeltoe.Management.EndpointBase.dll
public class HealthEndpoint : AbstractEndpoint<HealthEndpointResponse, ISecurityContext>, IEndpoint<HealthEndpointResponse, ISecurityContext>, IEndpoint, IHealthEndpoint
- Inheritance
-
HealthEndpoint
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
HealthEndpoint(IHealthOptions, IHealthAggregator, IEnumerable<IHealthContributor>, ILogger<HealthEndpoint>)
public HealthEndpoint(IHealthOptions options, IHealthAggregator aggregator, IEnumerable<IHealthContributor> contributors, ILogger<HealthEndpoint> logger = null)
Parameters
optionsIHealthOptionsaggregatorIHealthAggregatorcontributorsIEnumerable<IHealthContributor>loggerILogger<HealthEndpoint>
Properties
Options
public IHealthOptions Options { get; }
Property Value
Methods
BuildHealth(ISecurityContext)
protected virtual HealthEndpointResponse BuildHealth(ISecurityContext securityContext)
Parameters
securityContextISecurityContext
Returns
GetFilteredContributorList(string, IList<IHealthContributor>)
Filter out health contributors that do not belong to the requested group
protected IList<IHealthContributor> GetFilteredContributorList(string requestedGroup, IList<IHealthContributor> contributors)
Parameters
requestedGroupstringName of group from request
contributorsIList<IHealthContributor>Full list of IHealthContributors
Returns
- IList<IHealthContributor>
If the group is configured, returns health contributors that belong to the group.
If group can't be parsed or is not configured, returns all health contributors.
GetRequestedHealthGroup(ISecurityContext)
Returns the last value returned by GetRequestComponents(), expected to be the name of a configured health group
protected string GetRequestedHealthGroup(ISecurityContext securityContext)
Parameters
securityContextISecurityContextLast value of GetRequestComponents() is used as group name
Returns
GetStatusCode(HealthCheckResult)
public int GetStatusCode(HealthCheckResult health)
Parameters
healthHealthCheckResult
Returns
Invoke(ISecurityContext)
public override HealthEndpointResponse Invoke(ISecurityContext securityContext)
Parameters
securityContextISecurityContext