added rest endpoint for OLT reboot
Change-Id: If2cf4dee5c03c2c7948fa1ab858c63e1bf26e615
diff --git a/api/bbsim/bbsim.pb.gw.go b/api/bbsim/bbsim.pb.gw.go
index 468670f..acf8fe9 100644
--- a/api/bbsim/bbsim.pb.gw.go
+++ b/api/bbsim/bbsim.pb.gw.go
@@ -85,6 +85,24 @@
}
+func request_BBSim_RebootOlt_0(ctx context.Context, marshaler runtime.Marshaler, client BBSimClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq Empty
+ var metadata runtime.ServerMetadata
+
+ msg, err := client.RebootOlt(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_BBSim_RebootOlt_0(ctx context.Context, marshaler runtime.Marshaler, server BBSimServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq Empty
+ var metadata runtime.ServerMetadata
+
+ msg, err := server.RebootOlt(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
func request_BBSim_GetONU_0(ctx context.Context, marshaler runtime.Marshaler, client BBSimClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ONURequest
var metadata runtime.ServerMetadata
@@ -826,6 +844,26 @@
})
+ mux.Handle("POST", pattern_BBSim_RebootOlt_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_BBSim_RebootOlt_0(rctx, inboundMarshaler, server, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_BBSim_RebootOlt_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
mux.Handle("GET", pattern_BBSim_GetONU_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -1187,6 +1225,26 @@
})
+ mux.Handle("POST", pattern_BBSim_RebootOlt_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ rctx, err := runtime.AnnotateContext(ctx, mux, req)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_BBSim_RebootOlt_0(rctx, inboundMarshaler, client, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_BBSim_RebootOlt_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
mux.Handle("GET", pattern_BBSim_GetONU_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -1457,6 +1515,8 @@
pattern_BBSim_GetOlt_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "olt", "status"}, "", runtime.AssumeColonVerbOpt(true)))
+ pattern_BBSim_RebootOlt_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "olt", "reboot"}, "", runtime.AssumeColonVerbOpt(true)))
+
pattern_BBSim_GetONU_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "olt", "onus", "SerialNumber"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_BBSim_GetONUs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "olt", "onus"}, "", runtime.AssumeColonVerbOpt(true)))
@@ -1491,6 +1551,8 @@
forward_BBSim_GetOlt_1 = runtime.ForwardResponseMessage
+ forward_BBSim_RebootOlt_0 = runtime.ForwardResponseMessage
+
forward_BBSim_GetONU_0 = runtime.ForwardResponseMessage
forward_BBSim_GetONUs_0 = runtime.ForwardResponseMessage
diff --git a/api/bbsim/bbsim.yaml b/api/bbsim/bbsim.yaml
index 2661cfb..5101d08 100644
--- a/api/bbsim/bbsim.yaml
+++ b/api/bbsim/bbsim.yaml
@@ -23,6 +23,8 @@
get: "/v1/olt"
additional_bindings:
- get: "/v1/olt/status"
+ - selector: bbsim.BBSim.RebootOlt
+ post: "/v1/olt/reboot"
- selector: bbsim.BBSim.GetONUs
get: "/v1/olt/onus"