The frontend provides an API for running BIRD/traceroute/whois queries.
API Endpoint: https://your.frontend.com/api/
(the last slash must not be omitted!)
Requests are sent as POSTS with JSON bodies.
- Bird-lg-go API documentation
Created by gh-md-toc
Name | Type | Value |
---|---|---|
servers |
array of string |
List of servers to be queried |
type |
string |
Can be summary , bird , traceroute , whois or server_list |
args |
string |
Arguments to be passed, see below |
Argument examples for each type:
summary
:args
is ignored. Recommended to set to empty string.bird
:args
is the command to be passed to bird, e.g.show route for 8.8.8.8
traceroute
:args
is the traceroute target, e.g.8.8.8.8
orgoogle.com
whois
:args
is the whois target, e.g.8.8.8.8
orgoogle.com
server_list
:args
is ignored. In addition,servers
is also ignored.
{
"servers": [
"alpha"
],
"type": "bird",
"args": "show route for 8.8.8.8"
}
{
"servers": [],
"type": "server_list",
"args": ""
}
Name | Type | Value |
---|---|---|
error |
string |
Error message when something is wrong. Empty when everything is good |
result |
array of apiSummaryResultPair |
See below |
Name | Type | Value |
---|---|---|
server |
string |
Name of the server |
data |
array of SummaryRowData |
Summaries of the server, see below |
All fields below is 1:1 correspondent to the output of birdc show protocols
.
Name | Type |
---|---|
name |
string |
proto |
string |
table |
string |
state |
string |
since |
string |
info |
string |
Request:
{
"servers": [
"alpha"
],
"type": "summary",
"args": ""
}
Response:
{
"error": "",
"result": [
{
"server": "alpha",
"data": [
{
"name": "bgp1",
"proto": "BGP",
"table": "---",
"state": "start",
"since": "2021-01-15 22:40:01",
"info": "Active Socket: Operation timed out"
},
{
"name": "bgp2",
"proto": "BGP",
"table": "---",
"state": "start",
"since": "2021-01-03 08:15:48",
"info": "Established"
}
]
}
]
}
Name | Type | Value |
---|---|---|
error |
string |
Error message, empty when everything is good |
result |
array of apiGenericResultPair |
See below |
Name | Type | Value |
---|---|---|
server |
string |
Name of the server; is empty when type is whois |
data |
string |
Result from the server; is empty when type is server_list |
Request:
{
"servers": [
"alpha"
],
"type": "bird",
"args": "show status"
}
Response:
{
"error": "",
"result": [
{
"server": "alpha",
"data": "BIRD v2.0.7-137-g61dae32b\nRouter ID is 1.2.3.4\nCurrent server time is 2021-01-17 04:21:14.792\nLast reboot on 2021-01-03 08:15:48.494\nLast reconfiguration on 2021-01-17 00:49:10.573\nDaemon is up and running\n"
}
]
}
Request:
{
"servers": [],
"type": "server_list",
"args": ""
}
Response:
{
"error": "",
"result": [
{
"server": "gigsgigscloud",
"data": ""
}
]
}