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
options
IHealthOptionsaggregator
IHealthAggregatorcontributors
IEnumerable<IHealthContributor>logger
ILogger<HealthEndpoint>
Properties
Options
public IHealthOptions Options { get; }
Property Value
Methods
BuildHealth(ISecurityContext)
protected virtual HealthEndpointResponse BuildHealth(ISecurityContext securityContext)
Parameters
securityContext
ISecurityContext
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
requestedGroup
stringName of group from request
contributors
IList<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
securityContext
ISecurityContextLast value of GetRequestComponents() is used as group name
Returns
GetStatusCode(HealthCheckResult)
public int GetStatusCode(HealthCheckResult health)
Parameters
health
HealthCheckResult
Returns
Invoke(ISecurityContext)
public override HealthEndpointResponse Invoke(ISecurityContext securityContext)
Parameters
securityContext
ISecurityContext