cloudflare
Version:
The official TypeScript library for the Cloudflare API
85 lines • 2.88 kB
TypeScript
import { APIResource } from "../../../../core/resource.js";
import { APIPromise } from "../../../../core/api-promise.js";
import { RequestOptions } from "../../../../internal/request-options.js";
export declare class BasePaths extends APIResource {
static readonly _key: readonly ['radar', 'bgp', 'routes', 'paths'];
/**
* Retrieves the paths an AS uses to reach the tier-1 clique, derived from
* RouteViews RIB snapshots. Each entry is an ordered AS-path segment (from the
* queried AS toward a tier-1) with the number of observed paths and peers, and the
* collectors that observed it. By default segments are merged across all active
* collectors; pass "collector" to scope to one. The response also includes an
* "asnInfo" map (keyed by ASN) with the name and country for every ASN in the
* returned segments plus the queried ASN (best-effort; null when unavailable).
*
* @example
* ```ts
* const paths = await client.radar.bgp.routes.paths.list(174);
* ```
*/
list(asn: number, query?: PathListParams | null | undefined, options?: RequestOptions): APIPromise<PathListResponse>;
}
export declare class Paths extends BasePaths {
}
export interface PathListResponse {
asnInfo: {
[key: string]: PathListResponse.ASNInfo;
} | null;
collectors: Array<string>;
meta: PathListResponse.Meta;
paths: Array<PathListResponse.Path>;
}
export declare namespace PathListResponse {
interface ASNInfo {
/**
* ASN number.
*/
asn: number;
/**
* Alpha-2 country code.
*/
country: string | null;
/**
* AS name.
*/
name: string | null;
}
interface Meta {
/**
* Timestamp of the underlying RIB data.
*/
dataTime: string | null;
effectiveCollector: string | null;
/**
* Timestamp when the query was executed.
*/
queryTime: string | null;
stale: boolean;
}
interface Path {
collectors: Array<string>;
pathsCount: number;
peersCount: number;
segment: Array<number>;
}
}
export interface PathListParams {
/**
* Scope to a single RouteViews collector (e.g. "route-views3"). Omit to merge
* across all active collectors (identical path segments are deduplicated,
* observation counts summed, and every contributing collector listed).
*/
collector?: string;
/**
* Format in which results will be returned.
*/
format?: 'JSON' | 'CSV';
/**
* Address family of the observed paths. Defaults to IPv4.
*/
ipVersion?: 'IPv4' | 'IPv6';
}
export declare namespace Paths {
export { type PathListResponse as PathListResponse, type PathListParams as PathListParams };
}
//# sourceMappingURL=paths.d.ts.map