CoreService

<back to all web services

GetHealth

Common - Requests

Checks the services health

The following routes are available for this service:
All Verbs/healthz
All Verbs/api/healthz
import 'package:servicestack/servicestack.dart';

class ServiceHealthDto implements IConvertible
{
    // @ApiMember(DataType="string", IsRequired=true, ParameterType="body", Verb="GET")
    String status = "";

    // @ApiMember(DataType="Dictionary<string, string>", IsRequired=true, ParameterType="body", Verb="GET")
    Map<String,String?>? additionalData;

    ServiceHealthDto({this.status,this.additionalData});
    ServiceHealthDto.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        status = json['status'];
        additionalData = JsonConverters.fromJson(json['additionalData'],'Map<String,String?>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'status': status,
        'additionalData': JsonConverters.toJson(additionalData,'Map<String,String?>',context!)
    };

    getTypeName() => "ServiceHealthDto";
    TypeContext? context = _ctx;
}

/**
* Checks the services health
*/
// @Api(Description="Checks the services health")
// @ApiResponse(Description="Service healthy", IsDefaultResponse=true, StatusCode=200)
// @ApiResponse(Description="Service not healthy", StatusCode=503)
class GetHealth implements IGet, IConvertible
{
    GetHealth();
    GetHealth.fromJson(Map<String, dynamic> json) : super();
    fromMap(Map<String, dynamic> json) {
        return this;
    }

    Map<String, dynamic> toJson() => {};
    getTypeName() => "GetHealth";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'duneframework.com', types: <String, TypeInfo> {
    'ServiceHealthDto': TypeInfo(TypeOf.Class, create:() => ServiceHealthDto()),
    'Map<String,String?>': TypeInfo(TypeOf.Class, create:() => Map<String,String?>()),
    'GetHealth': TypeInfo(TypeOf.Class, create:() => GetHealth()),
});

Dart GetHealth DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /healthz HTTP/1.1 
Host: core.starburst.svc 
Accept: application/json
Content-Type: application/json
Content-Length: length

{}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"status":"String","additionalData":null}