Merge "Exposing ONU restart EAPOL/DHCP/IGMP endpoints"
diff --git a/api/bbsim/bbsim.pb.gw.go b/api/bbsim/bbsim.pb.gw.go
index acf8fe9..1826d3b 100644
--- a/api/bbsim/bbsim.pb.gw.go
+++ b/api/bbsim/bbsim.pb.gw.go
@@ -427,6 +427,114 @@
}
+func request_BBSim_RestartEapol_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
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["SerialNumber"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "SerialNumber")
+ }
+
+ protoReq.SerialNumber, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "SerialNumber", err)
+ }
+
+ msg, err := client.RestartEapol(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_BBSim_RestartEapol_0(ctx context.Context, marshaler runtime.Marshaler, server BBSimServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq ONURequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["SerialNumber"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "SerialNumber")
+ }
+
+ protoReq.SerialNumber, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "SerialNumber", err)
+ }
+
+ msg, err := server.RestartEapol(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
+func request_BBSim_RestartDhcp_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
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["SerialNumber"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "SerialNumber")
+ }
+
+ protoReq.SerialNumber, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "SerialNumber", err)
+ }
+
+ msg, err := client.RestartDhcp(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_BBSim_RestartDhcp_0(ctx context.Context, marshaler runtime.Marshaler, server BBSimServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq ONURequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["SerialNumber"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "SerialNumber")
+ }
+
+ protoReq.SerialNumber, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "SerialNumber", err)
+ }
+
+ msg, err := server.RestartDhcp(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
var (
filter_BBSim_SetOnuAlarmIndication_0 = &utilities.DoubleArray{Encoding: map[string]int{"SerialNumber": 0, "AlarmType": 1, "Status": 2}, Base: []int{1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 1, 1, 2, 3, 4}}
)
@@ -725,6 +833,125 @@
}
+var (
+ filter_BBSim_ChangeIgmpState_0 = &utilities.DoubleArray{Encoding: map[string]int{"OnuReq": 0, "SerialNumber": 1, "SubActionVal": 2, "GroupAddress": 3}, Base: []int{1, 1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 2, 1, 1, 3, 4, 5}}
+)
+
+func request_BBSim_ChangeIgmpState_0(ctx context.Context, marshaler runtime.Marshaler, client BBSimClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq IgmpRequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ e int32
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["OnuReq.SerialNumber"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "OnuReq.SerialNumber")
+ }
+
+ err = runtime.PopulateFieldFromPath(&protoReq, "OnuReq.SerialNumber", val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "OnuReq.SerialNumber", err)
+ }
+
+ val, ok = pathParams["SubActionVal"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "SubActionVal")
+ }
+
+ e, err = runtime.Enum(val, SubActionTypes_value)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "SubActionVal", err)
+ }
+
+ protoReq.SubActionVal = SubActionTypes(e)
+
+ val, ok = pathParams["GroupAddress"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "GroupAddress")
+ }
+
+ protoReq.GroupAddress, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "GroupAddress", err)
+ }
+
+ if err := req.ParseForm(); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BBSim_ChangeIgmpState_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := client.ChangeIgmpState(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_BBSim_ChangeIgmpState_0(ctx context.Context, marshaler runtime.Marshaler, server BBSimServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq IgmpRequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ e int32
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["OnuReq.SerialNumber"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "OnuReq.SerialNumber")
+ }
+
+ err = runtime.PopulateFieldFromPath(&protoReq, "OnuReq.SerialNumber", val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "OnuReq.SerialNumber", err)
+ }
+
+ val, ok = pathParams["SubActionVal"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "SubActionVal")
+ }
+
+ e, err = runtime.Enum(val, SubActionTypes_value)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "SubActionVal", err)
+ }
+
+ protoReq.SubActionVal = SubActionTypes(e)
+
+ val, ok = pathParams["GroupAddress"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "GroupAddress")
+ }
+
+ protoReq.GroupAddress, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "GroupAddress", err)
+ }
+
+ if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_BBSim_ChangeIgmpState_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := server.ChangeIgmpState(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
func request_BBSim_GetOnuTrafficSchedulers_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
@@ -1024,6 +1251,46 @@
})
+ mux.Handle("POST", pattern_BBSim_RestartEapol_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_RestartEapol_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_RestartEapol_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("POST", pattern_BBSim_RestartDhcp_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_RestartDhcp_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_RestartDhcp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
mux.Handle("POST", pattern_BBSim_SetOnuAlarmIndication_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -1104,6 +1371,26 @@
})
+ mux.Handle("POST", pattern_BBSim_ChangeIgmpState_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_ChangeIgmpState_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_ChangeIgmpState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
mux.Handle("GET", pattern_BBSim_GetOnuTrafficSchedulers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -1405,6 +1692,46 @@
})
+ mux.Handle("POST", pattern_BBSim_RestartEapol_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_RestartEapol_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_RestartEapol_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("POST", pattern_BBSim_RestartDhcp_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_RestartDhcp_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_RestartDhcp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
mux.Handle("POST", pattern_BBSim_SetOnuAlarmIndication_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -1485,6 +1812,26 @@
})
+ mux.Handle("POST", pattern_BBSim_ChangeIgmpState_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_ChangeIgmpState_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_ChangeIgmpState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
mux.Handle("GET", pattern_BBSim_GetOnuTrafficSchedulers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -1533,6 +1880,10 @@
pattern_BBSim_PoweronONUsOnPON_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"v1", "olt", "port", "PonPortId", "onus"}, "", runtime.AssumeColonVerbOpt(true)))
+ pattern_BBSim_RestartEapol_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"v1", "olt", "onus", "SerialNumber", "eapol"}, "", runtime.AssumeColonVerbOpt(true)))
+
+ pattern_BBSim_RestartDhcp_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"v1", "olt", "onus", "SerialNumber", "dhcp"}, "", runtime.AssumeColonVerbOpt(true)))
+
pattern_BBSim_SetOnuAlarmIndication_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6}, []string{"v1", "olt", "onus", "SerialNumber", "alarms", "AlarmType", "Status"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_BBSim_SetOltAlarmIndication_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4, 2, 5, 2, 6, 1, 0, 4, 1, 5, 7}, []string{"v1", "olt", "ports", "InterfaceType", "InterfaceID", "alarms", "los", "Status"}, "", runtime.AssumeColonVerbOpt(true)))
@@ -1541,6 +1892,8 @@
pattern_BBSim_GetFlows_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "olt", "flows"}, "", runtime.AssumeColonVerbOpt(true)))
+ pattern_BBSim_ChangeIgmpState_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6}, []string{"v1", "olt", "onus", "OnuReq.SerialNumber", "igmp", "SubActionVal", "GroupAddress"}, "", runtime.AssumeColonVerbOpt(true)))
+
pattern_BBSim_GetOnuTrafficSchedulers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"v1", "olt", "onus", "SerialNumber", "trafficschedulers"}, "", runtime.AssumeColonVerbOpt(true)))
)
@@ -1569,6 +1922,10 @@
forward_BBSim_PoweronONUsOnPON_0 = runtime.ForwardResponseMessage
+ forward_BBSim_RestartEapol_0 = runtime.ForwardResponseMessage
+
+ forward_BBSim_RestartDhcp_0 = runtime.ForwardResponseMessage
+
forward_BBSim_SetOnuAlarmIndication_0 = runtime.ForwardResponseMessage
forward_BBSim_SetOltAlarmIndication_0 = runtime.ForwardResponseMessage
@@ -1577,5 +1934,7 @@
forward_BBSim_GetFlows_1 = runtime.ForwardResponseMessage
+ forward_BBSim_ChangeIgmpState_0 = runtime.ForwardResponseMessage
+
forward_BBSim_GetOnuTrafficSchedulers_0 = runtime.ForwardResponseMessage
)
diff --git a/api/bbsim/bbsim.yaml b/api/bbsim/bbsim.yaml
index 5101d08..aacc160 100644
--- a/api/bbsim/bbsim.yaml
+++ b/api/bbsim/bbsim.yaml
@@ -52,6 +52,13 @@
- selector: bbsim.BBSim.GetOnuTrafficSchedulers
get: "/v1/olt/onus/{SerialNumber}/trafficschedulers"
+ - selector: bbsim.BBSim.RestartEapol
+ post: "/v1/olt/onus/{SerialNumber}/eapol"
+ - selector: bbsim.BBSim.RestartDhcp
+ post: "/v1/olt/onus/{SerialNumber}/dhcp"
+ - selector: bbsim.BBSim.ChangeIgmpState
+ post: "/v1/olt/onus/{OnuReq.SerialNumber}/igmp/{SubActionVal}/{GroupAddress}"
+
- selector: bbsim.BBSim.SetOnuAlarmIndication
post: "/v1/olt/onus/{SerialNumber}/alarms/{AlarmType}/{Status}"
- selector: bbsim.BBSim.SetOltAlarmIndication
diff --git a/docs/swagger/bbsim/bbsim.swagger.json b/docs/swagger/bbsim/bbsim.swagger.json
index 6dbd843..e88ce97 100644
--- a/docs/swagger/bbsim/bbsim.swagger.json
+++ b/docs/swagger/bbsim/bbsim.swagger.json
@@ -100,6 +100,39 @@
]
}
},
+ "/v1/olt/onus/{OnuReq.SerialNumber}/igmp": {
+ "post": {
+ "summary": "Change IGMP state",
+ "operationId": "ChangeIgmpState",
+ "responses": {
+ "200": {
+ "description": "A successful response.",
+ "schema": {
+ "$ref": "#/definitions/bbsimResponse"
+ }
+ }
+ },
+ "parameters": [
+ {
+ "name": "OnuReq.SerialNumber",
+ "in": "path",
+ "required": true,
+ "type": "string"
+ },
+ {
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "tags": [
+ "BBSim"
+ ]
+ }
+ },
"/v1/olt/onus/{SerialNumber}": {
"get": {
"summary": "Get status of an ONU by serial number",
@@ -208,6 +241,56 @@
]
}
},
+ "/v1/olt/onus/{SerialNumber}/dhcp": {
+ "post": {
+ "summary": "Restart DHCP for ONU",
+ "operationId": "RestartDhcp",
+ "responses": {
+ "200": {
+ "description": "A successful response.",
+ "schema": {
+ "$ref": "#/definitions/bbsimResponse"
+ }
+ }
+ },
+ "parameters": [
+ {
+ "name": "SerialNumber",
+ "in": "path",
+ "required": true,
+ "type": "string"
+ }
+ ],
+ "tags": [
+ "BBSim"
+ ]
+ }
+ },
+ "/v1/olt/onus/{SerialNumber}/eapol": {
+ "post": {
+ "summary": "Restart EAPOL for ONU",
+ "operationId": "RestartEapol",
+ "responses": {
+ "200": {
+ "description": "A successful response.",
+ "schema": {
+ "$ref": "#/definitions/bbsimResponse"
+ }
+ }
+ },
+ "parameters": [
+ {
+ "name": "SerialNumber",
+ "in": "path",
+ "required": true,
+ "type": "string"
+ }
+ ],
+ "tags": [
+ "BBSim"
+ ]
+ }
+ },
"/v1/olt/onus/{SerialNumber}/flows": {
"get": {
"summary": "Get all flows or ONU specific flows",
@@ -808,8 +891,12 @@
"format": "int32"
},
"flow_id": {
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "uint64"
+ },
+ "symmetric_flow_id": {
+ "type": "string",
+ "format": "uint64"
},
"flow_type": {
"type": "string"
@@ -851,6 +938,17 @@
"tech_profile_id": {
"type": "integer",
"format": "int64"
+ },
+ "replicate_flow": {
+ "type": "boolean",
+ "format": "boolean"
+ },
+ "pbit_to_gemport": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer",
+ "format": "int64"
+ }
}
}
},
diff --git a/docs/swagger/legacy/bbsim.swagger.json b/docs/swagger/legacy/bbsim.swagger.json
index 81e09f6..1f6b60d 100644
--- a/docs/swagger/legacy/bbsim.swagger.json
+++ b/docs/swagger/legacy/bbsim.swagger.json
@@ -1525,8 +1525,12 @@
"format": "int32"
},
"flow_id": {
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "uint64"
+ },
+ "symmetric_flow_id": {
+ "type": "string",
+ "format": "uint64"
},
"flow_type": {
"type": "string"
@@ -1568,6 +1572,17 @@
"tech_profile_id": {
"type": "integer",
"format": "int64"
+ },
+ "replicate_flow": {
+ "type": "boolean",
+ "format": "boolean"
+ },
+ "pbit_to_gemport": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer",
+ "format": "int64"
+ }
}
}
},
diff --git a/internal/bbsim/api/onus_handler.go b/internal/bbsim/api/onus_handler.go
index 2533fa3..276cddb 100644
--- a/internal/bbsim/api/onus_handler.go
+++ b/internal/bbsim/api/onus_handler.go
@@ -234,7 +234,7 @@
"OnuSn": req.OnuReq.SerialNumber,
"subAction": req.SubActionVal,
"GroupAddress": req.GroupAddress,
- }).Infof("Received igmp request for ONU")
+ }).Info("Received igmp request for ONU")
olt := devices.GetOLT()
onu, err := olt.FindOnuBySn(req.OnuReq.SerialNumber)
@@ -242,7 +242,11 @@
if err != nil {
res.StatusCode = int32(codes.NotFound)
res.Message = err.Error()
- fmt.Println("ONU not found for sending igmp packet.")
+ logger.WithFields(log.Fields{
+ "OnuSn": req.OnuReq.SerialNumber,
+ "subAction": req.SubActionVal,
+ "GroupAddress": req.GroupAddress,
+ }).Warn("ONU not found for sending igmp packet.")
return res, err
} else {
event := ""
@@ -286,12 +290,29 @@
if success {
res.StatusCode = int32(codes.OK)
- res.Message = fmt.Sprintf("Authentication restarted on Services %s for ONU %s.",
- fmt.Sprintf("%v", startedOn), onu.Sn())
+ if len(startedOn) > 0 {
+ res.Message = fmt.Sprintf("IGMP %s sent on Services %s for ONU %s.",
+ event, fmt.Sprintf("%v", startedOn), onu.Sn())
+ } else {
+ res.Message = "No service requires IGMP"
+ }
+ logger.WithFields(log.Fields{
+ "OnuSn": req.OnuReq.SerialNumber,
+ "subAction": req.SubActionVal,
+ "GroupAddress": req.GroupAddress,
+ "Message": res.Message,
+ }).Info("Processed IGMP request for ONU")
} else {
res.StatusCode = int32(codes.FailedPrecondition)
res.Message = fmt.Sprintf("%v", errors)
+ logger.WithFields(log.Fields{
+ "OnuSn": req.OnuReq.SerialNumber,
+ "subAction": req.SubActionVal,
+ "GroupAddress": req.GroupAddress,
+ "Message": res.Message,
+ }).Error("Error while processing IGMP request for ONU")
}
+
}
return res, nil
@@ -337,11 +358,24 @@
if success {
res.StatusCode = int32(codes.OK)
- res.Message = fmt.Sprintf("Authentication restarted on Services %s for ONU %s.",
- fmt.Sprintf("%v", startedOn), onu.Sn())
+ if len(startedOn) > 0 {
+ res.Message = fmt.Sprintf("Authentication restarted on Services %s for ONU %s.",
+ fmt.Sprintf("%v", startedOn), onu.Sn())
+ } else {
+ res.Message = "No service requires EAPOL"
+ }
+
+ logger.WithFields(log.Fields{
+ "OnuSn": req.SerialNumber,
+ "Message": res.Message,
+ }).Info("Processed EAPOL restart request for ONU")
} else {
res.StatusCode = int32(codes.FailedPrecondition)
res.Message = fmt.Sprintf("%v", errors)
+ logger.WithFields(log.Fields{
+ "OnuSn": req.SerialNumber,
+ "Message": res.Message,
+ }).Error("Error while processing DHCP restart request for ONU")
}
return res, nil
@@ -388,11 +422,24 @@
if success {
res.StatusCode = int32(codes.OK)
- res.Message = fmt.Sprintf("DHCP restarted on Services %s for ONU %s.",
- fmt.Sprintf("%v", startedOn), onu.Sn())
+ if len(startedOn) > 0 {
+ res.Message = fmt.Sprintf("DHCP restarted on Services %s for ONU %s.",
+ fmt.Sprintf("%v", startedOn), onu.Sn())
+
+ } else {
+ res.Message = "No service requires DHCP"
+ }
+ logger.WithFields(log.Fields{
+ "OnuSn": req.SerialNumber,
+ "Message": res.Message,
+ }).Info("Processed DHCP restart request for ONU")
} else {
res.StatusCode = int32(codes.FailedPrecondition)
res.Message = fmt.Sprintf("%v", errors)
+ logger.WithFields(log.Fields{
+ "OnuSn": req.SerialNumber,
+ "Message": res.Message,
+ }).Error("Error while processing DHCP restart request for ONU")
}
return res, nil