SEBA-941 updated apis to poweron/shutdown all ONUs in PON/OLT
Change-Id: I6923cbcc51a4391f70ff08d266c274e1f34ca3ca
diff --git a/api/bbsim/bbsim.pb.go b/api/bbsim/bbsim.pb.go
index c9ffa1c..4da2e87 100644
--- a/api/bbsim/bbsim.pb.go
+++ b/api/bbsim/bbsim.pb.go
@@ -10,6 +10,8 @@
openolt "github.com/opencord/voltha-protos/v2/go/openolt"
tech_profile "github.com/opencord/voltha-protos/v2/go/tech_profile"
grpc "google.golang.org/grpc"
+ codes "google.golang.org/grpc/codes"
+ status "google.golang.org/grpc/status"
math "math"
)
@@ -129,7 +131,7 @@
}
func (AlarmType_Types) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_ef7750073d18011b, []int{7, 0}
+ return fileDescriptor_ef7750073d18011b, []int{8, 0}
}
type PONPort struct {
@@ -533,6 +535,45 @@
return ""
}
+type PONRequest struct {
+ PonPortId uint32 `protobuf:"varint,1,opt,name=PonPortId,proto3" json:"PonPortId,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *PONRequest) Reset() { *m = PONRequest{} }
+func (m *PONRequest) String() string { return proto.CompactTextString(m) }
+func (*PONRequest) ProtoMessage() {}
+func (*PONRequest) Descriptor() ([]byte, []int) {
+ return fileDescriptor_ef7750073d18011b, []int{7}
+}
+
+func (m *PONRequest) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_PONRequest.Unmarshal(m, b)
+}
+func (m *PONRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_PONRequest.Marshal(b, m, deterministic)
+}
+func (m *PONRequest) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_PONRequest.Merge(m, src)
+}
+func (m *PONRequest) XXX_Size() int {
+ return xxx_messageInfo_PONRequest.Size(m)
+}
+func (m *PONRequest) XXX_DiscardUnknown() {
+ xxx_messageInfo_PONRequest.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_PONRequest proto.InternalMessageInfo
+
+func (m *PONRequest) GetPonPortId() uint32 {
+ if m != nil {
+ return m.PonPortId
+ }
+ return 0
+}
+
type AlarmType struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
@@ -543,7 +584,7 @@
func (m *AlarmType) String() string { return proto.CompactTextString(m) }
func (*AlarmType) ProtoMessage() {}
func (*AlarmType) Descriptor() ([]byte, []int) {
- return fileDescriptor_ef7750073d18011b, []int{7}
+ return fileDescriptor_ef7750073d18011b, []int{8}
}
func (m *AlarmType) XXX_Unmarshal(b []byte) error {
@@ -576,7 +617,7 @@
func (m *AlarmParameter) String() string { return proto.CompactTextString(m) }
func (*AlarmParameter) ProtoMessage() {}
func (*AlarmParameter) Descriptor() ([]byte, []int) {
- return fileDescriptor_ef7750073d18011b, []int{8}
+ return fileDescriptor_ef7750073d18011b, []int{9}
}
func (m *AlarmParameter) XXX_Unmarshal(b []byte) error {
@@ -628,7 +669,7 @@
func (m *ONUAlarmRequest) String() string { return proto.CompactTextString(m) }
func (*ONUAlarmRequest) ProtoMessage() {}
func (*ONUAlarmRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_ef7750073d18011b, []int{9}
+ return fileDescriptor_ef7750073d18011b, []int{10}
}
func (m *ONUAlarmRequest) XXX_Unmarshal(b []byte) error {
@@ -691,7 +732,7 @@
func (m *OLTAlarmRequest) String() string { return proto.CompactTextString(m) }
func (*OLTAlarmRequest) ProtoMessage() {}
func (*OLTAlarmRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_ef7750073d18011b, []int{10}
+ return fileDescriptor_ef7750073d18011b, []int{11}
}
func (m *OLTAlarmRequest) XXX_Unmarshal(b []byte) error {
@@ -747,7 +788,7 @@
func (m *VersionNumber) String() string { return proto.CompactTextString(m) }
func (*VersionNumber) ProtoMessage() {}
func (*VersionNumber) Descriptor() ([]byte, []int) {
- return fileDescriptor_ef7750073d18011b, []int{11}
+ return fileDescriptor_ef7750073d18011b, []int{12}
}
func (m *VersionNumber) XXX_Unmarshal(b []byte) error {
@@ -808,7 +849,7 @@
func (m *LogLevel) String() string { return proto.CompactTextString(m) }
func (*LogLevel) ProtoMessage() {}
func (*LogLevel) Descriptor() ([]byte, []int) {
- return fileDescriptor_ef7750073d18011b, []int{12}
+ return fileDescriptor_ef7750073d18011b, []int{13}
}
func (m *LogLevel) XXX_Unmarshal(b []byte) error {
@@ -855,7 +896,7 @@
func (m *Response) String() string { return proto.CompactTextString(m) }
func (*Response) ProtoMessage() {}
func (*Response) Descriptor() ([]byte, []int) {
- return fileDescriptor_ef7750073d18011b, []int{13}
+ return fileDescriptor_ef7750073d18011b, []int{14}
}
func (m *Response) XXX_Unmarshal(b []byte) error {
@@ -902,7 +943,7 @@
func (m *IgmpRequest) String() string { return proto.CompactTextString(m) }
func (*IgmpRequest) ProtoMessage() {}
func (*IgmpRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_ef7750073d18011b, []int{14}
+ return fileDescriptor_ef7750073d18011b, []int{15}
}
func (m *IgmpRequest) XXX_Unmarshal(b []byte) error {
@@ -949,7 +990,7 @@
func (m *Flows) String() string { return proto.CompactTextString(m) }
func (*Flows) ProtoMessage() {}
func (*Flows) Descriptor() ([]byte, []int) {
- return fileDescriptor_ef7750073d18011b, []int{15}
+ return fileDescriptor_ef7750073d18011b, []int{16}
}
func (m *Flows) XXX_Unmarshal(b []byte) error {
@@ -994,7 +1035,7 @@
func (m *Empty) String() string { return proto.CompactTextString(m) }
func (*Empty) ProtoMessage() {}
func (*Empty) Descriptor() ([]byte, []int) {
- return fileDescriptor_ef7750073d18011b, []int{16}
+ return fileDescriptor_ef7750073d18011b, []int{17}
}
func (m *Empty) XXX_Unmarshal(b []byte) error {
@@ -1025,6 +1066,7 @@
proto.RegisterType((*ONUTrafficSchedulers)(nil), "bbsim.ONUTrafficSchedulers")
proto.RegisterType((*ONUs)(nil), "bbsim.ONUs")
proto.RegisterType((*ONURequest)(nil), "bbsim.ONURequest")
+ proto.RegisterType((*PONRequest)(nil), "bbsim.PONRequest")
proto.RegisterType((*AlarmType)(nil), "bbsim.AlarmType")
proto.RegisterType((*AlarmParameter)(nil), "bbsim.AlarmParameter")
proto.RegisterType((*ONUAlarmRequest)(nil), "bbsim.ONUAlarmRequest")
@@ -1040,113 +1082,120 @@
func init() { proto.RegisterFile("api/bbsim/bbsim.proto", fileDescriptor_ef7750073d18011b) }
var fileDescriptor_ef7750073d18011b = []byte{
- // 1297 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0xcb, 0x6e, 0xdb, 0x46,
- 0x17, 0xd6, 0xc5, 0xba, 0x1d, 0x59, 0x32, 0x3d, 0x89, 0x1d, 0xc2, 0xf1, 0xff, 0x47, 0x60, 0xd3,
- 0xc2, 0x09, 0x1a, 0xa7, 0xb1, 0x5b, 0x34, 0x5d, 0xd2, 0x12, 0xad, 0xb0, 0x96, 0x49, 0x61, 0x48,
- 0x39, 0xc8, 0x8a, 0xa0, 0xa4, 0xb1, 0x45, 0x80, 0x12, 0x15, 0x72, 0x14, 0x23, 0xeb, 0xa2, 0x2f,
- 0xd2, 0x27, 0xea, 0x13, 0x74, 0xd7, 0x87, 0xe8, 0xae, 0x98, 0xe1, 0x90, 0x22, 0x2d, 0xa7, 0x30,
- 0xba, 0xe9, 0x46, 0xe0, 0xf9, 0xce, 0x77, 0xee, 0x87, 0x47, 0x84, 0x3d, 0x77, 0xe9, 0xbd, 0x1e,
- 0x8f, 0x23, 0x6f, 0x1e, 0xff, 0x1e, 0x2f, 0xc3, 0x80, 0x06, 0xa8, 0xc2, 0x85, 0x83, 0xa7, 0x9f,
- 0x02, 0x9f, 0xce, 0x5c, 0x87, 0x83, 0xd1, 0xeb, 0x60, 0x49, 0x16, 0x81, 0x4f, 0x63, 0xce, 0x41,
- 0x27, 0xaf, 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, 0x00, 0xff,
+ 0xff, 0x42, 0x70, 0xbe, 0x17, 0x42, 0x0d, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
-var _ grpc.ClientConn
+var _ grpc.ClientConnInterface
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
-const _ = grpc.SupportPackageIsVersion4
+const _ = grpc.SupportPackageIsVersion6
// BBSimClient is the client API for BBSim service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type BBSimClient interface {
Version(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*VersionNumber, error)
+ SetLogLevel(ctx context.Context, in *LogLevel, opts ...grpc.CallOption) (*LogLevel, error)
GetOlt(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Olt, error)
PoweronOlt(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Response, error)
ShutdownOlt(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Response, error)
RebootOlt(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Response, error)
- GetONUs(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ONUs, error)
GetONU(ctx context.Context, in *ONURequest, opts ...grpc.CallOption) (*ONU, error)
- SetLogLevel(ctx context.Context, in *LogLevel, opts ...grpc.CallOption) (*LogLevel, error)
+ GetONUs(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ONUs, error)
ShutdownONU(ctx context.Context, in *ONURequest, opts ...grpc.CallOption) (*Response, error)
+ ShutdownAllONUs(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Response, error)
+ ShutdownONUsOnPON(ctx context.Context, in *PONRequest, opts ...grpc.CallOption) (*Response, error)
PoweronONU(ctx context.Context, in *ONURequest, opts ...grpc.CallOption) (*Response, error)
+ PoweronAllONUs(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Response, error)
+ PoweronONUsOnPON(ctx context.Context, in *PONRequest, opts ...grpc.CallOption) (*Response, error)
RestartEapol(ctx context.Context, in *ONURequest, opts ...grpc.CallOption) (*Response, error)
RestartDhcp(ctx context.Context, in *ONURequest, opts ...grpc.CallOption) (*Response, error)
SetOnuAlarmIndication(ctx context.Context, in *ONUAlarmRequest, opts ...grpc.CallOption) (*Response, error)
@@ -1157,10 +1206,10 @@
}
type bBSimClient struct {
- cc *grpc.ClientConn
+ cc grpc.ClientConnInterface
}
-func NewBBSimClient(cc *grpc.ClientConn) BBSimClient {
+func NewBBSimClient(cc grpc.ClientConnInterface) BBSimClient {
return &bBSimClient{cc}
}
@@ -1173,6 +1222,15 @@
return out, nil
}
+func (c *bBSimClient) SetLogLevel(ctx context.Context, in *LogLevel, opts ...grpc.CallOption) (*LogLevel, error) {
+ out := new(LogLevel)
+ err := c.cc.Invoke(ctx, "/bbsim.BBSim/SetLogLevel", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
func (c *bBSimClient) GetOlt(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Olt, error) {
out := new(Olt)
err := c.cc.Invoke(ctx, "/bbsim.BBSim/GetOlt", in, out, opts...)
@@ -1209,15 +1267,6 @@
return out, nil
}
-func (c *bBSimClient) GetONUs(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ONUs, error) {
- out := new(ONUs)
- err := c.cc.Invoke(ctx, "/bbsim.BBSim/GetONUs", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
func (c *bBSimClient) GetONU(ctx context.Context, in *ONURequest, opts ...grpc.CallOption) (*ONU, error) {
out := new(ONU)
err := c.cc.Invoke(ctx, "/bbsim.BBSim/GetONU", in, out, opts...)
@@ -1227,9 +1276,9 @@
return out, nil
}
-func (c *bBSimClient) SetLogLevel(ctx context.Context, in *LogLevel, opts ...grpc.CallOption) (*LogLevel, error) {
- out := new(LogLevel)
- err := c.cc.Invoke(ctx, "/bbsim.BBSim/SetLogLevel", in, out, opts...)
+func (c *bBSimClient) GetONUs(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ONUs, error) {
+ out := new(ONUs)
+ err := c.cc.Invoke(ctx, "/bbsim.BBSim/GetONUs", in, out, opts...)
if err != nil {
return nil, err
}
@@ -1245,6 +1294,24 @@
return out, nil
}
+func (c *bBSimClient) ShutdownAllONUs(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Response, error) {
+ out := new(Response)
+ err := c.cc.Invoke(ctx, "/bbsim.BBSim/ShutdownAllONUs", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *bBSimClient) ShutdownONUsOnPON(ctx context.Context, in *PONRequest, opts ...grpc.CallOption) (*Response, error) {
+ out := new(Response)
+ err := c.cc.Invoke(ctx, "/bbsim.BBSim/ShutdownONUsOnPON", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
func (c *bBSimClient) PoweronONU(ctx context.Context, in *ONURequest, opts ...grpc.CallOption) (*Response, error) {
out := new(Response)
err := c.cc.Invoke(ctx, "/bbsim.BBSim/PoweronONU", in, out, opts...)
@@ -1254,6 +1321,24 @@
return out, nil
}
+func (c *bBSimClient) PoweronAllONUs(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Response, error) {
+ out := new(Response)
+ err := c.cc.Invoke(ctx, "/bbsim.BBSim/PoweronAllONUs", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *bBSimClient) PoweronONUsOnPON(ctx context.Context, in *PONRequest, opts ...grpc.CallOption) (*Response, error) {
+ out := new(Response)
+ err := c.cc.Invoke(ctx, "/bbsim.BBSim/PoweronONUsOnPON", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
func (c *bBSimClient) RestartEapol(ctx context.Context, in *ONURequest, opts ...grpc.CallOption) (*Response, error) {
out := new(Response)
err := c.cc.Invoke(ctx, "/bbsim.BBSim/RestartEapol", in, out, opts...)
@@ -1320,15 +1405,19 @@
// BBSimServer is the server API for BBSim service.
type BBSimServer interface {
Version(context.Context, *Empty) (*VersionNumber, error)
+ SetLogLevel(context.Context, *LogLevel) (*LogLevel, error)
GetOlt(context.Context, *Empty) (*Olt, error)
PoweronOlt(context.Context, *Empty) (*Response, error)
ShutdownOlt(context.Context, *Empty) (*Response, error)
RebootOlt(context.Context, *Empty) (*Response, error)
- GetONUs(context.Context, *Empty) (*ONUs, error)
GetONU(context.Context, *ONURequest) (*ONU, error)
- SetLogLevel(context.Context, *LogLevel) (*LogLevel, error)
+ GetONUs(context.Context, *Empty) (*ONUs, error)
ShutdownONU(context.Context, *ONURequest) (*Response, error)
+ ShutdownAllONUs(context.Context, *Empty) (*Response, error)
+ ShutdownONUsOnPON(context.Context, *PONRequest) (*Response, error)
PoweronONU(context.Context, *ONURequest) (*Response, error)
+ PoweronAllONUs(context.Context, *Empty) (*Response, error)
+ PoweronONUsOnPON(context.Context, *PONRequest) (*Response, error)
RestartEapol(context.Context, *ONURequest) (*Response, error)
RestartDhcp(context.Context, *ONURequest) (*Response, error)
SetOnuAlarmIndication(context.Context, *ONUAlarmRequest) (*Response, error)
@@ -1338,6 +1427,74 @@
GetOnuTrafficSchedulers(context.Context, *ONURequest) (*ONUTrafficSchedulers, error)
}
+// UnimplementedBBSimServer can be embedded to have forward compatible implementations.
+type UnimplementedBBSimServer struct {
+}
+
+func (*UnimplementedBBSimServer) Version(ctx context.Context, req *Empty) (*VersionNumber, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method Version not implemented")
+}
+func (*UnimplementedBBSimServer) SetLogLevel(ctx context.Context, req *LogLevel) (*LogLevel, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method SetLogLevel not implemented")
+}
+func (*UnimplementedBBSimServer) GetOlt(ctx context.Context, req *Empty) (*Olt, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method GetOlt not implemented")
+}
+func (*UnimplementedBBSimServer) PoweronOlt(ctx context.Context, req *Empty) (*Response, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method PoweronOlt not implemented")
+}
+func (*UnimplementedBBSimServer) ShutdownOlt(ctx context.Context, req *Empty) (*Response, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method ShutdownOlt not implemented")
+}
+func (*UnimplementedBBSimServer) RebootOlt(ctx context.Context, req *Empty) (*Response, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method RebootOlt not implemented")
+}
+func (*UnimplementedBBSimServer) GetONU(ctx context.Context, req *ONURequest) (*ONU, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method GetONU not implemented")
+}
+func (*UnimplementedBBSimServer) GetONUs(ctx context.Context, req *Empty) (*ONUs, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method GetONUs not implemented")
+}
+func (*UnimplementedBBSimServer) ShutdownONU(ctx context.Context, req *ONURequest) (*Response, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method ShutdownONU not implemented")
+}
+func (*UnimplementedBBSimServer) ShutdownAllONUs(ctx context.Context, req *Empty) (*Response, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method ShutdownAllONUs not implemented")
+}
+func (*UnimplementedBBSimServer) ShutdownONUsOnPON(ctx context.Context, req *PONRequest) (*Response, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method ShutdownONUsOnPON not implemented")
+}
+func (*UnimplementedBBSimServer) PoweronONU(ctx context.Context, req *ONURequest) (*Response, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method PoweronONU not implemented")
+}
+func (*UnimplementedBBSimServer) PoweronAllONUs(ctx context.Context, req *Empty) (*Response, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method PoweronAllONUs not implemented")
+}
+func (*UnimplementedBBSimServer) PoweronONUsOnPON(ctx context.Context, req *PONRequest) (*Response, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method PoweronONUsOnPON not implemented")
+}
+func (*UnimplementedBBSimServer) RestartEapol(ctx context.Context, req *ONURequest) (*Response, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method RestartEapol not implemented")
+}
+func (*UnimplementedBBSimServer) RestartDhcp(ctx context.Context, req *ONURequest) (*Response, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method RestartDhcp not implemented")
+}
+func (*UnimplementedBBSimServer) SetOnuAlarmIndication(ctx context.Context, req *ONUAlarmRequest) (*Response, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method SetOnuAlarmIndication not implemented")
+}
+func (*UnimplementedBBSimServer) SetOltAlarmIndication(ctx context.Context, req *OLTAlarmRequest) (*Response, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method SetOltAlarmIndication not implemented")
+}
+func (*UnimplementedBBSimServer) GetFlows(ctx context.Context, req *ONURequest) (*Flows, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method GetFlows not implemented")
+}
+func (*UnimplementedBBSimServer) ChangeIgmpState(ctx context.Context, req *IgmpRequest) (*Response, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method ChangeIgmpState not implemented")
+}
+func (*UnimplementedBBSimServer) GetOnuTrafficSchedulers(ctx context.Context, req *ONURequest) (*ONUTrafficSchedulers, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method GetOnuTrafficSchedulers not implemented")
+}
+
func RegisterBBSimServer(s *grpc.Server, srv BBSimServer) {
s.RegisterService(&_BBSim_serviceDesc, srv)
}
@@ -1360,6 +1517,24 @@
return interceptor(ctx, in, info, handler)
}
+func _BBSim_SetLogLevel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(LogLevel)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(BBSimServer).SetLogLevel(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/bbsim.BBSim/SetLogLevel",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(BBSimServer).SetLogLevel(ctx, req.(*LogLevel))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
func _BBSim_GetOlt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Empty)
if err := dec(in); err != nil {
@@ -1432,24 +1607,6 @@
return interceptor(ctx, in, info, handler)
}
-func _BBSim_GetONUs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(Empty)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(BBSimServer).GetONUs(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/bbsim.BBSim/GetONUs",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(BBSimServer).GetONUs(ctx, req.(*Empty))
- }
- return interceptor(ctx, in, info, handler)
-}
-
func _BBSim_GetONU_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ONURequest)
if err := dec(in); err != nil {
@@ -1468,20 +1625,20 @@
return interceptor(ctx, in, info, handler)
}
-func _BBSim_SetLogLevel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(LogLevel)
+func _BBSim_GetONUs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
- return srv.(BBSimServer).SetLogLevel(ctx, in)
+ return srv.(BBSimServer).GetONUs(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
- FullMethod: "/bbsim.BBSim/SetLogLevel",
+ FullMethod: "/bbsim.BBSim/GetONUs",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(BBSimServer).SetLogLevel(ctx, req.(*LogLevel))
+ return srv.(BBSimServer).GetONUs(ctx, req.(*Empty))
}
return interceptor(ctx, in, info, handler)
}
@@ -1504,6 +1661,42 @@
return interceptor(ctx, in, info, handler)
}
+func _BBSim_ShutdownAllONUs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(Empty)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(BBSimServer).ShutdownAllONUs(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/bbsim.BBSim/ShutdownAllONUs",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(BBSimServer).ShutdownAllONUs(ctx, req.(*Empty))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _BBSim_ShutdownONUsOnPON_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(PONRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(BBSimServer).ShutdownONUsOnPON(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/bbsim.BBSim/ShutdownONUsOnPON",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(BBSimServer).ShutdownONUsOnPON(ctx, req.(*PONRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
func _BBSim_PoweronONU_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ONURequest)
if err := dec(in); err != nil {
@@ -1522,6 +1715,42 @@
return interceptor(ctx, in, info, handler)
}
+func _BBSim_PoweronAllONUs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(Empty)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(BBSimServer).PoweronAllONUs(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/bbsim.BBSim/PoweronAllONUs",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(BBSimServer).PoweronAllONUs(ctx, req.(*Empty))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _BBSim_PoweronONUsOnPON_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(PONRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(BBSimServer).PoweronONUsOnPON(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/bbsim.BBSim/PoweronONUsOnPON",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(BBSimServer).PoweronONUsOnPON(ctx, req.(*PONRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
func _BBSim_RestartEapol_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ONURequest)
if err := dec(in); err != nil {
@@ -1657,6 +1886,10 @@
Handler: _BBSim_Version_Handler,
},
{
+ MethodName: "SetLogLevel",
+ Handler: _BBSim_SetLogLevel_Handler,
+ },
+ {
MethodName: "GetOlt",
Handler: _BBSim_GetOlt_Handler,
},
@@ -1673,26 +1906,38 @@
Handler: _BBSim_RebootOlt_Handler,
},
{
- MethodName: "GetONUs",
- Handler: _BBSim_GetONUs_Handler,
- },
- {
MethodName: "GetONU",
Handler: _BBSim_GetONU_Handler,
},
{
- MethodName: "SetLogLevel",
- Handler: _BBSim_SetLogLevel_Handler,
+ MethodName: "GetONUs",
+ Handler: _BBSim_GetONUs_Handler,
},
{
MethodName: "ShutdownONU",
Handler: _BBSim_ShutdownONU_Handler,
},
{
+ MethodName: "ShutdownAllONUs",
+ Handler: _BBSim_ShutdownAllONUs_Handler,
+ },
+ {
+ MethodName: "ShutdownONUsOnPON",
+ Handler: _BBSim_ShutdownONUsOnPON_Handler,
+ },
+ {
MethodName: "PoweronONU",
Handler: _BBSim_PoweronONU_Handler,
},
{
+ MethodName: "PoweronAllONUs",
+ Handler: _BBSim_PoweronAllONUs_Handler,
+ },
+ {
+ MethodName: "PoweronONUsOnPON",
+ Handler: _BBSim_PoweronONUsOnPON_Handler,
+ },
+ {
MethodName: "RestartEapol",
Handler: _BBSim_RestartEapol_Handler,
},
diff --git a/api/bbsim/bbsim.pb.gw.go b/api/bbsim/bbsim.pb.gw.go
index b96f904..468670f 100644
--- a/api/bbsim/bbsim.pb.gw.go
+++ b/api/bbsim/bbsim.pb.gw.go
@@ -13,6 +13,7 @@
"io"
"net/http"
+ "github.com/golang/protobuf/descriptor"
"github.com/golang/protobuf/proto"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/grpc-ecosystem/grpc-gateway/utilities"
@@ -22,11 +23,13 @@
"google.golang.org/grpc/status"
)
+// Suppress "imported and not used" errors
var _ codes.Code
var _ io.Reader
var _ status.Status
var _ = runtime.String
var _ = utilities.NewDoubleArray
+var _ = descriptor.ForMessage
func request_BBSim_Version_0(ctx context.Context, marshaler runtime.Marshaler, client BBSimClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq Empty
@@ -82,24 +85,6 @@
}
-func request_BBSim_GetONUs_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.GetONUs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
- return msg, metadata, err
-
-}
-
-func local_request_BBSim_GetONUs_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.GetONUs(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
@@ -154,6 +139,24 @@
}
+func request_BBSim_GetONUs_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.GetONUs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_BBSim_GetONUs_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.GetONUs(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
func request_BBSim_ShutdownONU_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
@@ -208,6 +211,78 @@
}
+func request_BBSim_ShutdownAllONUs_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.ShutdownAllONUs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_BBSim_ShutdownAllONUs_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.ShutdownAllONUs(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
+func request_BBSim_ShutdownONUsOnPON_0(ctx context.Context, marshaler runtime.Marshaler, client BBSimClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq PONRequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["PonPortId"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "PonPortId")
+ }
+
+ protoReq.PonPortId, err = runtime.Uint32(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "PonPortId", err)
+ }
+
+ msg, err := client.ShutdownONUsOnPON(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_BBSim_ShutdownONUsOnPON_0(ctx context.Context, marshaler runtime.Marshaler, server BBSimServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq PONRequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["PonPortId"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "PonPortId")
+ }
+
+ protoReq.PonPortId, err = runtime.Uint32(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "PonPortId", err)
+ }
+
+ msg, err := server.ShutdownONUsOnPON(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
func request_BBSim_PoweronONU_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
@@ -262,6 +337,78 @@
}
+func request_BBSim_PoweronAllONUs_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.PoweronAllONUs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_BBSim_PoweronAllONUs_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.PoweronAllONUs(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
+func request_BBSim_PoweronONUsOnPON_0(ctx context.Context, marshaler runtime.Marshaler, client BBSimClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq PONRequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["PonPortId"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "PonPortId")
+ }
+
+ protoReq.PonPortId, err = runtime.Uint32(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "PonPortId", err)
+ }
+
+ msg, err := client.PoweronONUsOnPON(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_BBSim_PoweronONUsOnPON_0(ctx context.Context, marshaler runtime.Marshaler, server BBSimServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq PONRequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["PonPortId"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "PonPortId")
+ }
+
+ protoReq.PonPortId, err = runtime.Uint32(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "PonPortId", err)
+ }
+
+ msg, err := server.PoweronONUsOnPON(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}}
)
@@ -679,26 +826,6 @@
})
- mux.Handle("GET", pattern_BBSim_GetONUs_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_GetONUs_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_GetONUs_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()
@@ -719,6 +846,26 @@
})
+ mux.Handle("GET", pattern_BBSim_GetONUs_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_GetONUs_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_GetONUs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
mux.Handle("DELETE", pattern_BBSim_ShutdownONU_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -739,6 +886,46 @@
})
+ mux.Handle("DELETE", pattern_BBSim_ShutdownAllONUs_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_ShutdownAllONUs_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_ShutdownAllONUs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("DELETE", pattern_BBSim_ShutdownONUsOnPON_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_ShutdownONUsOnPON_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_ShutdownONUsOnPON_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
mux.Handle("POST", pattern_BBSim_PoweronONU_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -759,6 +946,46 @@
})
+ mux.Handle("POST", pattern_BBSim_PoweronAllONUs_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_PoweronAllONUs_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_PoweronAllONUs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("POST", pattern_BBSim_PoweronONUsOnPON_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_PoweronONUsOnPON_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_PoweronONUsOnPON_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()
@@ -960,26 +1187,6 @@
})
- mux.Handle("GET", pattern_BBSim_GetONUs_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_GetONUs_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_GetONUs_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()
@@ -1000,6 +1207,26 @@
})
+ mux.Handle("GET", pattern_BBSim_GetONUs_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_GetONUs_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_GetONUs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
mux.Handle("DELETE", pattern_BBSim_ShutdownONU_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -1020,6 +1247,46 @@
})
+ mux.Handle("DELETE", pattern_BBSim_ShutdownAllONUs_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_ShutdownAllONUs_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_ShutdownAllONUs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("DELETE", pattern_BBSim_ShutdownONUsOnPON_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_ShutdownONUsOnPON_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_ShutdownONUsOnPON_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
mux.Handle("POST", pattern_BBSim_PoweronONU_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -1040,6 +1307,46 @@
})
+ mux.Handle("POST", pattern_BBSim_PoweronAllONUs_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_PoweronAllONUs_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_PoweronAllONUs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("POST", pattern_BBSim_PoweronONUsOnPON_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_PoweronONUsOnPON_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_PoweronONUsOnPON_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()
@@ -1150,14 +1457,22 @@
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_GetONUs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "olt", "onus"}, "", 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)))
+
pattern_BBSim_ShutdownONU_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_ShutdownAllONUs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "olt", "onus"}, "", runtime.AssumeColonVerbOpt(true)))
+
+ pattern_BBSim_ShutdownONUsOnPON_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_PoweronONU_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_PoweronAllONUs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "olt", "onus"}, "", runtime.AssumeColonVerbOpt(true)))
+
+ 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_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)))
@@ -1176,14 +1491,22 @@
forward_BBSim_GetOlt_1 = runtime.ForwardResponseMessage
- forward_BBSim_GetONUs_0 = runtime.ForwardResponseMessage
-
forward_BBSim_GetONU_0 = runtime.ForwardResponseMessage
+ forward_BBSim_GetONUs_0 = runtime.ForwardResponseMessage
+
forward_BBSim_ShutdownONU_0 = runtime.ForwardResponseMessage
+ forward_BBSim_ShutdownAllONUs_0 = runtime.ForwardResponseMessage
+
+ forward_BBSim_ShutdownONUsOnPON_0 = runtime.ForwardResponseMessage
+
forward_BBSim_PoweronONU_0 = runtime.ForwardResponseMessage
+ forward_BBSim_PoweronAllONUs_0 = runtime.ForwardResponseMessage
+
+ forward_BBSim_PoweronONUsOnPON_0 = runtime.ForwardResponseMessage
+
forward_BBSim_SetOnuAlarmIndication_0 = runtime.ForwardResponseMessage
forward_BBSim_SetOltAlarmIndication_0 = runtime.ForwardResponseMessage
diff --git a/api/bbsim/bbsim.proto b/api/bbsim/bbsim.proto
index 5167f2c..adc5b31 100644
--- a/api/bbsim/bbsim.proto
+++ b/api/bbsim/bbsim.proto
@@ -65,6 +65,10 @@
string SerialNumber = 1;
}
+message PONRequest {
+ uint32 PonPortId = 1;
+}
+
// Alarms
message AlarmType {
@@ -157,15 +161,24 @@
service BBSim {
rpc Version(Empty) returns (VersionNumber) {}
+ rpc SetLogLevel(LogLevel) returns (LogLevel) {}
+
rpc GetOlt(Empty) returns (Olt) {}
rpc PoweronOlt(Empty) returns (Response) {}
rpc ShutdownOlt(Empty) returns (Response) {}
rpc RebootOlt(Empty) returns (Response) {}
- rpc GetONUs(Empty) returns (ONUs) {}
+
rpc GetONU(ONURequest) returns (ONU) {}
- rpc SetLogLevel(LogLevel) returns (LogLevel) {}
+ rpc GetONUs(Empty) returns (ONUs) {}
+
rpc ShutdownONU (ONURequest) returns (Response) {}
+ rpc ShutdownAllONUs (Empty) returns (Response) {}
+ rpc ShutdownONUsOnPON(PONRequest) returns (Response) {}
+
rpc PoweronONU (ONURequest) returns (Response) {}
+ rpc PoweronAllONUs (Empty) returns (Response) {}
+ rpc PoweronONUsOnPON(PONRequest) returns (Response) {}
+
rpc RestartEapol (ONURequest) returns (Response) {}
rpc RestartDhcp (ONURequest) returns (Response) {}
rpc SetOnuAlarmIndication (ONUAlarmRequest) returns (Response) {}
diff --git a/api/bbsim/bbsim.yaml b/api/bbsim/bbsim.yaml
index 0c23240..2661cfb 100644
--- a/api/bbsim/bbsim.yaml
+++ b/api/bbsim/bbsim.yaml
@@ -23,21 +23,34 @@
get: "/v1/olt"
additional_bindings:
- get: "/v1/olt/status"
+
- selector: bbsim.BBSim.GetONUs
get: "/v1/olt/onus"
- selector: bbsim.BBSim.GetONU
get: "/v1/olt/onus/{SerialNumber}"
+
- selector: bbsim.BBSim.ShutdownONU
delete: "/v1/olt/onus/{SerialNumber}"
+ - selector: bbsim.BBSim.ShutdownONUsOnPON
+ delete: "/v1/olt/port/{PonPortId}/onus"
+ - selector: bbsim.BBSim.ShutdownAllONUs
+ delete: "/v1/olt/onus"
+
- selector: bbsim.BBSim.PoweronONU
post: "/v1/olt/onus/{SerialNumber}"
+ - selector: bbsim.BBSim.PoweronONUsOnPON
+ post: "/v1/olt/port/{PonPortId}/onus"
+ - selector: bbsim.BBSim.PoweronAllONUs
+ post: "/v1/olt/onus"
+
- selector: bbsim.BBSim.GetFlows
get: "/v1/olt/onus/{SerialNumber}/flows"
additional_bindings:
- get: "/v1/olt/flows"
- - selector: bbsim.BBSim.SetOnuAlarmIndication
- post: "/v1/olt/onus/{SerialNumber}/alarms/{AlarmType}/{Status}"
- selector: bbsim.BBSim.GetOnuTrafficSchedulers
get: "/v1/olt/onus/{SerialNumber}/trafficschedulers"
+
+ - selector: bbsim.BBSim.SetOnuAlarmIndication
+ post: "/v1/olt/onus/{SerialNumber}/alarms/{AlarmType}/{Status}"
- selector: bbsim.BBSim.SetOltAlarmIndication
post: "/v1/olt/ports/{InterfaceType}/{InterfaceID}/alarms/los/{Status}"
diff --git a/api/legacy/bbsim.pb.go b/api/legacy/bbsim.pb.go
index ad35c64..d54276c 100644
--- a/api/legacy/bbsim.pb.go
+++ b/api/legacy/bbsim.pb.go
@@ -12,6 +12,8 @@
tech_profile "github.com/opencord/voltha-protos/v2/go/tech_profile"
_ "google.golang.org/genproto/googleapis/api/annotations"
grpc "google.golang.org/grpc"
+ codes "google.golang.org/grpc/codes"
+ status "google.golang.org/grpc/status"
math "math"
)
@@ -893,42 +895,60 @@
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
-var _ grpc.ClientConn
+var _ grpc.ClientConnInterface
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
-const _ = grpc.SupportPackageIsVersion4
+const _ = grpc.SupportPackageIsVersion6
// BBSimServiceClient is the client API for BBSimService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type BBSimServiceClient interface {
// Get current status of OLT
+ //
+ // Deprecated: Do not use.
OLTStatus(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*OLTStatusResponse, error)
// Get status of a PON/NNI port
+ //
+ // Deprecated: Do not use.
PortStatus(ctx context.Context, in *PortInfo, opts ...grpc.CallOption) (*Ports, error)
// Get status of all or specific ONUs
+ //
+ // Deprecated: Do not use.
ONUStatus(ctx context.Context, in *ONURequest, opts ...grpc.CallOption) (*ONUs, error)
// Single/bulk activate ONU(s) for specific PON port(s)
+ //
+ // Deprecated: Do not use.
ONUActivate(ctx context.Context, in *ONURequest, opts ...grpc.CallOption) (*BBSimResponse, error)
// Deactivate ONU(s) for specific PON port(s) specified by
// a given onu_serial, onu_id, or pon_port_id
+ //
+ // Deprecated: Do not use.
ONUDeactivate(ctx context.Context, in *ONURequest, opts ...grpc.CallOption) (*BBSimResponse, error)
// Generate ONU related alarms
+ //
+ // Deprecated: Do not use.
GenerateONUAlarm(ctx context.Context, in *ONUAlarmRequest, opts ...grpc.CallOption) (*BBSimResponse, error)
// Generate OLT related alarms
+ //
+ // Deprecated: Do not use.
GenerateOLTAlarm(ctx context.Context, in *OLTAlarmRequest, opts ...grpc.CallOption) (*BBSimResponse, error)
// Perform actions on OLT/ONU devices (e.g. reboot)
+ //
+ // Deprecated: Do not use.
PerformDeviceAction(ctx context.Context, in *DeviceAction, opts ...grpc.CallOption) (*BBSimResponse, error)
// Get flows
+ //
+ // Deprecated: Do not use.
GetFlows(ctx context.Context, in *ONUInfo, opts ...grpc.CallOption) (*Flows, error)
}
type bBSimServiceClient struct {
- cc *grpc.ClientConn
+ cc grpc.ClientConnInterface
}
-func NewBBSimServiceClient(cc *grpc.ClientConn) BBSimServiceClient {
+func NewBBSimServiceClient(cc grpc.ClientConnInterface) BBSimServiceClient {
return &bBSimServiceClient{cc}
}
@@ -1025,26 +1045,76 @@
// BBSimServiceServer is the server API for BBSimService service.
type BBSimServiceServer interface {
// Get current status of OLT
+ //
+ // Deprecated: Do not use.
OLTStatus(context.Context, *Empty) (*OLTStatusResponse, error)
// Get status of a PON/NNI port
+ //
+ // Deprecated: Do not use.
PortStatus(context.Context, *PortInfo) (*Ports, error)
// Get status of all or specific ONUs
+ //
+ // Deprecated: Do not use.
ONUStatus(context.Context, *ONURequest) (*ONUs, error)
// Single/bulk activate ONU(s) for specific PON port(s)
+ //
+ // Deprecated: Do not use.
ONUActivate(context.Context, *ONURequest) (*BBSimResponse, error)
// Deactivate ONU(s) for specific PON port(s) specified by
// a given onu_serial, onu_id, or pon_port_id
+ //
+ // Deprecated: Do not use.
ONUDeactivate(context.Context, *ONURequest) (*BBSimResponse, error)
// Generate ONU related alarms
+ //
+ // Deprecated: Do not use.
GenerateONUAlarm(context.Context, *ONUAlarmRequest) (*BBSimResponse, error)
// Generate OLT related alarms
+ //
+ // Deprecated: Do not use.
GenerateOLTAlarm(context.Context, *OLTAlarmRequest) (*BBSimResponse, error)
// Perform actions on OLT/ONU devices (e.g. reboot)
+ //
+ // Deprecated: Do not use.
PerformDeviceAction(context.Context, *DeviceAction) (*BBSimResponse, error)
// Get flows
+ //
+ // Deprecated: Do not use.
GetFlows(context.Context, *ONUInfo) (*Flows, error)
}
+// UnimplementedBBSimServiceServer can be embedded to have forward compatible implementations.
+type UnimplementedBBSimServiceServer struct {
+}
+
+func (*UnimplementedBBSimServiceServer) OLTStatus(ctx context.Context, req *Empty) (*OLTStatusResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method OLTStatus not implemented")
+}
+func (*UnimplementedBBSimServiceServer) PortStatus(ctx context.Context, req *PortInfo) (*Ports, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method PortStatus not implemented")
+}
+func (*UnimplementedBBSimServiceServer) ONUStatus(ctx context.Context, req *ONURequest) (*ONUs, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method ONUStatus not implemented")
+}
+func (*UnimplementedBBSimServiceServer) ONUActivate(ctx context.Context, req *ONURequest) (*BBSimResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method ONUActivate not implemented")
+}
+func (*UnimplementedBBSimServiceServer) ONUDeactivate(ctx context.Context, req *ONURequest) (*BBSimResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method ONUDeactivate not implemented")
+}
+func (*UnimplementedBBSimServiceServer) GenerateONUAlarm(ctx context.Context, req *ONUAlarmRequest) (*BBSimResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method GenerateONUAlarm not implemented")
+}
+func (*UnimplementedBBSimServiceServer) GenerateOLTAlarm(ctx context.Context, req *OLTAlarmRequest) (*BBSimResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method GenerateOLTAlarm not implemented")
+}
+func (*UnimplementedBBSimServiceServer) PerformDeviceAction(ctx context.Context, req *DeviceAction) (*BBSimResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method PerformDeviceAction not implemented")
+}
+func (*UnimplementedBBSimServiceServer) GetFlows(ctx context.Context, req *ONUInfo) (*Flows, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method GetFlows not implemented")
+}
+
func RegisterBBSimServiceServer(s *grpc.Server, srv BBSimServiceServer) {
s.RegisterService(&_BBSimService_serviceDesc, srv)
}
diff --git a/api/legacy/bbsim.pb.gw.go b/api/legacy/bbsim.pb.gw.go
index c3667c0..d56438c 100644
--- a/api/legacy/bbsim.pb.gw.go
+++ b/api/legacy/bbsim.pb.gw.go
@@ -13,6 +13,7 @@
"io"
"net/http"
+ "github.com/golang/protobuf/descriptor"
"github.com/golang/protobuf/proto"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/grpc-ecosystem/grpc-gateway/utilities"
@@ -22,11 +23,13 @@
"google.golang.org/grpc/status"
)
+// Suppress "imported and not used" errors
var _ codes.Code
var _ io.Reader
var _ status.Status
var _ = runtime.String
var _ = utilities.NewDoubleArray
+var _ = descriptor.ForMessage
func request_BBSimService_OLTStatus_0(ctx context.Context, marshaler runtime.Marshaler, client BBSimServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq Empty
@@ -37,6 +40,15 @@
}
+func local_request_BBSimService_OLTStatus_0(ctx context.Context, marshaler runtime.Marshaler, server BBSimServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq Empty
+ var metadata runtime.ServerMetadata
+
+ msg, err := server.OLTStatus(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
func request_BBSimService_OLTStatus_1(ctx context.Context, marshaler runtime.Marshaler, client BBSimServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq Empty
var metadata runtime.ServerMetadata
@@ -46,6 +58,15 @@
}
+func local_request_BBSimService_OLTStatus_1(ctx context.Context, marshaler runtime.Marshaler, server BBSimServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq Empty
+ var metadata runtime.ServerMetadata
+
+ msg, err := server.OLTStatus(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
var (
filter_BBSimService_PortStatus_0 = &utilities.DoubleArray{Encoding: map[string]int{"port_type": 0, "port_id": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}}
)
@@ -95,6 +116,48 @@
}
+func local_request_BBSimService_PortStatus_0(ctx context.Context, marshaler runtime.Marshaler, server BBSimServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq PortInfo
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["port_type"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "port_type")
+ }
+
+ protoReq.PortType, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "port_type", err)
+ }
+
+ val, ok = pathParams["port_id"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "port_id")
+ }
+
+ protoReq.PortId, err = runtime.Uint32(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "port_id", err)
+ }
+
+ if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_BBSimService_PortStatus_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := server.PortStatus(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
var (
filter_BBSimService_ONUStatus_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
@@ -115,6 +178,19 @@
}
+func local_request_BBSimService_ONUStatus_0(ctx context.Context, marshaler runtime.Marshaler, server BBSimServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq ONURequest
+ var metadata runtime.ServerMetadata
+
+ if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_BBSimService_ONUStatus_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := server.ONUStatus(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
var (
filter_BBSimService_ONUStatus_1 = &utilities.DoubleArray{Encoding: map[string]int{"onu": 0, "onu_serial": 1}, Base: []int{1, 1, 1, 0}, Check: []int{0, 1, 2, 3}}
)
@@ -153,6 +229,37 @@
}
+func local_request_BBSimService_ONUStatus_1(ctx context.Context, marshaler runtime.Marshaler, server BBSimServiceServer, 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["onu.onu_serial"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "onu.onu_serial")
+ }
+
+ err = runtime.PopulateFieldFromPath(&protoReq, "onu.onu_serial", val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "onu.onu_serial", err)
+ }
+
+ if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_BBSimService_ONUStatus_1); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := server.ONUStatus(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
var (
filter_BBSimService_ONUStatus_2 = &utilities.DoubleArray{Encoding: map[string]int{"onu": 0, "pon_port_id": 1, "onu_id": 2}, Base: []int{1, 1, 1, 2, 0, 0}, Check: []int{0, 1, 2, 2, 3, 4}}
)
@@ -202,6 +309,48 @@
}
+func local_request_BBSimService_ONUStatus_2(ctx context.Context, marshaler runtime.Marshaler, server BBSimServiceServer, 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["onu.pon_port_id"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "onu.pon_port_id")
+ }
+
+ err = runtime.PopulateFieldFromPath(&protoReq, "onu.pon_port_id", val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "onu.pon_port_id", err)
+ }
+
+ val, ok = pathParams["onu.onu_id"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "onu.onu_id")
+ }
+
+ err = runtime.PopulateFieldFromPath(&protoReq, "onu.onu_id", val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "onu.onu_id", err)
+ }
+
+ if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_BBSimService_ONUStatus_2); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := server.ONUStatus(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
var (
filter_BBSimService_ONUStatus_3 = &utilities.DoubleArray{Encoding: map[string]int{"onu": 0, "pon_port_id": 1}, Base: []int{1, 1, 1, 0}, Check: []int{0, 1, 2, 3}}
)
@@ -240,6 +389,37 @@
}
+func local_request_BBSimService_ONUStatus_3(ctx context.Context, marshaler runtime.Marshaler, server BBSimServiceServer, 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["onu.pon_port_id"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "onu.pon_port_id")
+ }
+
+ err = runtime.PopulateFieldFromPath(&protoReq, "onu.pon_port_id", val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "onu.pon_port_id", err)
+ }
+
+ if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_BBSimService_ONUStatus_3); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := server.ONUStatus(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
var (
filter_BBSimService_ONUActivate_0 = &utilities.DoubleArray{Encoding: map[string]int{"onus_batch": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
)
@@ -268,6 +448,27 @@
}
+func local_request_BBSimService_ONUActivate_0(ctx context.Context, marshaler runtime.Marshaler, server BBSimServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq ONURequest
+ var metadata runtime.ServerMetadata
+
+ newReader, berr := utilities.IOReaderFactory(req.Body)
+ if berr != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
+ }
+ if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.OnusBatch); err != nil && err != io.EOF {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_BBSimService_ONUActivate_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := server.ONUActivate(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
var (
filter_BBSimService_ONUActivate_1 = &utilities.DoubleArray{Encoding: map[string]int{"onu": 0, "pon_port_id": 1}, Base: []int{1, 1, 1, 0}, Check: []int{0, 1, 2, 3}}
)
@@ -306,6 +507,37 @@
}
+func local_request_BBSimService_ONUActivate_1(ctx context.Context, marshaler runtime.Marshaler, server BBSimServiceServer, 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["onu.pon_port_id"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "onu.pon_port_id")
+ }
+
+ err = runtime.PopulateFieldFromPath(&protoReq, "onu.pon_port_id", val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "onu.pon_port_id", err)
+ }
+
+ if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_BBSimService_ONUActivate_1); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := server.ONUActivate(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
var (
filter_BBSimService_ONUActivate_2 = &utilities.DoubleArray{Encoding: map[string]int{"onu": 0, "pon_port_id": 1, "onu_serial": 2}, Base: []int{1, 1, 1, 2, 0, 0}, Check: []int{0, 1, 2, 2, 3, 4}}
)
@@ -355,6 +587,48 @@
}
+func local_request_BBSimService_ONUActivate_2(ctx context.Context, marshaler runtime.Marshaler, server BBSimServiceServer, 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["onu.pon_port_id"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "onu.pon_port_id")
+ }
+
+ err = runtime.PopulateFieldFromPath(&protoReq, "onu.pon_port_id", val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "onu.pon_port_id", err)
+ }
+
+ val, ok = pathParams["onu.onu_serial"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "onu.onu_serial")
+ }
+
+ err = runtime.PopulateFieldFromPath(&protoReq, "onu.onu_serial", val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "onu.onu_serial", err)
+ }
+
+ if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_BBSimService_ONUActivate_2); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := server.ONUActivate(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
var (
filter_BBSimService_ONUDeactivate_0 = &utilities.DoubleArray{Encoding: map[string]int{"onus_batch": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
)
@@ -383,6 +657,27 @@
}
+func local_request_BBSimService_ONUDeactivate_0(ctx context.Context, marshaler runtime.Marshaler, server BBSimServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq ONURequest
+ var metadata runtime.ServerMetadata
+
+ newReader, berr := utilities.IOReaderFactory(req.Body)
+ if berr != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
+ }
+ if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.OnusBatch); err != nil && err != io.EOF {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_BBSimService_ONUDeactivate_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := server.ONUDeactivate(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
var (
filter_BBSimService_ONUDeactivate_1 = &utilities.DoubleArray{Encoding: map[string]int{"onu": 0, "onu_serial": 1}, Base: []int{1, 1, 1, 0}, Check: []int{0, 1, 2, 3}}
)
@@ -421,6 +716,37 @@
}
+func local_request_BBSimService_ONUDeactivate_1(ctx context.Context, marshaler runtime.Marshaler, server BBSimServiceServer, 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["onu.onu_serial"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "onu.onu_serial")
+ }
+
+ err = runtime.PopulateFieldFromPath(&protoReq, "onu.onu_serial", val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "onu.onu_serial", err)
+ }
+
+ if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_BBSimService_ONUDeactivate_1); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := server.ONUDeactivate(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
var (
filter_BBSimService_ONUDeactivate_2 = &utilities.DoubleArray{Encoding: map[string]int{"onu": 0, "pon_port_id": 1}, Base: []int{1, 1, 1, 0}, Check: []int{0, 1, 2, 3}}
)
@@ -459,6 +785,37 @@
}
+func local_request_BBSimService_ONUDeactivate_2(ctx context.Context, marshaler runtime.Marshaler, server BBSimServiceServer, 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["onu.pon_port_id"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "onu.pon_port_id")
+ }
+
+ err = runtime.PopulateFieldFromPath(&protoReq, "onu.pon_port_id", val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "onu.pon_port_id", err)
+ }
+
+ if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_BBSimService_ONUDeactivate_2); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := server.ONUDeactivate(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
var (
filter_BBSimService_ONUDeactivate_3 = &utilities.DoubleArray{Encoding: map[string]int{"onu": 0, "pon_port_id": 1, "onu_id": 2}, Base: []int{1, 1, 1, 2, 0, 0}, Check: []int{0, 1, 2, 2, 3, 4}}
)
@@ -508,6 +865,48 @@
}
+func local_request_BBSimService_ONUDeactivate_3(ctx context.Context, marshaler runtime.Marshaler, server BBSimServiceServer, 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["onu.pon_port_id"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "onu.pon_port_id")
+ }
+
+ err = runtime.PopulateFieldFromPath(&protoReq, "onu.pon_port_id", val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "onu.pon_port_id", err)
+ }
+
+ val, ok = pathParams["onu.onu_id"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "onu.onu_id")
+ }
+
+ err = runtime.PopulateFieldFromPath(&protoReq, "onu.onu_id", val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "onu.onu_id", err)
+ }
+
+ if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_BBSimService_ONUDeactivate_3); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := server.ONUDeactivate(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
func request_BBSimService_GenerateONUAlarm_0(ctx context.Context, marshaler runtime.Marshaler, client BBSimServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ONUAlarmRequest
var metadata runtime.ServerMetadata
@@ -557,6 +956,55 @@
}
+func local_request_BBSimService_GenerateONUAlarm_0(ctx context.Context, marshaler runtime.Marshaler, server BBSimServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq ONUAlarmRequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["onu_serial"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "onu_serial")
+ }
+
+ protoReq.OnuSerial, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "onu_serial", err)
+ }
+
+ val, ok = pathParams["alarm_type"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "alarm_type")
+ }
+
+ protoReq.AlarmType, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "alarm_type", err)
+ }
+
+ val, ok = pathParams["status"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "status")
+ }
+
+ protoReq.Status, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "status", err)
+ }
+
+ msg, err := server.GenerateONUAlarm(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
func request_BBSimService_GenerateOLTAlarm_0(ctx context.Context, marshaler runtime.Marshaler, client BBSimServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq OLTAlarmRequest
var metadata runtime.ServerMetadata
@@ -606,6 +1054,55 @@
}
+func local_request_BBSimService_GenerateOLTAlarm_0(ctx context.Context, marshaler runtime.Marshaler, server BBSimServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq OLTAlarmRequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["port_type"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "port_type")
+ }
+
+ protoReq.PortType, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "port_type", err)
+ }
+
+ val, ok = pathParams["port_id"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "port_id")
+ }
+
+ protoReq.PortId, err = runtime.Uint32(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "port_id", err)
+ }
+
+ val, ok = pathParams["status"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "status")
+ }
+
+ protoReq.Status, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "status", err)
+ }
+
+ msg, err := server.GenerateOLTAlarm(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
var (
filter_BBSimService_PerformDeviceAction_0 = &utilities.DoubleArray{Encoding: map[string]int{"device_type": 0, "action": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}}
)
@@ -655,6 +1152,48 @@
}
+func local_request_BBSimService_PerformDeviceAction_0(ctx context.Context, marshaler runtime.Marshaler, server BBSimServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq DeviceAction
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["device_type"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "device_type")
+ }
+
+ protoReq.DeviceType, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "device_type", err)
+ }
+
+ val, ok = pathParams["action"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "action")
+ }
+
+ protoReq.Action, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "action", err)
+ }
+
+ if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_BBSimService_PerformDeviceAction_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := server.PerformDeviceAction(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
func request_BBSimService_PerformDeviceAction_1(ctx context.Context, marshaler runtime.Marshaler, client BBSimServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq DeviceAction
var metadata runtime.ServerMetadata
@@ -704,6 +1243,55 @@
}
+func local_request_BBSimService_PerformDeviceAction_1(ctx context.Context, marshaler runtime.Marshaler, server BBSimServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq DeviceAction
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["device_type"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "device_type")
+ }
+
+ protoReq.DeviceType, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "device_type", err)
+ }
+
+ val, ok = pathParams["serial_number"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "serial_number")
+ }
+
+ protoReq.SerialNumber, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "serial_number", err)
+ }
+
+ val, ok = pathParams["action"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "action")
+ }
+
+ protoReq.Action, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "action", err)
+ }
+
+ msg, err := server.PerformDeviceAction(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
var (
filter_BBSimService_GetFlows_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
@@ -724,6 +1312,19 @@
}
+func local_request_BBSimService_GetFlows_0(ctx context.Context, marshaler runtime.Marshaler, server BBSimServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq ONUInfo
+ var metadata runtime.ServerMetadata
+
+ if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_BBSimService_GetFlows_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := server.GetFlows(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
var (
filter_BBSimService_GetFlows_1 = &utilities.DoubleArray{Encoding: map[string]int{"onu_serial": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
)
@@ -762,6 +1363,445 @@
}
+func local_request_BBSimService_GetFlows_1(ctx context.Context, marshaler runtime.Marshaler, server BBSimServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq ONUInfo
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["onu_serial"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "onu_serial")
+ }
+
+ protoReq.OnuSerial, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "onu_serial", err)
+ }
+
+ if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_BBSimService_GetFlows_1); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := server.GetFlows(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
+// RegisterBBSimServiceHandlerServer registers the http handlers for service BBSimService to "mux".
+// UnaryRPC :call BBSimServiceServer directly.
+// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
+func RegisterBBSimServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server BBSimServiceServer) error {
+
+ mux.Handle("GET", pattern_BBSimService_OLTStatus_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_BBSimService_OLTStatus_0(rctx, inboundMarshaler, server, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_BBSimService_OLTStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("GET", pattern_BBSimService_OLTStatus_1, 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_BBSimService_OLTStatus_1(rctx, inboundMarshaler, server, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_BBSimService_OLTStatus_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("GET", pattern_BBSimService_PortStatus_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_BBSimService_PortStatus_0(rctx, inboundMarshaler, server, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_BBSimService_PortStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("GET", pattern_BBSimService_ONUStatus_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_BBSimService_ONUStatus_0(rctx, inboundMarshaler, server, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_BBSimService_ONUStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("GET", pattern_BBSimService_ONUStatus_1, 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_BBSimService_ONUStatus_1(rctx, inboundMarshaler, server, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_BBSimService_ONUStatus_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("GET", pattern_BBSimService_ONUStatus_2, 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_BBSimService_ONUStatus_2(rctx, inboundMarshaler, server, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_BBSimService_ONUStatus_2(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("GET", pattern_BBSimService_ONUStatus_3, 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_BBSimService_ONUStatus_3(rctx, inboundMarshaler, server, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_BBSimService_ONUStatus_3(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("POST", pattern_BBSimService_ONUActivate_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_BBSimService_ONUActivate_0(rctx, inboundMarshaler, server, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_BBSimService_ONUActivate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("POST", pattern_BBSimService_ONUActivate_1, 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_BBSimService_ONUActivate_1(rctx, inboundMarshaler, server, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_BBSimService_ONUActivate_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("POST", pattern_BBSimService_ONUActivate_2, 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_BBSimService_ONUActivate_2(rctx, inboundMarshaler, server, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_BBSimService_ONUActivate_2(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("DELETE", pattern_BBSimService_ONUDeactivate_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_BBSimService_ONUDeactivate_0(rctx, inboundMarshaler, server, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_BBSimService_ONUDeactivate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("DELETE", pattern_BBSimService_ONUDeactivate_1, 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_BBSimService_ONUDeactivate_1(rctx, inboundMarshaler, server, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_BBSimService_ONUDeactivate_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("DELETE", pattern_BBSimService_ONUDeactivate_2, 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_BBSimService_ONUDeactivate_2(rctx, inboundMarshaler, server, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_BBSimService_ONUDeactivate_2(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("DELETE", pattern_BBSimService_ONUDeactivate_3, 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_BBSimService_ONUDeactivate_3(rctx, inboundMarshaler, server, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_BBSimService_ONUDeactivate_3(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("POST", pattern_BBSimService_GenerateONUAlarm_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_BBSimService_GenerateONUAlarm_0(rctx, inboundMarshaler, server, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_BBSimService_GenerateONUAlarm_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("POST", pattern_BBSimService_GenerateOLTAlarm_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_BBSimService_GenerateOLTAlarm_0(rctx, inboundMarshaler, server, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_BBSimService_GenerateOLTAlarm_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("PATCH", pattern_BBSimService_PerformDeviceAction_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_BBSimService_PerformDeviceAction_0(rctx, inboundMarshaler, server, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_BBSimService_PerformDeviceAction_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("PATCH", pattern_BBSimService_PerformDeviceAction_1, 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_BBSimService_PerformDeviceAction_1(rctx, inboundMarshaler, server, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_BBSimService_PerformDeviceAction_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("GET", pattern_BBSimService_GetFlows_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_BBSimService_GetFlows_0(rctx, inboundMarshaler, server, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_BBSimService_GetFlows_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("GET", pattern_BBSimService_GetFlows_1, 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_BBSimService_GetFlows_1(rctx, inboundMarshaler, server, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_BBSimService_GetFlows_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ return nil
+}
+
// RegisterBBSimServiceHandlerFromEndpoint is same as RegisterBBSimServiceHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterBBSimServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
diff --git a/cmd/bbsimctl/bbsimctl.go b/cmd/bbsimctl/bbsimctl.go
index 3c69890..cc05835 100644
--- a/cmd/bbsimctl/bbsimctl.go
+++ b/cmd/bbsimctl/bbsimctl.go
@@ -38,6 +38,7 @@
commands.RegisterConfigCommands(parser)
commands.RegisterOltCommands(parser)
commands.RegisterONUCommands(parser)
+ commands.RegisterPonCommands(parser)
commands.RegisterCompletionCommands(parser)
commands.RegisterLoggingCommands(parser)
diff --git a/internal/bbsim/api/onus_handler.go b/internal/bbsim/api/onus_handler.go
index 0f898e8..330621a 100644
--- a/internal/bbsim/api/onus_handler.go
+++ b/internal/bbsim/api/onus_handler.go
@@ -74,6 +74,7 @@
return &res, nil
}
+// ShutdownONU sends DyingGasp indication for specified ONUs and mark ONUs as disabled.
func (s BBSimServer) ShutdownONU(ctx context.Context, req *bbsim.ONURequest) (*bbsim.Response, error) {
// NOTE this method is now sending a Dying Gasp and then disabling the device (operState: down, adminState: up),
// is this the only way to do? Should we address other cases?
@@ -81,82 +82,70 @@
// - a fiber is pulled
// - ONU malfunction
// - ONU shutdown
- res := &bbsim.Response{}
-
logger.WithFields(log.Fields{
"OnuSn": req.SerialNumber,
}).Infof("Received request to shutdown ONU")
+ res := &bbsim.Response{}
olt := devices.GetOLT()
onu, err := olt.FindOnuBySn(req.SerialNumber)
-
if err != nil {
res.StatusCode = int32(codes.NotFound)
res.Message = err.Error()
return res, err
}
- dyingGasp := bbsim.ONUAlarmRequest{
- AlarmType: "DyingGasp",
- SerialNumber: onu.Sn(),
- Status: "on",
- }
+ return handleShutdownONU(onu)
+}
- if err := alarmsim.SimulateOnuAlarm(context.TODO(), &dyingGasp, olt); err != nil {
- logger.WithFields(log.Fields{
- "OnuId": onu.ID,
- "IntfId": onu.PonPortID,
- "OnuSn": onu.Sn(),
- }).Errorf("Cannot send Dying Gasp: %s", err.Error())
- res.StatusCode = int32(codes.FailedPrecondition)
- res.Message = err.Error()
- return res, err
- }
+// ShutdownONUsOnPON sends DyingGasp indication for all ONUs under specified PON port
+func (s BBSimServer) ShutdownONUsOnPON(ctx context.Context, req *bbsim.PONRequest) (*bbsim.Response, error) {
+ logger.WithFields(log.Fields{
+ "IntfId": req.PonPortId,
+ }).Infof("Received request to shutdown all ONUs on PON")
- losReq := bbsim.ONUAlarmRequest{
- AlarmType: "LossOfSignal",
- SerialNumber: onu.Sn(),
- Status: "on",
- }
+ res := &bbsim.Response{}
+ olt := devices.GetOLT()
+ pon, _ := olt.GetPonById(req.PonPortId)
- if err := alarmsim.SimulateOnuAlarm(context.TODO(), &losReq, olt); err != nil {
- logger.WithFields(log.Fields{
- "OnuId": onu.ID,
- "IntfId": onu.PonPortID,
- "OnuSn": onu.Sn(),
- }).Errorf("Cannot send LOS: %s", err.Error())
- res.StatusCode = int32(codes.FailedPrecondition)
- res.Message = err.Error()
- return res, err
- }
-
- // TODO if it's the last ONU on the PON, then send a PON LOS
-
- if err := onu.InternalState.Event("disable"); err != nil {
- logger.WithFields(log.Fields{
- "OnuId": onu.ID,
- "IntfId": onu.PonPortID,
- "OnuSn": onu.Sn(),
- }).Errorf("Cannot shutdown ONU: %s", err.Error())
- res.StatusCode = int32(codes.FailedPrecondition)
- res.Message = err.Error()
- return res, err
- }
-
+ go func() {
+ for _, onu := range pon.Onus {
+ res, _ = handleShutdownONU(onu)
+ }
+ }()
res.StatusCode = int32(codes.OK)
- res.Message = fmt.Sprintf("ONU %s successfully shut down.", onu.Sn())
+ res.Message = fmt.Sprintf("Request accepted for shutdown all ONUs on PON port %d", pon.ID)
return res, nil
}
-func (s BBSimServer) PoweronONU(ctx context.Context, req *bbsim.ONURequest) (*bbsim.Response, error) {
+// ShutdownAllONUs sends DyingGasp indication for all ONUs and mark ONUs as disabled.
+func (s BBSimServer) ShutdownAllONUs(context.Context, *bbsim.Empty) (*bbsim.Response, error) {
+ logger.Infof("Received request to shutdown all ONUs")
res := &bbsim.Response{}
+ olt := devices.GetOLT()
+ go func() {
+ for _, pon := range olt.Pons {
+ for _, onu := range pon.Onus {
+ res, _ = handleShutdownONU(onu)
+ }
+ }
+ }()
+ res.StatusCode = int32(codes.OK)
+ res.Message = fmt.Sprintf("Request Accepted for shutdown all ONUs in OLT %d", olt.ID)
+
+ return res, nil
+}
+
+// PoweronONU simulates ONU power on and start sending discovery indications to VOLTHA
+func (s BBSimServer) PoweronONU(ctx context.Context, req *bbsim.ONURequest) (*bbsim.Response, error) {
logger.WithFields(log.Fields{
"OnuSn": req.SerialNumber,
}).Infof("Received request to poweron ONU")
+ res := &bbsim.Response{}
olt := devices.GetOLT()
onu, err := olt.FindOnuBySn(req.SerialNumber)
@@ -180,60 +169,59 @@
return res, err
}
- if onu.InternalState.Current() == "created" || onu.InternalState.Current() == "disabled" {
- if err := onu.InternalState.Event("initialize"); err != nil {
- logger.WithFields(log.Fields{
- "OnuId": onu.ID,
- "IntfId": onu.PonPortID,
- "OnuSn": onu.Sn(),
- }).Errorf("Cannot poweron ONU: %s", err.Error())
- res.StatusCode = int32(codes.FailedPrecondition)
- res.Message = err.Error()
- return res, err
+ return handlePoweronONU(onu)
+}
+
+// PoweronONUsOnPON simulates ONU power on for all ONUs under specified PON port
+func (s BBSimServer) PoweronONUsOnPON(ctx context.Context, req *bbsim.PONRequest) (*bbsim.Response, error) {
+ logger.WithFields(log.Fields{
+ "IntfId": req.PonPortId,
+ }).Infof("Received request to poweron all ONUs on PON")
+
+ res := &bbsim.Response{}
+ olt := devices.GetOLT()
+
+ pon, _ := olt.GetPonById(req.PonPortId)
+ if pon.InternalState.Current() != "enabled" {
+ err := fmt.Errorf("PON port %d not enabled", pon.ID)
+ logger.WithFields(log.Fields{
+ "IntfId": pon.ID,
+ }).Errorf("Cannot poweron ONUs on PON: %s", err.Error())
+
+ res.StatusCode = int32(codes.FailedPrecondition)
+ res.Message = err.Error()
+ return res, err
+ }
+
+ go func() {
+ for _, onu := range pon.Onus {
+ res, _ = handlePoweronONU(onu)
}
- }
-
- losReq := bbsim.ONUAlarmRequest{
- AlarmType: "LossOfSignal",
- SerialNumber: onu.Sn(),
- Status: "off",
- }
-
- if err := alarmsim.SimulateOnuAlarm(context.TODO(), &losReq, olt); err != nil {
- logger.WithFields(log.Fields{
- "OnuId": onu.ID,
- "IntfId": onu.PonPortID,
- "OnuSn": onu.Sn(),
- }).Errorf("Cannot send LOS: %s", err.Error())
- res.StatusCode = int32(codes.FailedPrecondition)
- res.Message = err.Error()
- return res, err
- }
-
- if err := onu.InternalState.Event("discover"); err != nil {
- logger.WithFields(log.Fields{
- "OnuId": onu.ID,
- "IntfId": onu.PonPortID,
- "OnuSn": onu.Sn(),
- }).Errorf("Cannot poweron ONU: %s", err.Error())
- res.StatusCode = int32(codes.FailedPrecondition)
- res.Message = err.Error()
- return res, err
- }
-
- if err := onu.InternalState.Event("enable"); err != nil {
- logger.WithFields(log.Fields{
- "OnuId": onu.ID,
- "IntfId": onu.PonPortID,
- "OnuSn": onu.Sn(),
- }).Errorf("Cannot enable ONU: %s", err.Error())
- res.StatusCode = int32(codes.FailedPrecondition)
- res.Message = err.Error()
- return res, err
- }
-
+ }()
res.StatusCode = int32(codes.OK)
- res.Message = fmt.Sprintf("ONU %s successfully powered on.", onu.Sn())
+ res.Message = fmt.Sprintf("Request Accepted for power on all ONUs on PON port %d", pon.ID)
+
+ return res, nil
+}
+
+// PoweronAllONUs simulates ONU power on for all ONUs on all PON ports
+func (s BBSimServer) PoweronAllONUs(context.Context, *bbsim.Empty) (*bbsim.Response, error) {
+ logger.Infof("Received request to poweron all ONUs")
+
+ res := &bbsim.Response{}
+ olt := devices.GetOLT()
+
+ go func() {
+ for _, pon := range olt.Pons {
+ if pon.InternalState.Current() == "enabled" {
+ for _, onu := range pon.Onus {
+ res, _ = handlePoweronONU(onu)
+ }
+ }
+ }
+ }()
+ res.StatusCode = int32(codes.OK)
+ res.Message = fmt.Sprintf("Request Accepted for power on all ONUs in OLT %d", olt.ID)
return res, nil
}
@@ -397,3 +385,126 @@
return &ts, nil
}
}
+
+func handlePoweronONU(onu *devices.Onu) (*bbsim.Response, error) {
+ res := &bbsim.Response{}
+ olt := devices.GetOLT()
+ intitalState := onu.InternalState.Current()
+ if onu.InternalState.Current() == "created" || onu.InternalState.Current() == "disabled" {
+ if err := onu.InternalState.Event("initialize"); err != nil {
+ logger.WithFields(log.Fields{
+ "OnuId": onu.ID,
+ "IntfId": onu.PonPortID,
+ "OnuSn": onu.Sn(),
+ }).Errorf("Cannot poweron ONU: %s", err.Error())
+ res.StatusCode = int32(codes.FailedPrecondition)
+ res.Message = err.Error()
+ return res, err
+ }
+ }
+
+ losReq := bbsim.ONUAlarmRequest{
+ AlarmType: "LossOfSignal",
+ SerialNumber: onu.Sn(),
+ Status: "off",
+ }
+
+ if err := alarmsim.SimulateOnuAlarm(context.TODO(), &losReq, olt); err != nil {
+ logger.WithFields(log.Fields{
+ "OnuId": onu.ID,
+ "IntfId": onu.PonPortID,
+ "OnuSn": onu.Sn(),
+ }).Errorf("Cannot send LOS: %s", err.Error())
+ res.StatusCode = int32(codes.FailedPrecondition)
+ res.Message = err.Error()
+ return res, err
+ }
+
+ if err := onu.InternalState.Event("discover"); err != nil {
+ logger.WithFields(log.Fields{
+ "OnuId": onu.ID,
+ "IntfId": onu.PonPortID,
+ "OnuSn": onu.Sn(),
+ }).Errorf("Cannot poweron ONU: %s", err.Error())
+ res.StatusCode = int32(codes.FailedPrecondition)
+ res.Message = err.Error()
+ return res, err
+ }
+ // move onu directly to enable state only when its a powercycle case
+ // in case of first time onu poweron onu will be moved to enable on
+ // receiving ActivateOnu request from openolt adapter
+ if intitalState == "disabled" {
+ if err := onu.InternalState.Event("enable"); err != nil {
+ logger.WithFields(log.Fields{
+ "OnuId": onu.ID,
+ "IntfId": onu.PonPortID,
+ "OnuSn": onu.Sn(),
+ }).Errorf("Cannot enable ONU: %s", err.Error())
+ res.StatusCode = int32(codes.FailedPrecondition)
+ res.Message = err.Error()
+ return res, err
+ }
+ }
+
+ res.StatusCode = int32(codes.OK)
+ res.Message = fmt.Sprintf("ONU %s successfully powered on.", onu.Sn())
+
+ return res, nil
+}
+
+func handleShutdownONU(onu *devices.Onu) (*bbsim.Response, error) {
+ res := &bbsim.Response{}
+ olt := devices.GetOLT()
+
+ dyingGasp := bbsim.ONUAlarmRequest{
+ AlarmType: "DyingGasp",
+ SerialNumber: onu.Sn(),
+ Status: "on",
+ }
+
+ if err := alarmsim.SimulateOnuAlarm(context.TODO(), &dyingGasp, olt); err != nil {
+ logger.WithFields(log.Fields{
+ "OnuId": onu.ID,
+ "IntfId": onu.PonPortID,
+ "OnuSn": onu.Sn(),
+ }).Errorf("Cannot send Dying Gasp: %s", err.Error())
+ res.StatusCode = int32(codes.FailedPrecondition)
+ res.Message = err.Error()
+ return res, err
+ }
+
+ losReq := bbsim.ONUAlarmRequest{
+ AlarmType: "LossOfSignal",
+ SerialNumber: onu.Sn(),
+ Status: "on",
+ }
+
+ if err := alarmsim.SimulateOnuAlarm(context.TODO(), &losReq, olt); err != nil {
+ logger.WithFields(log.Fields{
+ "OnuId": onu.ID,
+ "IntfId": onu.PonPortID,
+ "OnuSn": onu.Sn(),
+ }).Errorf("Cannot send LOS: %s", err.Error())
+ res.StatusCode = int32(codes.FailedPrecondition)
+ res.Message = err.Error()
+ return res, err
+ }
+
+ // TODO if it's the last ONU on the PON, then send a PON LOS
+
+ if err := onu.InternalState.Event("disable"); err != nil {
+ logger.WithFields(log.Fields{
+ "OnuId": onu.ID,
+ "IntfId": onu.PonPortID,
+ "OnuSn": onu.Sn(),
+ }).Errorf("Cannot shutdown ONU: %s", err.Error())
+ res.StatusCode = int32(codes.FailedPrecondition)
+ res.Message = err.Error()
+ return res, err
+ }
+
+ res.StatusCode = int32(codes.OK)
+ res.Message = fmt.Sprintf("ONU %s successfully shut down.", onu.Sn())
+
+ return res, nil
+}
diff --git a/internal/bbsimctl/commands/olt.go b/internal/bbsimctl/commands/olt.go
index 3ea004c..a16edef 100644
--- a/internal/bbsimctl/commands/olt.go
+++ b/internal/bbsimctl/commands/olt.go
@@ -51,15 +51,21 @@
type OltFlows struct{}
+type OltPoweronAllOnus struct{}
+
+type OltShutdownAllOnus struct{}
+
type oltOptions struct {
- Get OltGet `command:"get"`
- NNI OltNNIs `command:"nnis"`
- PON OltPONs `command:"pons"`
- Shutdown OltShutdown `command:"shutdown"`
- Poweron OltPoweron `command:"poweron"`
- Reboot OltReboot `command:"reboot"`
- Alarms OltAlarmOptions `command:"alarms"`
- Flows OltFlows `command:"flows"`
+ Get OltGet `command:"get"`
+ NNI OltNNIs `command:"nnis"`
+ PON OltPONs `command:"pons"`
+ Shutdown OltShutdown `command:"shutdown"`
+ Poweron OltPoweron `command:"poweron"`
+ Reboot OltReboot `command:"reboot"`
+ Alarms OltAlarmOptions `command:"alarms"`
+ Flows OltFlows `command:"flows"`
+ PoweronAllOnus OltPoweronAllOnus `command:"poweronAllONUs"`
+ ShutdownAllOnus OltShutdownAllOnus `command:"shutdownAllONUs"`
}
func RegisterOltCommands(parser *flags.Parser) {
@@ -243,3 +249,39 @@
tableFlow.SetNewLine("")
return nil
}
+
+func (o *OltPoweronAllOnus) Execute(args []string) error {
+ client, conn := connect()
+ defer conn.Close()
+
+ ctx, cancel := context.WithTimeout(context.Background(), config.GlobalConfig.Grpc.Timeout)
+ defer cancel()
+
+ res, err := client.PoweronAllONUs(ctx, &pb.Empty{})
+
+ if err != nil {
+ log.Errorf("Cannot poweron all ONUs: %v", err)
+ return err
+ }
+
+ fmt.Println(fmt.Sprintf("[Status: %d] %s", res.StatusCode, res.Message))
+ return nil
+}
+
+func (o *OltShutdownAllOnus) Execute(args []string) error {
+ client, conn := connect()
+ defer conn.Close()
+
+ ctx, cancel := context.WithTimeout(context.Background(), config.GlobalConfig.Grpc.Timeout)
+ defer cancel()
+
+ res, err := client.ShutdownAllONUs(ctx, &pb.Empty{})
+
+ if err != nil {
+ log.Errorf("Cannot shutdown all ONUs: %v", err)
+ return err
+ }
+
+ fmt.Println(fmt.Sprintf("[Status: %d] %s", res.StatusCode, res.Message))
+ return nil
+}
diff --git a/internal/bbsimctl/commands/pon.go b/internal/bbsimctl/commands/pon.go
new file mode 100644
index 0000000..885fb75
--- /dev/null
+++ b/internal/bbsimctl/commands/pon.go
@@ -0,0 +1,91 @@
+/*
+ * Portions copyright 2019-present Open Networking Foundation
+ * Original copyright 2019-present Ciena Corporation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package commands
+
+import (
+ "context"
+ "fmt"
+
+ "github.com/jessevdk/go-flags"
+ pb "github.com/opencord/bbsim/api/bbsim"
+ "github.com/opencord/bbsim/internal/bbsimctl/config"
+ log "github.com/sirupsen/logrus"
+)
+
+type PonPoweronAllOnus struct {
+ Args struct {
+ IntfID OltInterfaceID
+ } `positional-args:"yes" required:"yes"`
+}
+
+type PonShutdownAllOnus struct {
+ Args struct {
+ IntfID OltInterfaceID
+ } `positional-args:"yes" required:"yes"`
+}
+
+type PONOptions struct {
+ PoweronAllOnus PonPoweronAllOnus `command:"poweronAllONUs"`
+ ShutdownAllOnus PonShutdownAllOnus `command:"shutdownAllONUs"`
+}
+
+func RegisterPonCommands(parser *flags.Parser) {
+ parser.AddCommand("pon", "PON Commands", "Commands to query and manipulate the PON port", &PONOptions{})
+}
+
+func (pon *PonPoweronAllOnus) Execute(args []string) error {
+ client, conn := connect()
+ defer conn.Close()
+
+ ctx, cancel := context.WithTimeout(context.Background(), config.GlobalConfig.Grpc.Timeout)
+ defer cancel()
+
+ req := pb.PONRequest{
+ PonPortId: uint32(pon.Args.IntfID),
+ }
+
+ res, err := client.PoweronONUsOnPON(ctx, &req)
+ if err != nil {
+ log.Errorf("Cannot poweron all ONUs on PON port: %v", err)
+ return err
+ }
+
+ fmt.Println(fmt.Sprintf("[Status: %d] %s", res.StatusCode, res.Message))
+ return nil
+}
+
+func (pon *PonShutdownAllOnus) Execute(args []string) error {
+ client, conn := connect()
+ defer conn.Close()
+
+ ctx, cancel := context.WithTimeout(context.Background(), config.GlobalConfig.Grpc.Timeout)
+ defer cancel()
+
+ req := pb.PONRequest{
+ PonPortId: uint32(pon.Args.IntfID),
+ }
+
+ res, err := client.ShutdownONUsOnPON(ctx, &req)
+ if err != nil {
+ log.Errorf("Cannot shutdown all ONUs on PON port: %v", err)
+ return err
+ }
+
+ fmt.Println(fmt.Sprintf("[Status: %d] %s", res.StatusCode, res.Message))
+ return nil
+}