UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

76 lines • 2.77 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from "../../../core/resource.mjs"; import * as TopAPI from "./top.mjs"; import { BaseTop, Top, } from "./top.mjs"; import { path } from "../../../internal/utils/path.mjs"; export var BaseNetFlows = /* @__PURE__ */ (() => { class BaseNetFlows extends APIResource { /** * Retrieves the distribution of network traffic (NetFlows) by HTTP vs other * protocols. * * @deprecated Use [Get Network Traffic Distribution By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/netflows/methods/summary_v2/) instead. */ summary(query = {}, options) { return this._client.get('/radar/netflows/summary', { query, ...options })._thenUnwrap((obj) => obj.result); } /** * Retrieves the distribution of network traffic (NetFlows) by the specified * dimension. * * @example * ```ts * const response = await client.radar.netFlows.summaryV2( * 'ADM1', * ); * ``` */ summaryV2(dimension, query = {}, options) { return this._client.get(path `/radar/netflows/summary/${dimension}`, { query, ...options })._thenUnwrap((obj) => obj.result); } /** * Retrieves network traffic (NetFlows) over time. * * @example * ```ts * const response = await client.radar.netFlows.timeseries(); * ``` */ timeseries(query = {}, options) { return this._client.get('/radar/netflows/timeseries', { query, ...options })._thenUnwrap((obj) => obj.result); } /** * Retrieves the distribution of NetFlows traffic, grouped by the specified * dimension over time. * * @example * ```ts * const response = * await client.radar.netFlows.timeseriesGroups('ADM1'); * ``` */ timeseriesGroups(dimension, query = {}, options) { return this._client.get(path `/radar/netflows/timeseries_groups/${dimension}`, { query, ...options, })._thenUnwrap((obj) => obj.result); } } BaseNetFlows._key = Object.freeze([ 'radar', 'netFlows', ]); return BaseNetFlows; })(); export var NetFlows = /* @__PURE__ */ (() => { class NetFlows extends BaseNetFlows { constructor() { super(...arguments); this.top = new TopAPI.Top(this._client); } } NetFlows.Top = Top; NetFlows.BaseTop = BaseTop; return NetFlows; })(); //# sourceMappingURL=netflows.mjs.map