Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add peers listing endpoint #61

Merged
merged 4 commits into from
Nov 1, 2024
Merged

Add peers listing endpoint #61

merged 4 commits into from
Nov 1, 2024

Conversation

digizeph
Copy link
Member

@digizeph digizeph commented Nov 1, 2024

  • migrate default broker API endpoint to https://api.bgpkit.com/v3/broker
    • Full API docs is available at https://api.bgpkit.com/docs
  • add get_peers to BgpkitBroker struct
    • fetches the list of peers for a given collector
    • can specify filters the same way as querying MRT files
    • available filter functions include:
      • .peers_asn(ASN)
      • .peers_ip(IP)
      • .collector_id(COLLECTOR_ID)
      • .peers_only_full_feed(TRUE/FALSE)
    • returns Vec<BrokerPeer>
#[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize)]
pub struct BrokerPeer {
    /// The date of the latest available data.
    pub date: NaiveDate,
    /// The IP address of the collector peer.
    pub ip: IpAddr,
    /// The ASN (Autonomous System Number) of the collector peer.
    pub asn: u32,
    /// The name of the collector.
    pub collector: String,
    /// The number of IPv4 prefixes.
    pub num_v4_pfxs: u32,
    /// The number of IPv6 prefixes.
    pub num_v6_pfxs: u32,
    /// The number of connected ASNs.
    pub num_connected_asns: u32,
}

@digizeph digizeph merged commit ddaf9ad into main Nov 1, 2024
1 check passed
@digizeph digizeph deleted the add_peers branch November 1, 2024 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant