The Datapository
A collaborative network data analysis and storage facility
XMLRPC Interface to the BGP Monitor
For remote, automated access to the BGP monitor, we provide an XML-RPC-based
interface that's much easier to use than scraping the HTML results. The
server is www.datapository.net and the program path is
/bgpmon/dataview-rpc.cgi. Please note that both of these are
subject to change as we expand the datapository.
Interface
The server exports three functions:
- feeds() -- returns a hash containing information about the BGP feeds available.
- name
- type - can be bgpup, bgptable, ... and others.
- public - a binary yes/no flag.
- description - text string describing the feed.
- feeds_with_details(param_hash) -- returns the same hash as above, but includes several additional fields:
- count - total number of entries in the feed
- start - date (unix timestamp format) of first entry in feed
- end - date of last entry in feed
The param hash takes only a single argument, type for the type of feed.
- dataview(param_hash) -- returns a query result hash generated by searching on the specified parameters. The result hash contains four items:
- type -- type of feed. For BGP view, set type to "bgpup"
- list -- a list of BGP updates. Each entry in the list is a hash
defining the time, prefix, mask, type, aspath, localpref, and med for the
update. (not all of these are defined for all updates).
- querytime -- how long the query took to process.
- query -- what SQL statement the dataview script issued (for debugging).
- queryid -- a hash of the query parameters actually used by
the dataview code.
Dataview accepts a hash table of parameters to control the script.
The parameters are:
- type- The type of feed to search (must be bgpup for bgp feeds)
- feed -
- origin_as -
- aspath -
- aspath_rel - How the AS path should be searched. Can be contain, start, end, or is
- time -
- stime -
- etime -
- prefix_rel - How the prefix should be searched. Valid relations are eq (exact match)
lte (all subnets) and gte (all supernets).
- prefix - specified as ipaddr/mask
- limit - how many rows to return at most
Sample script
To get a feel for using the XML-RPC interface, grab our
ruby command-line query script. Note
that almost all of the code in there is actually just explaining to
the user what the options are; the interface itself is very simple.
./bgpview-client.rb --feed=ana1_gblx --prefix="206.197.119.0/24" \
--prefix-rel="eq" --time=between --start-time="11/05/2005" \
--end-time="11/12/2005"
2005/11/05 06:00:11 A 206.197.119.0/24 701 6315
2005/11/05 06:00:40 A 206.197.119.0/24 701 6315
2005/11/08 01:48:00 A 206.197.119.0/24 701 6315
2005/11/08 03:49:27 A 206.197.119.0/24 701 6315
Last updated: Tue Feb 06 18:45:10 EST 2007
[validate xhtml]
datapository - at - emulab dot net.