7 "github.com/gorilla/mux"
12 //example of simple http router, fased out in favor of gorilla mux
13 //http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
14 //fmt.Fprintf(w, "Hello World!")
16 //http.ListenAndServe(":8000", nil)
21 r.HandleFunc("/example/{first}/{second:[0-9]+}", exampleHandler)
23 //r.HandleFunc("/access", )
24 //r.HandleFunc("/stats", )
25 //r.HandleFunc("/topology", )
26 //r.HandleFunc("/health", )
27 //r.HandleFunc("/free", )//probably do this with server side or sockets
28 //r.HandleFunc("/flowdel", )//this is an external request
29 //r.HandleFunc("/mpstat", )
30 //r.HandleFunc("/ifstat", )
31 //r.HandleFunc("/showtemp", )
32 //r.HandleFunc("/gettopo", )
33 //r.HandleFunc("/net", )
34 //r.HandleFunc("/rpiping", )//workerping
35 //r.HandleFunc("/nodes", )
36 //r.HandleFunc("/statusnodes", )
37 //r.HandleFunc("/intfs", )
38 //r.HandleFunc("/iperf", )
39 //r.HandleFunc("/pingall", )
40 //r.HandleFunc("/placement", )
41 //r.HandleFunc("/getvsorcdata", )
42 //r.HandleFunc("/getcontrollerdata", )
43 //r.HandleFunc("/resetflows", )
44 //r.HandleFunc("/listswitch", )
45 //r.HandleFunc("/status", )
46 //r.HandleFunc("/tablestatus", )
47 //r.HandleFunc("/portsdesc", )
48 //r.HandleFunc("/portsstat", )
49 //r.HandleFunc("/startcontroller", )
50 //r.HandleFunc("/startcontrollerrouter", )
51 //r.HandleFunc("/stopcontroller", )
52 //r.HandleFunc("/sendcommand", )
53 //r.HandleFunc("/cancel", )
54 //r.HandleFunc("/startvsorc", )
55 //r.HandleFunc("/stopvsorc", )
57 http.ListenAndServe(":8000", nil)
63 func exampleHandler(w http.ResponseWriter, r *http.Request) {
65 w.WriteHeader(http.StatusOK)
66 fmt.Fprintf(w, "First: %v\nSecond: %v", vars["first"], vars["second"])