aboutsummaryrefslogtreecommitdiffstats
path: root/binapi/dslite/dslite_rest.ba.go
diff options
context:
space:
mode:
Diffstat (limited to 'binapi/dslite/dslite_rest.ba.go')
-rw-r--r--binapi/dslite/dslite_rest.ba.go111
1 files changed, 0 insertions, 111 deletions
diff --git a/binapi/dslite/dslite_rest.ba.go b/binapi/dslite/dslite_rest.ba.go
deleted file mode 100644
index eba86b0..0000000
--- a/binapi/dslite/dslite_rest.ba.go
+++ /dev/null
@@ -1,111 +0,0 @@
-// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
-
-package dslite
-
-import (
- "encoding/json"
- "io/ioutil"
- "net/http"
-)
-
-func RESTHandler(rpc RPCService) http.Handler {
- mux := http.NewServeMux()
- mux.HandleFunc("/dslite_add_del_pool_addr_range", func(w http.ResponseWriter, req *http.Request) {
- var request = new(DsliteAddDelPoolAddrRange)
- b, err := ioutil.ReadAll(req.Body)
- if err != nil {
- http.Error(w, "read body failed", http.StatusBadRequest)
- return
- }
- if err := json.Unmarshal(b, request); err != nil {
- http.Error(w, "unmarshal data failed", http.StatusBadRequest)
- return
- }
- reply, err := rpc.DsliteAddDelPoolAddrRange(req.Context(), request)
- if err != nil {
- http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
- return
- }
- rep, err := json.MarshalIndent(reply, "", " ")
- if err != nil {
- http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
- return
- }
- w.Write(rep)
- })
- mux.HandleFunc("/dslite_get_aftr_addr", func(w http.ResponseWriter, req *http.Request) {
- var request = new(DsliteGetAftrAddr)
- reply, err := rpc.DsliteGetAftrAddr(req.Context(), request)
- if err != nil {
- http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
- return
- }
- rep, err := json.MarshalIndent(reply, "", " ")
- if err != nil {
- http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
- return
- }
- w.Write(rep)
- })
- mux.HandleFunc("/dslite_get_b4_addr", func(w http.ResponseWriter, req *http.Request) {
- var request = new(DsliteGetB4Addr)
- reply, err := rpc.DsliteGetB4Addr(req.Context(), request)
- if err != nil {
- http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
- return
- }
- rep, err := json.MarshalIndent(reply, "", " ")
- if err != nil {
- http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
- return
- }
- w.Write(rep)
- })
- mux.HandleFunc("/dslite_set_aftr_addr", func(w http.ResponseWriter, req *http.Request) {
- var request = new(DsliteSetAftrAddr)
- b, err := ioutil.ReadAll(req.Body)
- if err != nil {
- http.Error(w, "read body failed", http.StatusBadRequest)
- return
- }
- if err := json.Unmarshal(b, request); err != nil {
- http.Error(w, "unmarshal data failed", http.StatusBadRequest)
- return
- }
- reply, err := rpc.DsliteSetAftrAddr(req.Context(), request)
- if err != nil {
- http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
- return
- }
- rep, err := json.MarshalIndent(reply, "", " ")
- if err != nil {
- http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
- return
- }
- w.Write(rep)
- })
- mux.HandleFunc("/dslite_set_b4_addr", func(w http.ResponseWriter, req *http.Request) {
- var request = new(DsliteSetB4Addr)
- b, err := ioutil.ReadAll(req.Body)
- if err != nil {
- http.Error(w, "read body failed", http.StatusBadRequest)
- return
- }
- if err := json.Unmarshal(b, request); err != nil {
- http.Error(w, "unmarshal data failed", http.StatusBadRequest)
- return
- }
- reply, err := rpc.DsliteSetB4Addr(req.Context(), request)
- if err != nil {
- http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
- return
- }
- rep, err := json.MarshalIndent(reply, "", " ")
- if err != nil {
- http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
- return
- }
- w.Write(rep)
- })
- return http.HandlerFunc(mux.ServeHTTP)
-}