1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
11 func RESTHandler(rpc RPCService) http.Handler {
12 mux := http.NewServeMux()
13 mux.HandleFunc("/one_add_del_adjacency", func(w http.ResponseWriter, req *http.Request) {
14 var request = new(OneAddDelAdjacency)
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.OneAddDelAdjacency(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 mux.HandleFunc("/one_add_del_l2_arp_entry", func(w http.ResponseWriter, req *http.Request) {
37 var request = new(OneAddDelL2ArpEntry)
38 b, err := ioutil.ReadAll(req.Body)
40 http.Error(w, "read body failed", http.StatusBadRequest)
43 if err := json.Unmarshal(b, request); err != nil {
44 http.Error(w, "unmarshal data failed", http.StatusBadRequest)
47 reply, err := rpc.OneAddDelL2ArpEntry(req.Context(), request)
49 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
52 rep, err := json.MarshalIndent(reply, "", " ")
54 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
59 mux.HandleFunc("/one_add_del_local_eid", func(w http.ResponseWriter, req *http.Request) {
60 var request = new(OneAddDelLocalEid)
61 b, err := ioutil.ReadAll(req.Body)
63 http.Error(w, "read body failed", http.StatusBadRequest)
66 if err := json.Unmarshal(b, request); err != nil {
67 http.Error(w, "unmarshal data failed", http.StatusBadRequest)
70 reply, err := rpc.OneAddDelLocalEid(req.Context(), request)
72 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
75 rep, err := json.MarshalIndent(reply, "", " ")
77 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
82 mux.HandleFunc("/one_add_del_locator", func(w http.ResponseWriter, req *http.Request) {
83 var request = new(OneAddDelLocator)
84 b, err := ioutil.ReadAll(req.Body)
86 http.Error(w, "read body failed", http.StatusBadRequest)
89 if err := json.Unmarshal(b, request); err != nil {
90 http.Error(w, "unmarshal data failed", http.StatusBadRequest)
93 reply, err := rpc.OneAddDelLocator(req.Context(), request)
95 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
98 rep, err := json.MarshalIndent(reply, "", " ")
100 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
105 mux.HandleFunc("/one_add_del_locator_set", func(w http.ResponseWriter, req *http.Request) {
106 var request = new(OneAddDelLocatorSet)
107 b, err := ioutil.ReadAll(req.Body)
109 http.Error(w, "read body failed", http.StatusBadRequest)
112 if err := json.Unmarshal(b, request); err != nil {
113 http.Error(w, "unmarshal data failed", http.StatusBadRequest)
116 reply, err := rpc.OneAddDelLocatorSet(req.Context(), request)
118 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
121 rep, err := json.MarshalIndent(reply, "", " ")
123 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
128 mux.HandleFunc("/one_add_del_map_request_itr_rlocs", func(w http.ResponseWriter, req *http.Request) {
129 var request = new(OneAddDelMapRequestItrRlocs)
130 b, err := ioutil.ReadAll(req.Body)
132 http.Error(w, "read body failed", http.StatusBadRequest)
135 if err := json.Unmarshal(b, request); err != nil {
136 http.Error(w, "unmarshal data failed", http.StatusBadRequest)
139 reply, err := rpc.OneAddDelMapRequestItrRlocs(req.Context(), request)
141 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
144 rep, err := json.MarshalIndent(reply, "", " ")
146 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
151 mux.HandleFunc("/one_add_del_map_resolver", func(w http.ResponseWriter, req *http.Request) {
152 var request = new(OneAddDelMapResolver)
153 b, err := ioutil.ReadAll(req.Body)
155 http.Error(w, "read body failed", http.StatusBadRequest)
158 if err := json.Unmarshal(b, request); err != nil {
159 http.Error(w, "unmarshal data failed", http.StatusBadRequest)
162 reply, err := rpc.OneAddDelMapResolver(req.Context(), request)
164 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
167 rep, err := json.MarshalIndent(reply, "", " ")
169 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
174 mux.HandleFunc("/one_add_del_map_server", func(w http.ResponseWriter, req *http.Request) {
175 var request = new(OneAddDelMapServer)
176 b, err := ioutil.ReadAll(req.Body)
178 http.Error(w, "read body failed", http.StatusBadRequest)
181 if err := json.Unmarshal(b, request); err != nil {
182 http.Error(w, "unmarshal data failed", http.StatusBadRequest)
185 reply, err := rpc.OneAddDelMapServer(req.Context(), request)
187 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
190 rep, err := json.MarshalIndent(reply, "", " ")
192 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
197 mux.HandleFunc("/one_add_del_ndp_entry", func(w http.ResponseWriter, req *http.Request) {
198 var request = new(OneAddDelNdpEntry)
199 b, err := ioutil.ReadAll(req.Body)
201 http.Error(w, "read body failed", http.StatusBadRequest)
204 if err := json.Unmarshal(b, request); err != nil {
205 http.Error(w, "unmarshal data failed", http.StatusBadRequest)
208 reply, err := rpc.OneAddDelNdpEntry(req.Context(), request)
210 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
213 rep, err := json.MarshalIndent(reply, "", " ")
215 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
220 mux.HandleFunc("/one_add_del_remote_mapping", func(w http.ResponseWriter, req *http.Request) {
221 var request = new(OneAddDelRemoteMapping)
222 b, err := ioutil.ReadAll(req.Body)
224 http.Error(w, "read body failed", http.StatusBadRequest)
227 if err := json.Unmarshal(b, request); err != nil {
228 http.Error(w, "unmarshal data failed", http.StatusBadRequest)
231 reply, err := rpc.OneAddDelRemoteMapping(req.Context(), request)
233 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
236 rep, err := json.MarshalIndent(reply, "", " ")
238 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
243 mux.HandleFunc("/one_adjacencies_get", func(w http.ResponseWriter, req *http.Request) {
244 var request = new(OneAdjacenciesGet)
245 b, err := ioutil.ReadAll(req.Body)
247 http.Error(w, "read body failed", http.StatusBadRequest)
250 if err := json.Unmarshal(b, request); err != nil {
251 http.Error(w, "unmarshal data failed", http.StatusBadRequest)
254 reply, err := rpc.OneAdjacenciesGet(req.Context(), request)
256 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
259 rep, err := json.MarshalIndent(reply, "", " ")
261 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
266 mux.HandleFunc("/one_eid_table_add_del_map", func(w http.ResponseWriter, req *http.Request) {
267 var request = new(OneEidTableAddDelMap)
268 b, err := ioutil.ReadAll(req.Body)
270 http.Error(w, "read body failed", http.StatusBadRequest)
273 if err := json.Unmarshal(b, request); err != nil {
274 http.Error(w, "unmarshal data failed", http.StatusBadRequest)
277 reply, err := rpc.OneEidTableAddDelMap(req.Context(), request)
279 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
282 rep, err := json.MarshalIndent(reply, "", " ")
284 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
289 mux.HandleFunc("/one_enable_disable", func(w http.ResponseWriter, req *http.Request) {
290 var request = new(OneEnableDisable)
291 b, err := ioutil.ReadAll(req.Body)
293 http.Error(w, "read body failed", http.StatusBadRequest)
296 if err := json.Unmarshal(b, request); err != nil {
297 http.Error(w, "unmarshal data failed", http.StatusBadRequest)
300 reply, err := rpc.OneEnableDisable(req.Context(), request)
302 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
305 rep, err := json.MarshalIndent(reply, "", " ")
307 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
312 mux.HandleFunc("/one_enable_disable_petr_mode", func(w http.ResponseWriter, req *http.Request) {
313 var request = new(OneEnableDisablePetrMode)
314 b, err := ioutil.ReadAll(req.Body)
316 http.Error(w, "read body failed", http.StatusBadRequest)
319 if err := json.Unmarshal(b, request); err != nil {
320 http.Error(w, "unmarshal data failed", http.StatusBadRequest)
323 reply, err := rpc.OneEnableDisablePetrMode(req.Context(), request)
325 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
328 rep, err := json.MarshalIndent(reply, "", " ")
330 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
335 mux.HandleFunc("/one_enable_disable_pitr_mode", func(w http.ResponseWriter, req *http.Request) {
336 var request = new(OneEnableDisablePitrMode)
337 b, err := ioutil.ReadAll(req.Body)
339 http.Error(w, "read body failed", http.StatusBadRequest)
342 if err := json.Unmarshal(b, request); err != nil {
343 http.Error(w, "unmarshal data failed", http.StatusBadRequest)
346 reply, err := rpc.OneEnableDisablePitrMode(req.Context(), request)
348 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
351 rep, err := json.MarshalIndent(reply, "", " ")
353 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
358 mux.HandleFunc("/one_enable_disable_xtr_mode", func(w http.ResponseWriter, req *http.Request) {
359 var request = new(OneEnableDisableXtrMode)
360 b, err := ioutil.ReadAll(req.Body)
362 http.Error(w, "read body failed", http.StatusBadRequest)
365 if err := json.Unmarshal(b, request); err != nil {
366 http.Error(w, "unmarshal data failed", http.StatusBadRequest)
369 reply, err := rpc.OneEnableDisableXtrMode(req.Context(), request)
371 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
374 rep, err := json.MarshalIndent(reply, "", " ")
376 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
381 mux.HandleFunc("/one_get_map_request_itr_rlocs", func(w http.ResponseWriter, req *http.Request) {
382 var request = new(OneGetMapRequestItrRlocs)
383 reply, err := rpc.OneGetMapRequestItrRlocs(req.Context(), request)
385 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
388 rep, err := json.MarshalIndent(reply, "", " ")
390 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
395 mux.HandleFunc("/one_get_transport_protocol", func(w http.ResponseWriter, req *http.Request) {
396 var request = new(OneGetTransportProtocol)
397 reply, err := rpc.OneGetTransportProtocol(req.Context(), request)
399 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
402 rep, err := json.MarshalIndent(reply, "", " ")
404 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
409 mux.HandleFunc("/one_l2_arp_bd_get", func(w http.ResponseWriter, req *http.Request) {
410 var request = new(OneL2ArpBdGet)
411 reply, err := rpc.OneL2ArpBdGet(req.Context(), request)
413 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
416 rep, err := json.MarshalIndent(reply, "", " ")
418 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
423 mux.HandleFunc("/one_l2_arp_entries_get", func(w http.ResponseWriter, req *http.Request) {
424 var request = new(OneL2ArpEntriesGet)
425 b, err := ioutil.ReadAll(req.Body)
427 http.Error(w, "read body failed", http.StatusBadRequest)
430 if err := json.Unmarshal(b, request); err != nil {
431 http.Error(w, "unmarshal data failed", http.StatusBadRequest)
434 reply, err := rpc.OneL2ArpEntriesGet(req.Context(), request)
436 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
439 rep, err := json.MarshalIndent(reply, "", " ")
441 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
446 mux.HandleFunc("/one_map_register_enable_disable", func(w http.ResponseWriter, req *http.Request) {
447 var request = new(OneMapRegisterEnableDisable)
448 b, err := ioutil.ReadAll(req.Body)
450 http.Error(w, "read body failed", http.StatusBadRequest)
453 if err := json.Unmarshal(b, request); err != nil {
454 http.Error(w, "unmarshal data failed", http.StatusBadRequest)
457 reply, err := rpc.OneMapRegisterEnableDisable(req.Context(), request)
459 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
462 rep, err := json.MarshalIndent(reply, "", " ")
464 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
469 mux.HandleFunc("/one_map_register_fallback_threshold", func(w http.ResponseWriter, req *http.Request) {
470 var request = new(OneMapRegisterFallbackThreshold)
471 b, err := ioutil.ReadAll(req.Body)
473 http.Error(w, "read body failed", http.StatusBadRequest)
476 if err := json.Unmarshal(b, request); err != nil {
477 http.Error(w, "unmarshal data failed", http.StatusBadRequest)
480 reply, err := rpc.OneMapRegisterFallbackThreshold(req.Context(), request)
482 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
485 rep, err := json.MarshalIndent(reply, "", " ")
487 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
492 mux.HandleFunc("/one_map_register_set_ttl", func(w http.ResponseWriter, req *http.Request) {
493 var request = new(OneMapRegisterSetTTL)
494 b, err := ioutil.ReadAll(req.Body)
496 http.Error(w, "read body failed", http.StatusBadRequest)
499 if err := json.Unmarshal(b, request); err != nil {
500 http.Error(w, "unmarshal data failed", http.StatusBadRequest)
503 reply, err := rpc.OneMapRegisterSetTTL(req.Context(), request)
505 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
508 rep, err := json.MarshalIndent(reply, "", " ")
510 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
515 mux.HandleFunc("/one_map_request_mode", func(w http.ResponseWriter, req *http.Request) {
516 var request = new(OneMapRequestMode)
517 b, err := ioutil.ReadAll(req.Body)
519 http.Error(w, "read body failed", http.StatusBadRequest)
522 if err := json.Unmarshal(b, request); err != nil {
523 http.Error(w, "unmarshal data failed", http.StatusBadRequest)
526 reply, err := rpc.OneMapRequestMode(req.Context(), request)
528 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
531 rep, err := json.MarshalIndent(reply, "", " ")
533 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
538 mux.HandleFunc("/one_ndp_bd_get", func(w http.ResponseWriter, req *http.Request) {
539 var request = new(OneNdpBdGet)
540 reply, err := rpc.OneNdpBdGet(req.Context(), request)
542 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
545 rep, err := json.MarshalIndent(reply, "", " ")
547 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
552 mux.HandleFunc("/one_ndp_entries_get", func(w http.ResponseWriter, req *http.Request) {
553 var request = new(OneNdpEntriesGet)
554 b, err := ioutil.ReadAll(req.Body)
556 http.Error(w, "read body failed", http.StatusBadRequest)
559 if err := json.Unmarshal(b, request); err != nil {
560 http.Error(w, "unmarshal data failed", http.StatusBadRequest)
563 reply, err := rpc.OneNdpEntriesGet(req.Context(), request)
565 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
568 rep, err := json.MarshalIndent(reply, "", " ")
570 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
575 mux.HandleFunc("/one_nsh_set_locator_set", func(w http.ResponseWriter, req *http.Request) {
576 var request = new(OneNshSetLocatorSet)
577 b, err := ioutil.ReadAll(req.Body)
579 http.Error(w, "read body failed", http.StatusBadRequest)
582 if err := json.Unmarshal(b, request); err != nil {
583 http.Error(w, "unmarshal data failed", http.StatusBadRequest)
586 reply, err := rpc.OneNshSetLocatorSet(req.Context(), request)
588 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
591 rep, err := json.MarshalIndent(reply, "", " ")
593 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
598 mux.HandleFunc("/one_pitr_set_locator_set", func(w http.ResponseWriter, req *http.Request) {
599 var request = new(OnePitrSetLocatorSet)
600 b, err := ioutil.ReadAll(req.Body)
602 http.Error(w, "read body failed", http.StatusBadRequest)
605 if err := json.Unmarshal(b, request); err != nil {
606 http.Error(w, "unmarshal data failed", http.StatusBadRequest)
609 reply, err := rpc.OnePitrSetLocatorSet(req.Context(), request)
611 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
614 rep, err := json.MarshalIndent(reply, "", " ")
616 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
621 mux.HandleFunc("/one_rloc_probe_enable_disable", func(w http.ResponseWriter, req *http.Request) {
622 var request = new(OneRlocProbeEnableDisable)
623 b, err := ioutil.ReadAll(req.Body)
625 http.Error(w, "read body failed", http.StatusBadRequest)
628 if err := json.Unmarshal(b, request); err != nil {
629 http.Error(w, "unmarshal data failed", http.StatusBadRequest)
632 reply, err := rpc.OneRlocProbeEnableDisable(req.Context(), request)
634 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
637 rep, err := json.MarshalIndent(reply, "", " ")
639 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
644 mux.HandleFunc("/one_set_transport_protocol", func(w http.ResponseWriter, req *http.Request) {
645 var request = new(OneSetTransportProtocol)
646 b, err := ioutil.ReadAll(req.Body)
648 http.Error(w, "read body failed", http.StatusBadRequest)
651 if err := json.Unmarshal(b, request); err != nil {
652 http.Error(w, "unmarshal data failed", http.StatusBadRequest)
655 reply, err := rpc.OneSetTransportProtocol(req.Context(), request)
657 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
660 rep, err := json.MarshalIndent(reply, "", " ")
662 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
667 mux.HandleFunc("/one_show_petr_mode", func(w http.ResponseWriter, req *http.Request) {
668 var request = new(OneShowPetrMode)
669 reply, err := rpc.OneShowPetrMode(req.Context(), request)
671 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
674 rep, err := json.MarshalIndent(reply, "", " ")
676 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
681 mux.HandleFunc("/one_show_pitr_mode", func(w http.ResponseWriter, req *http.Request) {
682 var request = new(OneShowPitrMode)
683 reply, err := rpc.OneShowPitrMode(req.Context(), request)
685 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
688 rep, err := json.MarshalIndent(reply, "", " ")
690 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
695 mux.HandleFunc("/one_show_xtr_mode", func(w http.ResponseWriter, req *http.Request) {
696 var request = new(OneShowXtrMode)
697 reply, err := rpc.OneShowXtrMode(req.Context(), request)
699 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
702 rep, err := json.MarshalIndent(reply, "", " ")
704 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
709 mux.HandleFunc("/one_stats_enable_disable", func(w http.ResponseWriter, req *http.Request) {
710 var request = new(OneStatsEnableDisable)
711 b, err := ioutil.ReadAll(req.Body)
713 http.Error(w, "read body failed", http.StatusBadRequest)
716 if err := json.Unmarshal(b, request); err != nil {
717 http.Error(w, "unmarshal data failed", http.StatusBadRequest)
720 reply, err := rpc.OneStatsEnableDisable(req.Context(), request)
722 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
725 rep, err := json.MarshalIndent(reply, "", " ")
727 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
732 mux.HandleFunc("/one_stats_flush", func(w http.ResponseWriter, req *http.Request) {
733 var request = new(OneStatsFlush)
734 reply, err := rpc.OneStatsFlush(req.Context(), request)
736 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
739 rep, err := json.MarshalIndent(reply, "", " ")
741 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
746 mux.HandleFunc("/one_use_petr", func(w http.ResponseWriter, req *http.Request) {
747 var request = new(OneUsePetr)
748 b, err := ioutil.ReadAll(req.Body)
750 http.Error(w, "read body failed", http.StatusBadRequest)
753 if err := json.Unmarshal(b, request); err != nil {
754 http.Error(w, "unmarshal data failed", http.StatusBadRequest)
757 reply, err := rpc.OneUsePetr(req.Context(), request)
759 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
762 rep, err := json.MarshalIndent(reply, "", " ")
764 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
769 mux.HandleFunc("/show_one_map_register_fallback_threshold", func(w http.ResponseWriter, req *http.Request) {
770 var request = new(ShowOneMapRegisterFallbackThreshold)
771 reply, err := rpc.ShowOneMapRegisterFallbackThreshold(req.Context(), request)
773 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
776 rep, err := json.MarshalIndent(reply, "", " ")
778 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
783 mux.HandleFunc("/show_one_map_register_state", func(w http.ResponseWriter, req *http.Request) {
784 var request = new(ShowOneMapRegisterState)
785 reply, err := rpc.ShowOneMapRegisterState(req.Context(), request)
787 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
790 rep, err := json.MarshalIndent(reply, "", " ")
792 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
797 mux.HandleFunc("/show_one_map_register_ttl", func(w http.ResponseWriter, req *http.Request) {
798 var request = new(ShowOneMapRegisterTTL)
799 reply, err := rpc.ShowOneMapRegisterTTL(req.Context(), request)
801 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
804 rep, err := json.MarshalIndent(reply, "", " ")
806 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
811 mux.HandleFunc("/show_one_map_request_mode", func(w http.ResponseWriter, req *http.Request) {
812 var request = new(ShowOneMapRequestMode)
813 reply, err := rpc.ShowOneMapRequestMode(req.Context(), request)
815 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
818 rep, err := json.MarshalIndent(reply, "", " ")
820 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
825 mux.HandleFunc("/show_one_nsh_mapping", func(w http.ResponseWriter, req *http.Request) {
826 var request = new(ShowOneNshMapping)
827 reply, err := rpc.ShowOneNshMapping(req.Context(), request)
829 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
832 rep, err := json.MarshalIndent(reply, "", " ")
834 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
839 mux.HandleFunc("/show_one_pitr", func(w http.ResponseWriter, req *http.Request) {
840 var request = new(ShowOnePitr)
841 reply, err := rpc.ShowOnePitr(req.Context(), request)
843 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
846 rep, err := json.MarshalIndent(reply, "", " ")
848 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
853 mux.HandleFunc("/show_one_rloc_probe_state", func(w http.ResponseWriter, req *http.Request) {
854 var request = new(ShowOneRlocProbeState)
855 reply, err := rpc.ShowOneRlocProbeState(req.Context(), request)
857 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
860 rep, err := json.MarshalIndent(reply, "", " ")
862 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
867 mux.HandleFunc("/show_one_stats_enable_disable", func(w http.ResponseWriter, req *http.Request) {
868 var request = new(ShowOneStatsEnableDisable)
869 reply, err := rpc.ShowOneStatsEnableDisable(req.Context(), request)
871 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
874 rep, err := json.MarshalIndent(reply, "", " ")
876 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
881 mux.HandleFunc("/show_one_status", func(w http.ResponseWriter, req *http.Request) {
882 var request = new(ShowOneStatus)
883 reply, err := rpc.ShowOneStatus(req.Context(), request)
885 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
888 rep, err := json.MarshalIndent(reply, "", " ")
890 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
895 mux.HandleFunc("/show_one_use_petr", func(w http.ResponseWriter, req *http.Request) {
896 var request = new(ShowOneUsePetr)
897 reply, err := rpc.ShowOneUsePetr(req.Context(), request)
899 http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
902 rep, err := json.MarshalIndent(reply, "", " ")
904 http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
909 return http.HandlerFunc(mux.ServeHTTP)