Skip to content

Commit 9af4cde

Browse files
vaishakdineshstainless-app[bot]
authored andcommitted
feat(radar): add bgp/ips/index, bgp/ips/ips, bgp/ips/top
1 parent 00f63c7 commit 9af4cde

14 files changed

Lines changed: 686 additions & 296 deletions

File tree

src/resources/radar/api.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,21 @@ Methods:
250250

251251
Types:
252252

253-
- <code><a href="./src/resources/radar/bgp/ips.ts">IPTimeseriesResponse</a></code>
253+
- <code><a href="./src/resources/radar/bgp/ips/ips.ts">IPTimeseriesResponse</a></code>
254254

255255
Methods:
256256

257-
- <code title="get /radar/bgp/ips/timeseries">client.radar.bgp.ips.<a href="./src/resources/radar/bgp/ips.ts">timeseries</a>({ ...params }) -> IPTimeseriesResponse</code>
257+
- <code title="get /radar/bgp/ips/timeseries">client.radar.bgp.ips.<a href="./src/resources/radar/bgp/ips/ips.ts">timeseries</a>({ ...params }) -> IPTimeseriesResponse</code>
258+
259+
#### Top
260+
261+
Types:
262+
263+
- <code><a href="./src/resources/radar/bgp/ips/top.ts">TopAsesResponse</a></code>
264+
265+
Methods:
266+
267+
- <code title="get /radar/bgp/ips/top/ases">client.radar.bgp.ips.top.<a href="./src/resources/radar/bgp/ips/top.ts">ases</a>({ ...params }) -> TopAsesResponse</code>
258268

259269
### RPKI
260270

@@ -272,6 +282,16 @@ Methods:
272282
- <code title="get /radar/bgp/rpki/aspa/snapshot">client.radar.bgp.rpki.aspa.<a href="./src/resources/radar/bgp/rpki/aspa.ts">snapshot</a>({ ...params }) -> ASPASnapshotResponse</code>
273283
- <code title="get /radar/bgp/rpki/aspa/timeseries">client.radar.bgp.rpki.aspa.<a href="./src/resources/radar/bgp/rpki/aspa.ts">timeseries</a>({ ...params }) -> ASPATimeseriesResponse</code>
274284

285+
#### Roas
286+
287+
Types:
288+
289+
- <code><a href="./src/resources/radar/bgp/rpki/roas.ts">RoaTimeseriesResponse</a></code>
290+
291+
Methods:
292+
293+
- <code title="get /radar/bgp/rpki/roas/timeseries">client.radar.bgp.rpki.roas.<a href="./src/resources/radar/bgp/rpki/roas.ts">timeseries</a>({ ...params }) -> RoaTimeseriesResponse</code>
294+
275295
## Bots
276296

277297
Types:

src/resources/radar/bgp/bgp.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
import { APIResource } from '../../../resource';
44
import { isRequestOptions } from '../../../core';
55
import * as Core from '../../../core';
6-
import * as IPsAPI from './ips';
7-
import { IPTimeseriesParams, IPTimeseriesResponse, IPs } from './ips';
86
import * as RoutesAPI from './routes';
97
import {
108
RouteAsesParams,
@@ -21,6 +19,8 @@ import {
2119
} from './routes';
2220
import * as HijacksAPI from './hijacks/hijacks';
2321
import { Hijacks } from './hijacks/hijacks';
22+
import * as IPsAPI from './ips/ips';
23+
import { IPTimeseriesParams, IPTimeseriesResponse, IPs } from './ips/ips';
2424
import * as LeaksAPI from './leaks/leaks';
2525
import { Leaks } from './leaks/leaks';
2626
import * as RPKIAPI from './rpki/rpki';

src/resources/radar/bgp/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
export { BGP, type BGPTimeseriesResponse, type BGPTimeseriesParams } from './bgp';
44
export { Hijacks } from './hijacks/index';
5-
export { IPs, type IPTimeseriesResponse, type IPTimeseriesParams } from './ips';
5+
export { IPs, type IPTimeseriesResponse, type IPTimeseriesParams } from './ips/index';
66
export { Leaks } from './leaks/index';
77
export { RPKI } from './rpki/index';
88
export {

src/resources/radar/bgp/ips.ts

Lines changed: 1 addition & 285 deletions
Original file line numberDiff line numberDiff line change
@@ -1,287 +1,3 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
import { APIResource } from '../../../resource';
4-
import { isRequestOptions } from '../../../core';
5-
import * as Core from '../../../core';
6-
7-
export class IPs extends APIResource {
8-
/**
9-
* Retrieves time series data for the announced IP space count, represented as the
10-
* number of IPv4 /24s and IPv6 /48s, for a given ASN.
11-
*
12-
* @example
13-
* ```ts
14-
* const response = await client.radar.bgp.ips.timeseries();
15-
* ```
16-
*/
17-
timeseries(
18-
query?: IPTimeseriesParams,
19-
options?: Core.RequestOptions,
20-
): Core.APIPromise<IPTimeseriesResponse>;
21-
timeseries(options?: Core.RequestOptions): Core.APIPromise<IPTimeseriesResponse>;
22-
timeseries(
23-
query: IPTimeseriesParams | Core.RequestOptions = {},
24-
options?: Core.RequestOptions,
25-
): Core.APIPromise<IPTimeseriesResponse> {
26-
if (isRequestOptions(query)) {
27-
return this.timeseries({}, query);
28-
}
29-
return (
30-
this._client.get('/radar/bgp/ips/timeseries', { query, ...options }) as Core.APIPromise<{
31-
result: IPTimeseriesResponse;
32-
}>
33-
)._thenUnwrap((obj) => obj.result);
34-
}
35-
}
36-
37-
export interface IPTimeseriesResponse {
38-
/**
39-
* Metadata for the results.
40-
*/
41-
meta: IPTimeseriesResponse.Meta;
42-
43-
serie_0: IPTimeseriesResponse.Serie0;
44-
}
45-
46-
export namespace IPTimeseriesResponse {
47-
/**
48-
* Metadata for the results.
49-
*/
50-
export interface Meta {
51-
/**
52-
* Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals).
53-
* Refer to
54-
* [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
55-
*/
56-
aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH';
57-
58-
confidenceInfo: Meta.ConfidenceInfo;
59-
60-
dateRange: Array<Meta.DateRange>;
61-
62-
/**
63-
* Timestamp of the last dataset update.
64-
*/
65-
lastUpdated: string;
66-
67-
/**
68-
* Normalization method applied to the results. Refer to
69-
* [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
70-
*/
71-
normalization:
72-
| 'PERCENTAGE'
73-
| 'MIN0_MAX'
74-
| 'MIN_MAX'
75-
| 'RAW_VALUES'
76-
| 'PERCENTAGE_CHANGE'
77-
| 'ROLLING_AVERAGE'
78-
| 'OVERLAPPED_PERCENTAGE'
79-
| 'RATIO';
80-
81-
/**
82-
* Measurement units for the results.
83-
*/
84-
units: Array<Meta.Unit>;
85-
86-
delay?: Meta.Delay;
87-
}
88-
89-
export namespace Meta {
90-
export interface ConfidenceInfo {
91-
annotations: Array<ConfidenceInfo.Annotation>;
92-
93-
/**
94-
* Provides an indication of how much confidence Cloudflare has in the data.
95-
*/
96-
level: number;
97-
}
98-
99-
export namespace ConfidenceInfo {
100-
/**
101-
* Annotation associated with the result (e.g. outage or other type of event).
102-
*/
103-
export interface Annotation {
104-
/**
105-
* Data source for annotations.
106-
*/
107-
dataSource:
108-
| 'ALL'
109-
| 'AI_BOTS'
110-
| 'AI_GATEWAY'
111-
| 'BGP'
112-
| 'BOTS'
113-
| 'CONNECTION_ANOMALY'
114-
| 'CT'
115-
| 'DNS'
116-
| 'DNS_MAGNITUDE'
117-
| 'DNS_AS112'
118-
| 'DOS'
119-
| 'EMAIL_ROUTING'
120-
| 'EMAIL_SECURITY'
121-
| 'FW'
122-
| 'FW_PG'
123-
| 'HTTP'
124-
| 'HTTP_CONTROL'
125-
| 'HTTP_CRAWLER_REFERER'
126-
| 'HTTP_ORIGINS'
127-
| 'IQI'
128-
| 'LEAKED_CREDENTIALS'
129-
| 'NET'
130-
| 'ROBOTS_TXT'
131-
| 'SPEED'
132-
| 'WORKERS_AI';
133-
134-
description: string;
135-
136-
endDate: string;
137-
138-
/**
139-
* Event type for annotations.
140-
*/
141-
eventType: 'EVENT' | 'GENERAL' | 'OUTAGE' | 'PARTIAL_PROJECTION' | 'PIPELINE' | 'TRAFFIC_ANOMALY';
142-
143-
/**
144-
* Whether event is a single point in time or a time range.
145-
*/
146-
isInstantaneous: boolean;
147-
148-
linkedUrl: string;
149-
150-
startDate: string;
151-
}
152-
}
153-
154-
export interface DateRange {
155-
/**
156-
* Adjusted end of date range.
157-
*/
158-
endTime: string;
159-
160-
/**
161-
* Adjusted start of date range.
162-
*/
163-
startTime: string;
164-
}
165-
166-
export interface Unit {
167-
name: string;
168-
169-
value: string;
170-
}
171-
172-
export interface Delay {
173-
asn_data: Delay.ASNData;
174-
175-
country_data: Delay.CountryData;
176-
177-
healthy: boolean;
178-
179-
nowTs: number;
180-
}
181-
182-
export namespace Delay {
183-
export interface ASNData {
184-
delaySecs: number;
185-
186-
delayStr: string;
187-
188-
healthy: boolean;
189-
190-
latest: ASNData.Latest;
191-
}
192-
193-
export namespace ASNData {
194-
export interface Latest {
195-
entries_count: number;
196-
197-
path: string;
198-
199-
timestamp: number;
200-
}
201-
}
202-
203-
export interface CountryData {
204-
delaySecs: number;
205-
206-
delayStr: string;
207-
208-
healthy: boolean;
209-
210-
latest: CountryData.Latest;
211-
}
212-
213-
export namespace CountryData {
214-
export interface Latest {
215-
count: number;
216-
217-
timestamp: number;
218-
}
219-
}
220-
}
221-
}
222-
223-
export interface Serie0 {
224-
ipv4: Array<string>;
225-
226-
ipv6: Array<string>;
227-
228-
timestamps: Array<string>;
229-
}
230-
}
231-
232-
export interface IPTimeseriesParams {
233-
/**
234-
* Filters results by Autonomous System. Specify one or more Autonomous System
235-
* Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from
236-
* results. For example, `-174, 3356` excludes results from AS174, but includes
237-
* results from AS3356.
238-
*/
239-
asn?: Array<string>;
240-
241-
/**
242-
* End of the date range (inclusive).
243-
*/
244-
dateEnd?: Array<string>;
245-
246-
/**
247-
* Filters results by date range. For example, use `7d` and `7dcontrol` to compare
248-
* this week with the previous week. Use this parameter or set specific start and
249-
* end dates (`dateStart` and `dateEnd` parameters).
250-
*/
251-
dateRange?: Array<string>;
252-
253-
/**
254-
* Start of the date range.
255-
*/
256-
dateStart?: Array<string>;
257-
258-
/**
259-
* Format in which results will be returned.
260-
*/
261-
format?: 'JSON' | 'CSV';
262-
263-
/**
264-
* Includes data delay meta information.
265-
*/
266-
includeDelay?: boolean;
267-
268-
/**
269-
* Filters results by IP version (Ipv4 vs. IPv6).
270-
*/
271-
ipVersion?: Array<'IPv4' | 'IPv6'>;
272-
273-
/**
274-
* Filters results by location. Specify a comma-separated list of alpha-2 location
275-
* codes.
276-
*/
277-
location?: Array<string>;
278-
279-
/**
280-
* Array of names used to label the series in the response.
281-
*/
282-
name?: Array<string>;
283-
}
284-
285-
export declare namespace IPs {
286-
export { type IPTimeseriesResponse as IPTimeseriesResponse, type IPTimeseriesParams as IPTimeseriesParams };
287-
}
3+
export * from './ips/index';
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
export { IPs, type IPTimeseriesResponse, type IPTimeseriesParams } from './ips';
4+
export { Top, type TopAsesResponse, type TopAsesParams } from './top';

0 commit comments

Comments
 (0)