1
0
Fork 0
mirror of https://github.com/alice-lg/birdwatcher.git synced 2025-03-09 00:00:05 +01:00

added endpoint for noexport routes

This commit is contained in:
Matthias Hannig 2017-04-07 11:11:43 +02:00
parent 3b89af12c4
commit fa6ca4e91c
2 changed files with 13 additions and 0 deletions

View file

@ -189,6 +189,11 @@ func RoutesExport(protocol string) (Parsed, bool) {
parseRoutes)
}
func RoutesNoExport(protocol string) (Parsed, bool) {
return RunAndParse("route noexport '"+protocol+"' all",
parseRoutes)
}
func RoutesExportCount(protocol string) (Parsed, bool) {
return RunAndParse("route export '"+protocol+"' count",
parseRoutesCount)

View file

@ -24,6 +24,14 @@ func RoutesFiltered(r *http.Request, ps httprouter.Params) (bird.Parsed, bool) {
return bird.RoutesFiltered(protocol)
}
func RoutesNoExport(r *http.Request, ps httprouter.Params) (bird.Parsed, bool) {
protocol, err := ValidateProtocolParam(ps.ByName("protocol"))
if err != nil {
return bird.Parsed{"error": fmt.Sprintf("%s", err)}, false
}
return bird.RoutesNoExport(protocol)
}
func RoutesPrefixed(r *http.Request, ps httprouter.Params) (bird.Parsed, bool) {
qs := r.URL.Query()
prefixl := qs["prefix"]