App_Features_Service

<back to all web services

HealthCheckRequest

The following routes are available for this service:
GET/healthcheckThe 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()),
});

Dart HealthCheckRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

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: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"ServerState":{"ServerName":"String","TotalRamInMb":0,"AvailableRamInMb":0,"UsedCpuPercent":0},"Status":"Success","StatusMessage":"String","CorrelationId":"String","FailedMonitorCount":0,"MonitorSummaries":[{"MonitorName":"String","Status":"Success","Results":[{"MonitoringName":"String","Status":"Success","StatusMessage":"String","ErrorMessages":["String"]}],"ErrorMessages":["String"]}],"ExecutionMetrics":{"StartDateTime":"\/Date(-62135596800000-0000)\/","EndDateTime":"\/Date(-62135596800000-0000)\/","Duration":"PT0S"}}