UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

234 lines 6.63 kB
import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; import * as ASNsAPI from 'cloudflare/resources/radar/entities/asns'; export declare class ASNs extends APIResource { /** * Gets a list of autonomous systems (AS). */ list(query?: ASNListParams, options?: Core.RequestOptions): Core.APIPromise<ASNListResponse>; list(options?: Core.RequestOptions): Core.APIPromise<ASNListResponse>; /** * Get the requested autonomous system information. A confidence level below `5` * indicates a low level of confidence in the traffic data - normally this happens * because Cloudflare has a small amount of traffic from/to this AS). Population * estimates come from APNIC (refer to https://labs.apnic.net/?p=526). */ get(asn: number, query?: ASNGetParams, options?: Core.RequestOptions): Core.APIPromise<ASNGetResponse>; get(asn: number, options?: Core.RequestOptions): Core.APIPromise<ASNGetResponse>; /** * Get the requested autonomous system information based on IP address. Population * estimates come from APNIC (refer to https://labs.apnic.net/?p=526). */ ip(query: ASNIPParams, options?: Core.RequestOptions): Core.APIPromise<ASNIPResponse>; /** * Get AS-level relationship for given networks. */ rel(asn: number, query?: ASNRelParams, options?: Core.RequestOptions): Core.APIPromise<ASNRelResponse>; rel(asn: number, options?: Core.RequestOptions): Core.APIPromise<ASNRelResponse>; } export interface ASNListResponse { asns: Array<ASNListResponse.ASN>; } export declare namespace ASNListResponse { interface ASN { asn: number; country: string; countryName: string; name: string; aka?: string; /** * Deprecated field. Please use 'aka'. */ nameLong?: string; orgName?: string; website?: string; } } export interface ASNGetResponse { asn: ASNGetResponse.ASN; } export declare namespace ASNGetResponse { interface ASN { asn: number; confidenceLevel: number; country: string; countryName: string; estimatedUsers: ASN.EstimatedUsers; name: string; orgName: string; related: Array<ASN.Related>; /** * Regional Internet Registry */ source: string; website: string; aka?: string; /** * Deprecated field. Please use 'aka'. */ nameLong?: string; } namespace ASN { interface EstimatedUsers { locations: Array<EstimatedUsers.Location>; /** * Total estimated users */ estimatedUsers?: number; } namespace EstimatedUsers { interface Location { locationAlpha2: string; locationName: string; /** * Estimated users per location */ estimatedUsers?: number; } } interface Related { asn: number; name: string; aka?: string; /** * Total estimated users */ estimatedUsers?: number; } } } export interface ASNIPResponse { asn: ASNIPResponse.ASN; } export declare namespace ASNIPResponse { interface ASN { asn: number; country: string; countryName: string; estimatedUsers: ASN.EstimatedUsers; name: string; orgName: string; related: Array<ASN.Related>; /** * Regional Internet Registry */ source: string; website: string; aka?: string; /** * Deprecated field. Please use 'aka'. */ nameLong?: string; } namespace ASN { interface EstimatedUsers { locations: Array<EstimatedUsers.Location>; /** * Total estimated users */ estimatedUsers?: number; } namespace EstimatedUsers { interface Location { locationAlpha2: string; locationName: string; /** * Estimated users per location */ estimatedUsers?: number; } } interface Related { asn: number; name: string; aka?: string; /** * Total estimated users */ estimatedUsers?: number; } } } export interface ASNRelResponse { meta: ASNRelResponse.Meta; rels: Array<ASNRelResponse.Rel>; } export declare namespace ASNRelResponse { interface Meta { data_time: string; query_time: string; total_peers: number; } interface Rel { asn1: number; asn1_country: string; asn1_name: string; asn2: number; asn2_country: string; asn2_name: string; rel: string; } } export interface ASNListParams { /** * Comma separated list of ASNs. */ asn?: string; /** * Format results are returned in. */ format?: 'JSON' | 'CSV'; /** * Limit the number of objects in the response. */ limit?: number; /** * Location Alpha2 to filter results. */ location?: string; /** * Number of objects to skip before grabbing results. */ offset?: number; /** * Order asn list. */ orderBy?: 'ASN' | 'POPULATION'; } export interface ASNGetParams { /** * Format results are returned in. */ format?: 'JSON' | 'CSV'; } export interface ASNIPParams { /** * IP address. */ ip: string; /** * Format results are returned in. */ format?: 'JSON' | 'CSV'; } export interface ASNRelParams { /** * Get the AS relationship of ASN2 with respect to the given ASN */ asn2?: number; /** * Format results are returned in. */ format?: 'JSON' | 'CSV'; } export declare namespace ASNs { export import ASNListResponse = ASNsAPI.ASNListResponse; export import ASNGetResponse = ASNsAPI.ASNGetResponse; export import ASNIPResponse = ASNsAPI.ASNIPResponse; export import ASNRelResponse = ASNsAPI.ASNRelResponse; export import ASNListParams = ASNsAPI.ASNListParams; export import ASNGetParams = ASNsAPI.ASNGetParams; export import ASNIPParams = ASNsAPI.ASNIPParams; export import ASNRelParams = ASNsAPI.ASNRelParams; } //# sourceMappingURL=asns.d.ts.map