add Cloudflare Radar API queries support #50
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR adds support for querying Cloudflare Radar new BGP routing statistics and prefix-to-origin mapping APIs.
This feature is powered by
radar-rs: 0.0.2
, an unofficial Cloudflare Radar API Rust SDK. This library is still in very early stage.Usage
We added a new
monocle radar
command group in this pull request, which contains the following to subcommands:monocle radar stats [QUERY]
: get routing stats (like prefix count, rpki invalid count) for a given country or ASN.monocle radar pfx2as [QUERY] [--rpki-status valid|invalid|unknown]
: get prefix to origin mapping for a given prefix or ASNAPI Token Required
We do not provide data access in the tool. Users who want to access this data are required to obtain a Cloudflare API token (see this tutorial) and set the environment variable
CF_API_TOKEN
with the token content. Commands will fail should the token be missing or invalid.Data License
The use of the Cloudflare Radar data is under
CC BY-SA 4.0
license.This library does not provide any direct access to the API data.
See Cloudflare Radar about page for more details.