1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 package vxlan_gpe_ioam_export
11 func RESTHandler(rpc RPCService) http.Handler {
12 mux := http.NewServeMux()
13 mux.HandleFunc("/vxlan_gpe_ioam_export_enable_disable", func(w http.ResponseWriter, req *http.Request) {
14 var request = new(VxlanGpeIoamExportEnableDisable)
15 b, err := ioutil.ReadAll(req.Body)
17 http.Error(w, "read body failed", http.StatusBadRequest)
20 if err := json.Unmarshal(b, request); err != nil {
21 http.Error(w, "unmarshal data failed", http.StatusBadRequest)
24 reply, err := rpc.VxlanGpeIoamExportEnableDisable(req.Context(), request)
26 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
29 rep, err := json.MarshalIndent(reply, "", " ")
31 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
36 return http.HandlerFunc(mux.ServeHTTP)