UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

87 lines • 3.1 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from "../../../../core/resource.mjs"; import * as PathsAPI from "./paths.mjs"; import { BasePaths, Paths } from "./paths.mjs"; import * as UpstreamsAPI from "./upstreams.mjs"; import { BaseUpstreams, Upstreams } from "./upstreams.mjs"; export var BaseRoutes = /* @__PURE__ */ (() => { class BaseRoutes extends APIResource { /** * Retrieves all ASes in the current global routing tables with routing statistics. * * @example * ```ts * const response = await client.radar.bgp.routes.ases(); * ``` */ ases(query = {}, options) { return this._client.get('/radar/bgp/routes/ases', { query, ...options })._thenUnwrap((obj) => obj.result); } /** * Retrieves all Multi-Origin AS (MOAS) prefixes in the global routing tables. * * @example * ```ts * const response = await client.radar.bgp.routes.moas(); * ``` */ moas(query = {}, options) { return this._client.get('/radar/bgp/routes/moas', { query, ...options })._thenUnwrap((obj) => obj.result); } /** * Retrieves the prefix-to-ASN mapping from global routing tables. * * @example * ```ts * const response = await client.radar.bgp.routes.pfx2as(); * ``` */ pfx2as(query = {}, options) { return this._client.get('/radar/bgp/routes/pfx2as', { query, ...options })._thenUnwrap((obj) => obj.result); } /** * Retrieves real-time BGP routes for a prefix, using public real-time data * collectors (RouteViews and RIPE RIS). * * @example * ```ts * const response = await client.radar.bgp.routes.realtime(); * ``` */ realtime(query = {}, options) { return this._client.get('/radar/bgp/routes/realtime', { query, ...options })._thenUnwrap((obj) => obj.result); } /** * Retrieves the BGP routing table stats. * * @example * ```ts * const response = await client.radar.bgp.routes.stats(); * ``` */ stats(query = {}, options) { return this._client.get('/radar/bgp/routes/stats', { query, ...options })._thenUnwrap((obj) => obj.result); } } BaseRoutes._key = Object.freeze([ 'radar', 'bgp', 'routes', ]); return BaseRoutes; })(); export var Routes = /* @__PURE__ */ (() => { class Routes extends BaseRoutes { constructor() { super(...arguments); this.upstreams = new UpstreamsAPI.Upstreams(this._client); this.paths = new PathsAPI.Paths(this._client); } } Routes.Upstreams = Upstreams; Routes.BaseUpstreams = BaseUpstreams; Routes.Paths = Paths; Routes.BasePaths = BasePaths; return Routes; })(); //# sourceMappingURL=routes.mjs.map