| Required role: | TenantReader |
| GET | /api/statistics/summary | Gets statistics like Resources by OsTypes, etc. | |
|---|---|---|---|
| GET | /statistics/summary | Gets statistics like Resources by OsTypes, etc. |
import 'package:servicestack/servicestack.dart';
enum StatisticsDataType
{
SingleDatapoint,
SingleDataset,
MultiDataset,
}
abstract class IStatisticsData
{
String name = "";
StatisticsDataType type;
}
class StatisticsSummaryDto implements IConvertible
{
DateTime generatedOn = DateTime(0);
Map<String,IStatisticsData?> statistics = {};
StatisticsSummaryDto({this.generatedOn,this.statistics});
StatisticsSummaryDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
generatedOn = JsonConverters.fromJson(json['generatedOn'],'DateTime',context!);
statistics = JsonConverters.fromJson(json['statistics'],'Map<String,IStatisticsData?>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'generatedOn': JsonConverters.toJson(generatedOn,'DateTime',context!),
'statistics': JsonConverters.toJson(statistics,'Map<String,IStatisticsData?>',context!)
};
getTypeName() => "StatisticsSummaryDto";
TypeContext? context = _ctx;
}
/**
* Gets statistic like Resources by OsTypes, etc.
*/
// @Api(Description="Gets statistic like Resources by OsTypes, etc.")
// @ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=typeof(StatisticsSummaryDto), StatusCode=200)
class GetStatisticsSummary implements IBaseRequest, IHasTenantName, IGet, IConvertible
{
// @ApiMember(DataType="string", IsRequired=true, ParameterType="header")
// @Validate(Validator="NotEmpty")
String tenantName = "";
GetStatisticsSummary({this.tenantName});
GetStatisticsSummary.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
tenantName = json['tenantName'];
return this;
}
Map<String, dynamic> toJson() => {
'tenantName': tenantName
};
getTypeName() => "GetStatisticsSummary";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'duneframework.com', types: <String, TypeInfo> {
'StatisticsDataType': TypeInfo(TypeOf.Enum, enumValues:StatisticsDataType.values),
'IStatisticsData': TypeInfo(TypeOf.Interface),
'StatisticsSummaryDto': TypeInfo(TypeOf.Class, create:() => StatisticsSummaryDto()),
'Map<String,IStatisticsData?>': TypeInfo(TypeOf.Class, create:() => Map<String,IStatisticsData?>()),
'GetStatisticsSummary': TypeInfo(TypeOf.Class, create:() => GetStatisticsSummary()),
});
Dart GetStatisticsSummary 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
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /api/statistics/summary HTTP/1.1 Host: core.starburst.svc Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"generatedOn":"0001-01-01T00:00:00.0000000Z","statistics":{"String":null}}