GET | /healthcheck | The request for getting health check information. | Depending on the execution mode, you can determine different states of the server. |
---|
import 'package:servicestack/servicestack.dart';
class ServerState implements IConvertible
{
String? ServerName;
double? TotalRamInMb;
double? AvailableRamInMb;
double? UsedCpuPercent;
ServerState({this.ServerName,this.TotalRamInMb,this.AvailableRamInMb,this.UsedCpuPercent});
ServerState.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ServerName = json['ServerName'];
TotalRamInMb = JsonConverters.toDouble(json['TotalRamInMb']);
AvailableRamInMb = JsonConverters.toDouble(json['AvailableRamInMb']);
UsedCpuPercent = JsonConverters.toDouble(json['UsedCpuPercent']);
return this;
}
Map<String, dynamic> toJson() => {
'ServerName': ServerName,
'TotalRamInMb': TotalRamInMb,
'AvailableRamInMb': AvailableRamInMb,
'UsedCpuPercent': UsedCpuPercent
};
getTypeName() => "ServerState";
TypeContext? context = _ctx;
}
enum MonitoringStatus
{
Success,
Failure,
}
class MonitoringResult implements IConvertible
{
String? MonitoringName;
MonitoringStatus? Status;
String? StatusMessage;
List<String>? ErrorMessages;
MonitoringResult({this.MonitoringName,this.Status,this.StatusMessage,this.ErrorMessages});
MonitoringResult.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
MonitoringName = json['MonitoringName'];
Status = JsonConverters.fromJson(json['Status'],'MonitoringStatus',context!);
StatusMessage = json['StatusMessage'];
ErrorMessages = JsonConverters.fromJson(json['ErrorMessages'],'List<String>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'MonitoringName': MonitoringName,
'Status': JsonConverters.toJson(Status,'MonitoringStatus',context!),
'StatusMessage': StatusMessage,
'ErrorMessages': JsonConverters.toJson(ErrorMessages,'List<String>',context!)
};
getTypeName() => "MonitoringResult";
TypeContext? context = _ctx;
}
class MonitorSummary implements IConvertible
{
String? MonitorName;
MonitoringStatus? Status;
List<MonitoringResult>? Results;
List<String>? ErrorMessages;
MonitorSummary({this.MonitorName,this.Status,this.Results,this.ErrorMessages});
MonitorSummary.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
MonitorName = json['MonitorName'];
Status = JsonConverters.fromJson(json['Status'],'MonitoringStatus',context!);
Results = JsonConverters.fromJson(json['Results'],'List<MonitoringResult>',context!);
ErrorMessages = JsonConverters.fromJson(json['ErrorMessages'],'List<String>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'MonitorName': MonitorName,
'Status': JsonConverters.toJson(Status,'MonitoringStatus',context!),
'Results': JsonConverters.toJson(Results,'List<MonitoringResult>',context!),
'ErrorMessages': JsonConverters.toJson(ErrorMessages,'List<String>',context!)
};
getTypeName() => "MonitorSummary";
TypeContext? context = _ctx;
}
class MonitorExecutionMetrics implements IConvertible
{
DateTime? StartDateTime;
DateTime? EndDateTime;
Duration? Duration;
MonitorExecutionMetrics({this.StartDateTime,this.EndDateTime,this.Duration});
MonitorExecutionMetrics.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
StartDateTime = JsonConverters.fromJson(json['StartDateTime'],'DateTime',context!);
EndDateTime = JsonConverters.fromJson(json['EndDateTime'],'DateTime',context!);
Duration = JsonConverters.fromJson(json['Duration'],'Duration',context!);
return this;
}
Map<String, dynamic> toJson() => {
'StartDateTime': JsonConverters.toJson(StartDateTime,'DateTime',context!),
'EndDateTime': JsonConverters.toJson(EndDateTime,'DateTime',context!),
'Duration': JsonConverters.toJson(Duration,'Duration',context!)
};
getTypeName() => "MonitorExecutionMetrics";
TypeContext? context = _ctx;
}
class HealthCheckResponse implements IConvertible
{
ServerState? ServerState;
MonitoringStatus? Status;
String? StatusMessage;
String? CorrelationId;
int? FailedMonitorCount;
List<MonitorSummary>? MonitorSummaries;
MonitorExecutionMetrics? ExecutionMetrics;
HealthCheckResponse({this.ServerState,this.Status,this.StatusMessage,this.CorrelationId,this.FailedMonitorCount,this.MonitorSummaries,this.ExecutionMetrics});
HealthCheckResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ServerState = JsonConverters.fromJson(json['ServerState'],'ServerState',context!);
Status = JsonConverters.fromJson(json['Status'],'MonitoringStatus',context!);
StatusMessage = json['StatusMessage'];
CorrelationId = json['CorrelationId'];
FailedMonitorCount = json['FailedMonitorCount'];
MonitorSummaries = JsonConverters.fromJson(json['MonitorSummaries'],'List<MonitorSummary>',context!);
ExecutionMetrics = JsonConverters.fromJson(json['ExecutionMetrics'],'MonitorExecutionMetrics',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ServerState': JsonConverters.toJson(ServerState,'ServerState',context!),
'Status': JsonConverters.toJson(Status,'MonitoringStatus',context!),
'StatusMessage': StatusMessage,
'CorrelationId': CorrelationId,
'FailedMonitorCount': FailedMonitorCount,
'MonitorSummaries': JsonConverters.toJson(MonitorSummaries,'List<MonitorSummary>',context!),
'ExecutionMetrics': JsonConverters.toJson(ExecutionMetrics,'MonitorExecutionMetrics',context!)
};
getTypeName() => "HealthCheckResponse";
TypeContext? context = _ctx;
}
enum ExecutionMode
{
Basic,
Standard,
Advanced,
}
enum ServerType
{
App,
Sql,
FtpApi,
Ftp,
Batch,
Identity,
Qc,
XcodeV,
XcodeC,
MsgVast,
AsgVast,
Mongo,
Agents,
}
class HealthCheckRequest implements IConvertible
{
/**
* The mode used to determine what level of health check to perform.
*/
// @ApiMember(DataType="ExecutionMode", Description="The mode used to determine what level of health check to perform.", IsRequired=true, ParameterType="query")
ExecutionMode? ExecutionMode;
/**
* The type of server that will be used to determine which monitors will be run.
*/
// @ApiMember(DataType="ServerType", Description="The type of server that will be used to determine which monitors will be run.", IsRequired=true, ParameterType="query")
ServerType? ServerType;
/**
* Indicates whether or not to include server state information in the response.
*/
// @ApiMember(DataType="boolean", Description="Indicates whether or not to include server state information in the response.", ParameterType="query")
bool? IncludeServerStateInformation;
/**
* Indicates whether or not to suppress returning error codes. This will always return a 200 code to the caller, which is required for PRTG to process the JSON response properly.
*/
// @ApiMember(DataType="boolean", Description="Indicates whether or not to suppress returning error codes. This will always return a 200 code to the caller, which is required for PRTG to process the JSON response properly.", ParameterType="query")
bool? SuppressErrorCodes;
/**
* Indicates whether or not to suppress deployment-related errors.
*/
// @ApiMember(DataType="boolean", Description="Indicates whether or not to suppress deployment-related errors.", ParameterType="query")
bool? SuppressDeploymentErrors;
HealthCheckRequest({this.ExecutionMode,this.ServerType,this.IncludeServerStateInformation,this.SuppressErrorCodes,this.SuppressDeploymentErrors});
HealthCheckRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ExecutionMode = JsonConverters.fromJson(json['ExecutionMode'],'ExecutionMode',context!);
ServerType = JsonConverters.fromJson(json['ServerType'],'ServerType',context!);
IncludeServerStateInformation = json['IncludeServerStateInformation'];
SuppressErrorCodes = json['SuppressErrorCodes'];
SuppressDeploymentErrors = json['SuppressDeploymentErrors'];
return this;
}
Map<String, dynamic> toJson() => {
'ExecutionMode': JsonConverters.toJson(ExecutionMode,'ExecutionMode',context!),
'ServerType': JsonConverters.toJson(ServerType,'ServerType',context!),
'IncludeServerStateInformation': IncludeServerStateInformation,
'SuppressErrorCodes': SuppressErrorCodes,
'SuppressDeploymentErrors': SuppressDeploymentErrors
};
getTypeName() => "HealthCheckRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: '54.235.149.200', types: <String, TypeInfo> {
'ServerState': TypeInfo(TypeOf.Class, create:() => ServerState()),
'MonitoringStatus': TypeInfo(TypeOf.Enum, enumValues:MonitoringStatus.values),
'MonitoringResult': TypeInfo(TypeOf.Class, create:() => MonitoringResult()),
'MonitorSummary': TypeInfo(TypeOf.Class, create:() => MonitorSummary()),
'List<MonitoringResult>': TypeInfo(TypeOf.Class, create:() => <MonitoringResult>[]),
'MonitorExecutionMetrics': TypeInfo(TypeOf.Class, create:() => MonitorExecutionMetrics()),
'HealthCheckResponse': TypeInfo(TypeOf.Class, create:() => HealthCheckResponse()),
'List<MonitorSummary>': TypeInfo(TypeOf.Class, create:() => <MonitorSummary>[]),
'ExecutionMode': TypeInfo(TypeOf.Enum, enumValues:ExecutionMode.values),
'ServerType': TypeInfo(TypeOf.Enum, enumValues:ServerType.values),
'HealthCheckRequest': TypeInfo(TypeOf.Class, create:() => HealthCheckRequest()),
});
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.
GET /healthcheck HTTP/1.1 Host: 54.235.149.200 Accept: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <HealthCheckResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ExtremeReach.Diagnostics.App.Types"> <CorrelationId>String</CorrelationId> <ExecutionMetrics> <Duration>PT0S</Duration> <EndDateTime>0001-01-01T00:00:00</EndDateTime> <StartDateTime>0001-01-01T00:00:00</StartDateTime> </ExecutionMetrics> <FailedMonitorCount>0</FailedMonitorCount> <MonitorSummaries> <MonitorSummary> <ErrorMessages xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d4p1:string>String</d4p1:string> </ErrorMessages> <MonitorName>String</MonitorName> <Results> <MonitoringResult> <ErrorMessages xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d6p1:string>String</d6p1:string> </ErrorMessages> <MonitoringName>String</MonitoringName> <Status>Success</Status> <StatusMessage>String</StatusMessage> </MonitoringResult> </Results> <Status>Success</Status> </MonitorSummary> </MonitorSummaries> <ServerState> <AvailableRamInMb>0</AvailableRamInMb> <ServerName>String</ServerName> <TotalRamInMb>0</TotalRamInMb> <UsedCpuPercent>0</UsedCpuPercent> </ServerState> <Status>Success</Status> <StatusMessage>String</StatusMessage> </HealthCheckResponse>