Documentation
¶
Index ¶
- Constants
- func NotFoundHandler(w http.ResponseWriter, r *http.Request)
- type RestRequest
- type RestResponse
- type RestServer
- func (rs *RestServer) Neighbor(w http.ResponseWriter, r *http.Request)
- func (rs *RestServer) NeighborAdjRibIn(w http.ResponseWriter, r *http.Request)
- func (rs *RestServer) NeighborAdjRibOut(w http.ResponseWriter, r *http.Request)
- func (rs *RestServer) NeighborLocalRib(w http.ResponseWriter, r *http.Request)
- func (rs *RestServer) NeighborPostHandler(w http.ResponseWriter, r *http.Request)
- func (rs *RestServer) Neighbors(w http.ResponseWriter, r *http.Request)
- func (rs *RestServer) Serve()
Constants ¶
View Source
const ( REQ_NEIGHBOR REQ_NEIGHBORS REQ_ADJ_RIB_IN REQ_ADJ_RIB_OUT REQ_LOCAL_RIB REQ_NEIGHBOR_SHUTDOWN REQ_NEIGHBOR_RESET REQ_NEIGHBOR_SOFT_RESET REQ_NEIGHBOR_SOFT_RESET_IN REQ_NEIGHBOR_SOFT_RESET_OUT )
View Source
const ( BASE_VERSION = "/v1" NEIGHBOR = "/bgp/neighbor" NEIGHBORS = "/bgp/neighbors" PARAM_REMOTE_PEER_ADDR = "remotePeerAddr" STATS = "/stats" )
View Source
const REST_PORT = 8080
Variables ¶
This section is empty.
Functions ¶
func NotFoundHandler ¶
func NotFoundHandler(w http.ResponseWriter, r *http.Request)
Types ¶
type RestRequest ¶
type RestRequest struct { RequestType int RemoteAddr string ResponseCh chan *RestResponse Err error }
func NewRestRequest ¶
func NewRestRequest(reqType int, remoteAddr string) *RestRequest
type RestResponse ¶
func (*RestResponse) Err ¶
func (r *RestResponse) Err() error
type RestServer ¶
type RestServer struct {
// contains filtered or unexported fields
}
func NewRestServer ¶
func NewRestServer(port int, bgpServerCh chan *RestRequest) *RestServer
func (*RestServer) Neighbor ¶
func (rs *RestServer) Neighbor(w http.ResponseWriter, r *http.Request)
func (*RestServer) NeighborAdjRibIn ¶
func (rs *RestServer) NeighborAdjRibIn(w http.ResponseWriter, r *http.Request)
func (*RestServer) NeighborAdjRibOut ¶
func (rs *RestServer) NeighborAdjRibOut(w http.ResponseWriter, r *http.Request)
func (*RestServer) NeighborLocalRib ¶
func (rs *RestServer) NeighborLocalRib(w http.ResponseWriter, r *http.Request)
func (*RestServer) NeighborPostHandler ¶
func (rs *RestServer) NeighborPostHandler(w http.ResponseWriter, r *http.Request)
func (*RestServer) Neighbors ¶
func (rs *RestServer) Neighbors(w http.ResponseWriter, r *http.Request)
func (*RestServer) Serve ¶
func (rs *RestServer) Serve()
Main thread of rest service. URL than can receive.
get state of neighbors. -- curl -i -X GET http://<ownIP>:8080/v1/bgp/neighbors get state of neighbor. -- curl -i -X GET http://<ownIP>:8080/v1/bgp/neighbor/<remote address of target neighbor> get adj-rib-in of each neighbor. -- curl -i -X GET http://<ownIP>:8080/v1/bgp/neighbor/<remote address of target neighbor>/adj-rib-in get adj-rib-out of each neighbor. -- curl -i -X GET http://<ownIP>:8080/v1/bgp/neighbor/<remote address of target neighbor>/adj-rib-out get local-rib of each neighbor. -- curl -i -X GET http://<ownIP>:8080/v1/bgp/neighbor/<remote address of target neighbor>/local-rib
Click to show internal directories.
Click to hide internal directories.