All Verbs | /health |
---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
public static class HealthCheckRequest
{
}
@DataContract
public static class HealthReport
{
@DataMember
public IReadOnlyDictionary<String, HealthReportEntry> entries = null;
@DataMember
public HealthStatus applicationStatus = null;
@DataMember
public TimeSpan duration = null;
public IReadOnlyDictionary<String, HealthReportEntry> getEntries() { return entries; }
public HealthReport setEntries(IReadOnlyDictionary<String, HealthReportEntry> value) { this.entries = value; return this; }
public HealthStatus getApplicationStatus() { return applicationStatus; }
public HealthReport setApplicationStatus(HealthStatus value) { this.applicationStatus = value; return this; }
public TimeSpan getDuration() { return duration; }
public HealthReport setDuration(TimeSpan value) { this.duration = value; return this; }
}
@DataContract
public static class HealthReportEntry
{
@DataMember
public HealthStatus status = null;
@DataMember
public String description = null;
@DataMember
public TimeSpan duration = null;
@DataMember
public Exception exception = null;
@DataMember
public IReadOnlyDictionary<String, Object> data = null;
public HealthStatus getStatus() { return status; }
public HealthReportEntry setStatus(HealthStatus value) { this.status = value; return this; }
public String getDescription() { return description; }
public HealthReportEntry setDescription(String value) { this.description = value; return this; }
public TimeSpan getDuration() { return duration; }
public HealthReportEntry setDuration(TimeSpan value) { this.duration = value; return this; }
public Exception getException() { return exception; }
public HealthReportEntry setException(Exception value) { this.exception = value; return this; }
public IReadOnlyDictionary<String, Object> getData() { return data; }
public HealthReportEntry setData(IReadOnlyDictionary<String, Object> value) { this.data = value; return this; }
}
@Flags()
@DataContract
public static enum HealthStatus
{
@SerializedName("0") Healthy(0),
@SerializedName("4") Degraded(4),
@SerializedName("8") Unhealthy(8);
private final int value;
HealthStatus(final int intValue) { value = intValue; }
public int getValue() { return value; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
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: text/csv
Content-Type: text/csv
Content-Length: length
{}
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {Unable to show example output for type 'HealthReport' using the custom 'csv' filter}No parameterless constructor defined for this object.