All Verbs | /health |
---|
import Foundation
import ServiceStack
public class HealthCheckRequest : Codable
{
required public init(){}
}
// @DataContract
public class HealthReport : Codable
{
// @DataMember
public var entries:IReadOnlyDictionary<String, HealthReportEntry>?
// @DataMember
public var applicationStatus:HealthStatus?
// @DataMember
@TimeSpan public var duration:TimeInterval?
required public init(){}
}
// @DataContract
public class HealthReportEntry : Codable
{
// @DataMember
public var status:HealthStatus?
// @DataMember
public var Description:String?
// @DataMember
@TimeSpan public var duration:TimeInterval?
// @DataMember
public var exception:Exception?
// @DataMember
public var data:IReadOnlyDictionary<String, Object>?
required public init(){}
}
// @Flags()
// @DataContract
public enum HealthStatus : Int, Codable
{
case Healthy = 0
case Degraded = 4
case Unhealthy = 8
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /health HTTP/1.1
Host: resourcelibrary.api.ashcompanies.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<HealthCheckRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ASH.Services.HealthChecks.ServiceStack" />
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <HealthReport xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ASH.Services.HealthChecks.DTO"> <ApplicationStatus /> <Duration>PT0S</Duration> <Entries i:nil="true" /> </HealthReport>