bunny-client
Version:
TypeScript API Client for BunnyCDN 🐰
64 lines • 2.51 kB
TypeScript
export interface Statistics {
AverageOriginResponseTime: number;
BandwidthCachedChart: Record<string, number>;
BandwidthUsedChart: Record<string, number>;
CacheHitRate: number;
CacheHitRateChart: Record<string, number>;
Error3xxChart: Record<string, number>;
Error4xxChart: Record<string, number>;
Error5xxChart: Record<string, number>;
GeoTrafficDistribution: any;
OriginResponseTimeChart: Record<string, number>;
OriginShieldBandwidthUsedChart: Record<string, number>;
OriginShieldInternalBandwidthUsedChart: Record<string, number>;
OriginTrafficChart: Record<string, number>;
PullRequestsPulledChart: Record<string, number>;
RequestsServedChart: Record<string, number>;
TotalBandwidthUsed: number;
TotalOriginTraffic: number;
TotalRequestsServed: number;
UserBalanceHistoryChart: Record<string, number>;
}
export interface GetStatisticsRequest {
/**
* User-specific [API Key](https://dash.bunny.net/account/settings)
* @example "cb1a7c68-89a0-462a-9495-13ebd7366cfe"
*/
apiKey?: string;
/**
* The ISO 8601 start date of the statistics. If no value is passed, the last 30 days will be returned.
* @example "2023-04-27T00:00:00Z"
*/
dateFrom?: string;
/**
* The ISO 8601 end date of the statistics. If no value is passed, the last 30 days will be returned.
* @example "2023-04-28T00:00:00Z"
*/
dateTo?: string;
/**
* If true, the statistics data will be returned in hourly grouping.
* @example false
*/
hourly?: boolean;
/**
* If set, the respose will contain the non-2xx response
* @example false
*/
loadErrors?: boolean;
/**
* If set, the statistics will be only returned for the given Pull Zone
*/
pullZone?: number;
/**
* If set, the statistics will be only returned for the given region ID
*/
serverZoneId?: number;
}
export type GetStatisticsResponse = Statistics;
export declare const getStatistics: import("untypeable/dist/client-ca591958").g<GetStatisticsRequest, Statistics>;
export declare const getStatisticsEndpoints: {
readonly "GET /statistics": "GET /statistics";
readonly getStatistics: "getStatistics";
};
export declare function getStatisticsClient(defaultRequestInit: RequestInit, { apiKey, dateFrom, dateTo, hourly, loadErrors, pullZone, serverZoneId, }?: GetStatisticsRequest): Promise<GetStatisticsResponse>;
//# sourceMappingURL=getStatistics.d.ts.map