| Required role: | TenantReader |
| GET | /api/statistics/summary | Gets statistics like Resources by OsTypes, etc. | |
|---|---|---|---|
| GET | /statistics/summary | Gets statistics like Resources by OsTypes, etc. |
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using CoreService.ServiceModel.Dtos.Statistics.Crud;
using CoreService.ServiceModel.Dtos.Statistics.Responses;
using CoreService.ServiceModel.Interfaces;
using CoreService.ServiceModel.Enums;
namespace CoreService.ServiceModel.Dtos.Statistics.Crud
{
///<summary>
///Gets statistic like Resources by OsTypes, etc.
///</summary>
[Api(Description="Gets statistic like Resources by OsTypes, etc.")]
[ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=typeof(CoreService.ServiceModel.Dtos.Statistics.Responses.StatisticsSummaryDto), StatusCode=200)]
public partial class GetStatisticsSummary
: IBaseRequest, IHasTenantName, IGet
{
[ApiMember(DataType="string", IsRequired=true, ParameterType="header")]
[Validate("NotEmpty")]
public virtual string TenantName { get; set; }
}
}
namespace CoreService.ServiceModel.Dtos.Statistics.Responses
{
public partial class StatisticsSummaryDto
{
public virtual DateTime GeneratedOn { get; set; }
public virtual Dictionary<string, IStatisticsData> Statistics { get; set; } = new();
}
}
namespace CoreService.ServiceModel.Enums
{
public enum StatisticsDataType
{
SingleDatapoint,
SingleDataset,
MultiDataset,
}
}
namespace CoreService.ServiceModel.Interfaces
{
public partial interface IStatisticsData
{
string Name { get; set; }
StatisticsDataType Type { get; set; }
}
}
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}}