SEBA-827: Implement OLT Alarms with REST and bbsimctl
separate onu and olt alarms
rebase
address review comments and print alarms table for list
Change-Id: I3bc8aa03908f973c3342ec93c7399895c48639a2
diff --git a/api/bbsim/bbsim.pb.go b/api/bbsim/bbsim.pb.go
index ca04c84..c827cd4 100644
--- a/api/bbsim/bbsim.pb.go
+++ b/api/bbsim/bbsim.pb.go
@@ -604,10 +604,10 @@
return ""
}
-// AlarmRequest includes fields common to every alarm,
+// ONUAlarmRequest includes fields common to every Onu alarm,
// plus an optional list of AlarmParameter list that can be used
// to set additional fields in alarms that support them.
-type AlarmRequest struct {
+type ONUAlarmRequest struct {
AlarmType string `protobuf:"bytes,1,opt,name=AlarmType,proto3" json:"AlarmType,omitempty"`
SerialNumber string `protobuf:"bytes,2,opt,name=SerialNumber,proto3" json:"SerialNumber,omitempty"`
Status string `protobuf:"bytes,3,opt,name=Status,proto3" json:"Status,omitempty"`
@@ -617,59 +617,115 @@
XXX_sizecache int32 `json:"-"`
}
-func (m *AlarmRequest) Reset() { *m = AlarmRequest{} }
-func (m *AlarmRequest) String() string { return proto.CompactTextString(m) }
-func (*AlarmRequest) ProtoMessage() {}
-func (*AlarmRequest) Descriptor() ([]byte, []int) {
+func (m *ONUAlarmRequest) Reset() { *m = ONUAlarmRequest{} }
+func (m *ONUAlarmRequest) String() string { return proto.CompactTextString(m) }
+func (*ONUAlarmRequest) ProtoMessage() {}
+func (*ONUAlarmRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_ef7750073d18011b, []int{9}
}
-func (m *AlarmRequest) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_AlarmRequest.Unmarshal(m, b)
+func (m *ONUAlarmRequest) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_ONUAlarmRequest.Unmarshal(m, b)
}
-func (m *AlarmRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_AlarmRequest.Marshal(b, m, deterministic)
+func (m *ONUAlarmRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_ONUAlarmRequest.Marshal(b, m, deterministic)
}
-func (m *AlarmRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_AlarmRequest.Merge(m, src)
+func (m *ONUAlarmRequest) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_ONUAlarmRequest.Merge(m, src)
}
-func (m *AlarmRequest) XXX_Size() int {
- return xxx_messageInfo_AlarmRequest.Size(m)
+func (m *ONUAlarmRequest) XXX_Size() int {
+ return xxx_messageInfo_ONUAlarmRequest.Size(m)
}
-func (m *AlarmRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_AlarmRequest.DiscardUnknown(m)
+func (m *ONUAlarmRequest) XXX_DiscardUnknown() {
+ xxx_messageInfo_ONUAlarmRequest.DiscardUnknown(m)
}
-var xxx_messageInfo_AlarmRequest proto.InternalMessageInfo
+var xxx_messageInfo_ONUAlarmRequest proto.InternalMessageInfo
-func (m *AlarmRequest) GetAlarmType() string {
+func (m *ONUAlarmRequest) GetAlarmType() string {
if m != nil {
return m.AlarmType
}
return ""
}
-func (m *AlarmRequest) GetSerialNumber() string {
+func (m *ONUAlarmRequest) GetSerialNumber() string {
if m != nil {
return m.SerialNumber
}
return ""
}
-func (m *AlarmRequest) GetStatus() string {
+func (m *ONUAlarmRequest) GetStatus() string {
if m != nil {
return m.Status
}
return ""
}
-func (m *AlarmRequest) GetParameters() []*AlarmParameter {
+func (m *ONUAlarmRequest) GetParameters() []*AlarmParameter {
if m != nil {
return m.Parameters
}
return nil
}
+// OLT alarm request
+type OLTAlarmRequest struct {
+ InterfaceID uint32 `protobuf:"varint,1,opt,name=InterfaceID,proto3" json:"InterfaceID,omitempty"`
+ InterfaceType string `protobuf:"bytes,2,opt,name=InterfaceType,proto3" json:"InterfaceType,omitempty"`
+ Status string `protobuf:"bytes,3,opt,name=Status,proto3" json:"Status,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *OLTAlarmRequest) Reset() { *m = OLTAlarmRequest{} }
+func (m *OLTAlarmRequest) String() string { return proto.CompactTextString(m) }
+func (*OLTAlarmRequest) ProtoMessage() {}
+func (*OLTAlarmRequest) Descriptor() ([]byte, []int) {
+ return fileDescriptor_ef7750073d18011b, []int{10}
+}
+
+func (m *OLTAlarmRequest) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_OLTAlarmRequest.Unmarshal(m, b)
+}
+func (m *OLTAlarmRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_OLTAlarmRequest.Marshal(b, m, deterministic)
+}
+func (m *OLTAlarmRequest) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_OLTAlarmRequest.Merge(m, src)
+}
+func (m *OLTAlarmRequest) XXX_Size() int {
+ return xxx_messageInfo_OLTAlarmRequest.Size(m)
+}
+func (m *OLTAlarmRequest) XXX_DiscardUnknown() {
+ xxx_messageInfo_OLTAlarmRequest.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_OLTAlarmRequest proto.InternalMessageInfo
+
+func (m *OLTAlarmRequest) GetInterfaceID() uint32 {
+ if m != nil {
+ return m.InterfaceID
+ }
+ return 0
+}
+
+func (m *OLTAlarmRequest) GetInterfaceType() string {
+ if m != nil {
+ return m.InterfaceType
+ }
+ return ""
+}
+
+func (m *OLTAlarmRequest) GetStatus() string {
+ if m != nil {
+ return m.Status
+ }
+ return ""
+}
+
type VersionNumber struct {
Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
BuildTime string `protobuf:"bytes,2,opt,name=buildTime,proto3" json:"buildTime,omitempty"`
@@ -684,7 +740,7 @@
func (m *VersionNumber) String() string { return proto.CompactTextString(m) }
func (*VersionNumber) ProtoMessage() {}
func (*VersionNumber) Descriptor() ([]byte, []int) {
- return fileDescriptor_ef7750073d18011b, []int{10}
+ return fileDescriptor_ef7750073d18011b, []int{11}
}
func (m *VersionNumber) XXX_Unmarshal(b []byte) error {
@@ -745,7 +801,7 @@
func (m *LogLevel) String() string { return proto.CompactTextString(m) }
func (*LogLevel) ProtoMessage() {}
func (*LogLevel) Descriptor() ([]byte, []int) {
- return fileDescriptor_ef7750073d18011b, []int{11}
+ return fileDescriptor_ef7750073d18011b, []int{12}
}
func (m *LogLevel) XXX_Unmarshal(b []byte) error {
@@ -792,7 +848,7 @@
func (m *Response) String() string { return proto.CompactTextString(m) }
func (*Response) ProtoMessage() {}
func (*Response) Descriptor() ([]byte, []int) {
- return fileDescriptor_ef7750073d18011b, []int{12}
+ return fileDescriptor_ef7750073d18011b, []int{13}
}
func (m *Response) XXX_Unmarshal(b []byte) error {
@@ -839,7 +895,7 @@
func (m *IgmpRequest) String() string { return proto.CompactTextString(m) }
func (*IgmpRequest) ProtoMessage() {}
func (*IgmpRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_ef7750073d18011b, []int{13}
+ return fileDescriptor_ef7750073d18011b, []int{14}
}
func (m *IgmpRequest) XXX_Unmarshal(b []byte) error {
@@ -884,7 +940,7 @@
func (m *Empty) String() string { return proto.CompactTextString(m) }
func (*Empty) ProtoMessage() {}
func (*Empty) Descriptor() ([]byte, []int) {
- return fileDescriptor_ef7750073d18011b, []int{14}
+ return fileDescriptor_ef7750073d18011b, []int{15}
}
func (m *Empty) XXX_Unmarshal(b []byte) error {
@@ -917,7 +973,8 @@
proto.RegisterType((*ONURequest)(nil), "bbsim.ONURequest")
proto.RegisterType((*AlarmType)(nil), "bbsim.AlarmType")
proto.RegisterType((*AlarmParameter)(nil), "bbsim.AlarmParameter")
- proto.RegisterType((*AlarmRequest)(nil), "bbsim.AlarmRequest")
+ proto.RegisterType((*ONUAlarmRequest)(nil), "bbsim.ONUAlarmRequest")
+ proto.RegisterType((*OLTAlarmRequest)(nil), "bbsim.OLTAlarmRequest")
proto.RegisterType((*VersionNumber)(nil), "bbsim.VersionNumber")
proto.RegisterType((*LogLevel)(nil), "bbsim.LogLevel")
proto.RegisterType((*Response)(nil), "bbsim.Response")
@@ -928,81 +985,84 @@
func init() { proto.RegisterFile("api/bbsim/bbsim.proto", fileDescriptor_ef7750073d18011b) }
var fileDescriptor_ef7750073d18011b = []byte{
- // 1172 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0x4f, 0x6f, 0xe2, 0x46,
- 0x14, 0x87, 0xf0, 0xff, 0x41, 0x88, 0x33, 0xbb, 0x9b, 0xb5, 0xd2, 0xa8, 0x8b, 0xac, 0x6d, 0x95,
- 0x5d, 0xb5, 0xd9, 0x6e, 0xd2, 0xaa, 0x5b, 0xa9, 0x17, 0x07, 0x1c, 0xe2, 0x86, 0x8c, 0xd1, 0xd8,
- 0x10, 0xe5, 0x64, 0x19, 0x98, 0x80, 0x25, 0x1b, 0xb3, 0xb6, 0x49, 0x94, 0x0f, 0xd0, 0x4b, 0xbf,
- 0x44, 0xbf, 0x52, 0x2f, 0xbd, 0xf6, 0x7b, 0xf4, 0x56, 0x8d, 0x3d, 0x36, 0x38, 0x44, 0x15, 0xea,
- 0xa5, 0x17, 0x34, 0xef, 0xf7, 0x7e, 0xbf, 0x37, 0x6f, 0xde, 0x9b, 0x79, 0x18, 0x5e, 0x59, 0x0b,
- 0xfb, 0xc3, 0x68, 0x14, 0xd8, 0x6e, 0xfc, 0x7b, 0xb2, 0xf0, 0xbd, 0xd0, 0x43, 0xa5, 0xc8, 0x38,
- 0x6c, 0xdd, 0x7b, 0x4e, 0x38, 0xb3, 0xcc, 0x08, 0x0c, 0x3e, 0x84, 0x74, 0x3c, 0x63, 0xeb, 0x3b,
- 0xdb, 0xa1, 0x31, 0x51, 0xfa, 0x11, 0x2a, 0x7d, 0x0d, 0xf7, 0x3d, 0x3f, 0x44, 0x4d, 0xd8, 0x51,
- 0x3b, 0x62, 0xbe, 0x95, 0x3f, 0x2e, 0x91, 0x1d, 0xb5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0x4f, 0x97, 0x0f, 0x14, 0x5d, 0xc0, 0x81, 0x45, 0x99, 0xb9,
+ 0x58, 0x89, 0xb9, 0x63, 0x2c, 0x66, 0xde, 0xd4, 0xe5, 0xd7, 0x10, 0x1d, 0xae, 0xe5, 0xf9, 0x91,
+ 0xf4, 0x0f, 0x3e, 0x7c, 0xf6, 0x45, 0x1f, 0xc5, 0xb1, 0x76, 0x9f, 0x8f, 0xd7, 0xb0, 0xd7, 0x9b,
+ 0xbb, 0x8b, 0x5b, 0xca, 0x9f, 0x61, 0xf2, 0x57, 0x08, 0x49, 0x56, 0xee, 0x61, 0xde, 0xa7, 0x7c,
+ 0x0b, 0x4f, 0x06, 0x22, 0x83, 0xcd, 0x3f, 0x2e, 0xf7, 0x94, 0xe0, 0x7f, 0x6b, 0x68, 0x83, 0xaf,
+ 0x96, 0x26, 0x35, 0xf1, 0x7f, 0xfa, 0xfc, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x78, 0xb1, 0x13,
+ 0x0e, 0x91, 0x0b, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@@ -1029,7 +1089,8 @@
PoweronONU(ctx context.Context, in *ONURequest, 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)
- SetAlarmIndication(ctx context.Context, in *AlarmRequest, opts ...grpc.CallOption) (*Response, error)
+ SetOnuAlarmIndication(ctx context.Context, in *ONUAlarmRequest, opts ...grpc.CallOption) (*Response, error)
+ SetOltAlarmIndication(ctx context.Context, in *OLTAlarmRequest, opts ...grpc.CallOption) (*Response, error)
ChangeIgmpState(ctx context.Context, in *IgmpRequest, opts ...grpc.CallOption) (*Response, error)
GetOnuTrafficSchedulers(ctx context.Context, in *ONURequest, opts ...grpc.CallOption) (*ONUTrafficSchedulers, error)
}
@@ -1150,9 +1211,18 @@
return out, nil
}
-func (c *bBSimClient) SetAlarmIndication(ctx context.Context, in *AlarmRequest, opts ...grpc.CallOption) (*Response, error) {
+func (c *bBSimClient) SetOnuAlarmIndication(ctx context.Context, in *ONUAlarmRequest, opts ...grpc.CallOption) (*Response, error) {
out := new(Response)
- err := c.cc.Invoke(ctx, "/bbsim.BBSim/SetAlarmIndication", in, out, opts...)
+ err := c.cc.Invoke(ctx, "/bbsim.BBSim/SetOnuAlarmIndication", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *bBSimClient) SetOltAlarmIndication(ctx context.Context, in *OLTAlarmRequest, opts ...grpc.CallOption) (*Response, error) {
+ out := new(Response)
+ err := c.cc.Invoke(ctx, "/bbsim.BBSim/SetOltAlarmIndication", in, out, opts...)
if err != nil {
return nil, err
}
@@ -1191,7 +1261,8 @@
PoweronONU(context.Context, *ONURequest) (*Response, error)
RestartEapol(context.Context, *ONURequest) (*Response, error)
RestartDhcp(context.Context, *ONURequest) (*Response, error)
- SetAlarmIndication(context.Context, *AlarmRequest) (*Response, error)
+ SetOnuAlarmIndication(context.Context, *ONUAlarmRequest) (*Response, error)
+ SetOltAlarmIndication(context.Context, *OLTAlarmRequest) (*Response, error)
ChangeIgmpState(context.Context, *IgmpRequest) (*Response, error)
GetOnuTrafficSchedulers(context.Context, *ONURequest) (*ONUTrafficSchedulers, error)
}
@@ -1236,8 +1307,11 @@
func (*UnimplementedBBSimServer) RestartDhcp(ctx context.Context, req *ONURequest) (*Response, error) {
return nil, status.Errorf(codes.Unimplemented, "method RestartDhcp not implemented")
}
-func (*UnimplementedBBSimServer) SetAlarmIndication(ctx context.Context, req *AlarmRequest) (*Response, error) {
- return nil, status.Errorf(codes.Unimplemented, "method SetAlarmIndication 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) ChangeIgmpState(ctx context.Context, req *IgmpRequest) (*Response, error) {
return nil, status.Errorf(codes.Unimplemented, "method ChangeIgmpState not implemented")
@@ -1466,20 +1540,38 @@
return interceptor(ctx, in, info, handler)
}
-func _BBSim_SetAlarmIndication_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(AlarmRequest)
+func _BBSim_SetOnuAlarmIndication_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(ONUAlarmRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
- return srv.(BBSimServer).SetAlarmIndication(ctx, in)
+ return srv.(BBSimServer).SetOnuAlarmIndication(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
- FullMethod: "/bbsim.BBSim/SetAlarmIndication",
+ FullMethod: "/bbsim.BBSim/SetOnuAlarmIndication",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(BBSimServer).SetAlarmIndication(ctx, req.(*AlarmRequest))
+ return srv.(BBSimServer).SetOnuAlarmIndication(ctx, req.(*ONUAlarmRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _BBSim_SetOltAlarmIndication_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(OLTAlarmRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(BBSimServer).SetOltAlarmIndication(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/bbsim.BBSim/SetOltAlarmIndication",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(BBSimServer).SetOltAlarmIndication(ctx, req.(*OLTAlarmRequest))
}
return interceptor(ctx, in, info, handler)
}
@@ -1573,8 +1665,12 @@
Handler: _BBSim_RestartDhcp_Handler,
},
{
- MethodName: "SetAlarmIndication",
- Handler: _BBSim_SetAlarmIndication_Handler,
+ MethodName: "SetOnuAlarmIndication",
+ Handler: _BBSim_SetOnuAlarmIndication_Handler,
+ },
+ {
+ MethodName: "SetOltAlarmIndication",
+ Handler: _BBSim_SetOltAlarmIndication_Handler,
},
{
MethodName: "ChangeIgmpState",
diff --git a/api/bbsim/bbsim.pb.gw.go b/api/bbsim/bbsim.pb.gw.go
index 32d8670..d15e5a7 100644
--- a/api/bbsim/bbsim.pb.gw.go
+++ b/api/bbsim/bbsim.pb.gw.go
@@ -266,11 +266,11 @@
}
var (
- filter_BBSim_SetAlarmIndication_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}}
+ 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}}
)
-func request_BBSim_SetAlarmIndication_0(ctx context.Context, marshaler runtime.Marshaler, client BBSimClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var protoReq AlarmRequest
+func request_BBSim_SetOnuAlarmIndication_0(ctx context.Context, marshaler runtime.Marshaler, client BBSimClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq ONUAlarmRequest
var metadata runtime.ServerMetadata
var (
@@ -316,17 +316,17 @@
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
- if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BBSim_SetAlarmIndication_0); err != nil {
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BBSim_SetOnuAlarmIndication_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
- msg, err := client.SetAlarmIndication(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ msg, err := client.SetOnuAlarmIndication(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
-func local_request_BBSim_SetAlarmIndication_0(ctx context.Context, marshaler runtime.Marshaler, server BBSimServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var protoReq AlarmRequest
+func local_request_BBSim_SetOnuAlarmIndication_0(ctx context.Context, marshaler runtime.Marshaler, server BBSimServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq ONUAlarmRequest
var metadata runtime.ServerMetadata
var (
@@ -369,11 +369,109 @@
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "Status", err)
}
- if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_BBSim_SetAlarmIndication_0); err != nil {
+ if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_BBSim_SetOnuAlarmIndication_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
- msg, err := server.SetAlarmIndication(ctx, &protoReq)
+ msg, err := server.SetOnuAlarmIndication(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
+func request_BBSim_SetOltAlarmIndication_0(ctx context.Context, marshaler runtime.Marshaler, client BBSimClient, 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["InterfaceType"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "InterfaceType")
+ }
+
+ protoReq.InterfaceType, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "InterfaceType", err)
+ }
+
+ val, ok = pathParams["InterfaceID"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "InterfaceID")
+ }
+
+ protoReq.InterfaceID, err = runtime.Uint32(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "InterfaceID", 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 := client.SetOltAlarmIndication(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_BBSim_SetOltAlarmIndication_0(ctx context.Context, marshaler runtime.Marshaler, server BBSimServer, 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["InterfaceType"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "InterfaceType")
+ }
+
+ protoReq.InterfaceType, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "InterfaceType", err)
+ }
+
+ val, ok = pathParams["InterfaceID"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "InterfaceID")
+ }
+
+ protoReq.InterfaceID, err = runtime.Uint32(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "InterfaceID", 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.SetOltAlarmIndication(ctx, &protoReq)
return msg, metadata, err
}
@@ -577,7 +675,7 @@
})
- mux.Handle("POST", pattern_BBSim_SetAlarmIndication_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ 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()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
@@ -586,14 +684,34 @@
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
- resp, md, err := local_request_BBSim_SetAlarmIndication_0(rctx, inboundMarshaler, server, req, pathParams)
+ resp, md, err := local_request_BBSim_SetOnuAlarmIndication_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_SetAlarmIndication_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ forward_BBSim_SetOnuAlarmIndication_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("POST", pattern_BBSim_SetOltAlarmIndication_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_SetOltAlarmIndication_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_SetOltAlarmIndication_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
@@ -798,7 +916,7 @@
})
- mux.Handle("POST", pattern_BBSim_SetAlarmIndication_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ 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()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
@@ -807,14 +925,34 @@
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
- resp, md, err := request_BBSim_SetAlarmIndication_0(rctx, inboundMarshaler, client, req, pathParams)
+ resp, md, err := request_BBSim_SetOnuAlarmIndication_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_SetAlarmIndication_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ forward_BBSim_SetOnuAlarmIndication_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("POST", pattern_BBSim_SetOltAlarmIndication_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_SetOltAlarmIndication_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_SetOltAlarmIndication_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
@@ -856,7 +994,9 @@
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_SetAlarmIndication_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_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)))
pattern_BBSim_GetOnuTrafficSchedulers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"v1", "olt", "onus", "SerialNumber", "trafficschedulers"}, "", runtime.AssumeColonVerbOpt(true)))
)
@@ -876,7 +1016,9 @@
forward_BBSim_PoweronONU_0 = runtime.ForwardResponseMessage
- forward_BBSim_SetAlarmIndication_0 = runtime.ForwardResponseMessage
+ forward_BBSim_SetOnuAlarmIndication_0 = runtime.ForwardResponseMessage
+
+ forward_BBSim_SetOltAlarmIndication_0 = runtime.ForwardResponseMessage
forward_BBSim_GetOnuTrafficSchedulers_0 = runtime.ForwardResponseMessage
)
diff --git a/api/bbsim/bbsim.proto b/api/bbsim/bbsim.proto
index a9643b6..57e1de7 100644
--- a/api/bbsim/bbsim.proto
+++ b/api/bbsim/bbsim.proto
@@ -99,16 +99,23 @@
string Value = 2;
}
-// AlarmRequest includes fields common to every alarm,
+// ONUAlarmRequest includes fields common to every Onu alarm,
// plus an optional list of AlarmParameter list that can be used
// to set additional fields in alarms that support them.
-message AlarmRequest {
+message ONUAlarmRequest {
string AlarmType = 1; // name of alarm to raise
string SerialNumber = 2; // serial number of ONU
string Status = 3; // status of Alarm
repeated AlarmParameter Parameters = 4; // optional list of additional parameters
}
+// OLT alarm request
+message OLTAlarmRequest {
+ uint32 InterfaceID = 1; // Switch Interface Id
+ string InterfaceType = 2; // PON or NNI Type
+ string Status = 3; // Interface Operstatus
+}
+
// Utils
message VersionNumber {
@@ -154,7 +161,8 @@
rpc PoweronONU (ONURequest) returns (Response) {}
rpc RestartEapol (ONURequest) returns (Response) {}
rpc RestartDhcp (ONURequest) returns (Response) {}
- rpc SetAlarmIndication (AlarmRequest) returns (Response) {}
+ rpc SetOnuAlarmIndication (ONUAlarmRequest) returns (Response) {}
+ rpc SetOltAlarmIndication (OLTAlarmRequest) returns (Response) {}
rpc ChangeIgmpState (IgmpRequest) returns (Response) {}
rpc GetOnuTrafficSchedulers (ONURequest) returns (ONUTrafficSchedulers) {}
}
diff --git a/api/bbsim/bbsim.yaml b/api/bbsim/bbsim.yaml
index 977102a..1d69552 100644
--- a/api/bbsim/bbsim.yaml
+++ b/api/bbsim/bbsim.yaml
@@ -31,7 +31,9 @@
delete: "/v1/olt/onus/{SerialNumber}"
- selector: bbsim.BBSim.PoweronONU
post: "/v1/olt/onus/{SerialNumber}"
- - selector: bbsim.BBSim.SetAlarmIndication
+ - 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.SetOltAlarmIndication
+ post: "/v1/olt/ports/{InterfaceType}/{InterfaceID}/alarms/los/{Status}"
diff --git a/cmd/bbsimctl/bbsimctl.go b/cmd/bbsimctl/bbsimctl.go
index f82cd64..3c69890 100644
--- a/cmd/bbsimctl/bbsimctl.go
+++ b/cmd/bbsimctl/bbsimctl.go
@@ -18,11 +18,12 @@
import (
"fmt"
+ "os"
+ "path"
+
"github.com/jessevdk/go-flags"
"github.com/opencord/bbsim/internal/bbsimctl/commands"
"github.com/opencord/bbsim/internal/bbsimctl/config"
- "os"
- "path"
)
func main() {
@@ -39,7 +40,6 @@
commands.RegisterONUCommands(parser)
commands.RegisterCompletionCommands(parser)
commands.RegisterLoggingCommands(parser)
- commands.RegisterAlarmCommands(parser)
_, err = parser.ParseArgs(os.Args[1:])
if err != nil {
diff --git a/internal/bbsim/alarmsim/alarmsim.go b/internal/bbsim/alarmsim/alarmsim.go
index 9607526..266282a 100644
--- a/internal/bbsim/alarmsim/alarmsim.go
+++ b/internal/bbsim/alarmsim/alarmsim.go
@@ -19,14 +19,17 @@
import (
"context"
"fmt"
+ "strconv"
+
"github.com/opencord/bbsim/api/bbsim"
"github.com/opencord/bbsim/internal/bbsim/devices"
"github.com/opencord/voltha-protos/v2/go/openolt"
- "strconv"
+ "google.golang.org/grpc/codes"
+ "google.golang.org/grpc/status"
)
-// AlarmNameMap string to enum map
-var AlarmNameMap = map[string]bbsim.AlarmType_Types{
+// OnuAlarmNameMap string to enum map
+var OnuAlarmNameMap = map[string]bbsim.AlarmType_Types{
"DyingGasp": bbsim.AlarmType_DYING_GASP,
"StartupFailure": bbsim.AlarmType_ONU_STARTUP_FAILURE,
"SignalDegrade": bbsim.AlarmType_ONU_SIGNAL_DEGRADE,
@@ -45,13 +48,18 @@
"LOPC_MIC_ERROR": bbsim.AlarmType_ONU_ALARM_LOPC_MIC_ERROR,
"LossOfFrame": bbsim.AlarmType_ONU_ALARM_LOFI,
"LossOfPloam": bbsim.AlarmType_ONU_ALARM_LOAMI,
+}
- // Whole-PON / Non-onu-specific
+// OltAlarmNameMap string to enum map
+var OltAlarmNameMap = map[string]bbsim.AlarmType_Types{
+ // PON / Non-onu-specific
"PonLossOfSignal": bbsim.AlarmType_LOS,
+ // NNI / Non-onu-specific
+ "NniLossOfSignal": bbsim.AlarmType_LOS,
}
func AlarmNameToEnum(name string) (*bbsim.AlarmType_Types, error) {
- v, okay := AlarmNameMap[name]
+ v, okay := OnuAlarmNameMap[name]
if !okay {
return nil, fmt.Errorf("Unknown Alarm Name: %v", name)
}
@@ -73,8 +81,8 @@
return def
}
-// BuildAlarmIndication function forms openolt alarmIndication as per AlarmRequest
-func BuildAlarmIndication(req *bbsim.AlarmRequest, o *devices.OltDevice) (*openolt.AlarmIndication, error) {
+// BuildOnuAlarmIndication function forms openolt alarmIndication as per ONUAlarmRequest
+func BuildOnuAlarmIndication(req *bbsim.ONUAlarmRequest, o *devices.OltDevice) (*openolt.AlarmIndication, error) {
var alarm *openolt.AlarmIndication
var onu *devices.Onu
var err error
@@ -93,14 +101,6 @@
}
switch *alarmType {
- case bbsim.AlarmType_LOS:
- alarm = &openolt.AlarmIndication{
- Data: &openolt.AlarmIndication_LosInd{&openolt.LosIndication{
- // No ONU Id for LOS
- Status: req.Status,
- IntfId: uint32(extractInt(req.Parameters, "InterfaceId", 0)),
- }},
- }
case bbsim.AlarmType_DYING_GASP:
alarm = &openolt.AlarmIndication{
Data: &openolt.AlarmIndication_DyingGaspInd{&openolt.DyingGaspIndication{
@@ -248,9 +248,9 @@
return alarm, nil
}
-// SimulateAlarm accept request for alarms and send proper alarmIndication to openolt stream
-func SimulateAlarm(ctx context.Context, req *bbsim.AlarmRequest, o *devices.OltDevice) error {
- alarmIndication, err := BuildAlarmIndication(req, o)
+// SimulateOnuAlarm accept request for Onu alarms and send proper alarmIndication to openolt stream
+func SimulateOnuAlarm(ctx context.Context, req *bbsim.ONUAlarmRequest, o *devices.OltDevice) error {
+ alarmIndication, err := BuildOnuAlarmIndication(req, o)
if err != nil {
return err
}
@@ -262,3 +262,73 @@
return nil
}
+
+// InterfaceIDToPortNo converts InterfaceID to voltha PortID
+// Refer openolt adapter code(master) voltha-openolt-adapter/adaptercore/olt_platform.go: IntfIDToPortNo()
+func InterfaceIDToPortNo(req *bbsim.OLTAlarmRequest) uint32 {
+ // Converts interface-id to port-numbers that can be understood by the VOLTHA
+ if req.InterfaceType == "nni" || req.InterfaceType == "PonLossOfSignal" {
+ // nni at voltha starts with 1,048,576
+ // nni = 1,048,576 + InterfaceID
+ return 0x1<<20 + req.InterfaceID
+ } else if req.InterfaceType == "pon" || req.InterfaceType == "NniLossOfSignal" {
+ // pon = 536,870,912 + InterfaceID
+ return (0x2 << 28) + req.InterfaceID
+ // In bbsim, pon starts from 1
+ }
+ return 0
+}
+
+// IsPonPortPresentInOlt verifies if given Pon port is present in olt
+func IsPonPortPresentInOlt(PonPort uint32) bool {
+ o := devices.GetOLT()
+ for _, intf := range o.Pons {
+ if intf.ID == PonPort {
+ return true
+ }
+ }
+ return false
+}
+
+// IsNniPortPresentInOlt verifies if given nni port is present in olt
+func IsNniPortPresentInOlt(nniPort uint32) bool {
+ o := devices.GetOLT()
+ for _, intf := range o.Nnis {
+ if intf.ID == nniPort {
+ return true
+ }
+ }
+ return false
+}
+
+// SimulateOltAlarm accept request for Olt alarms and send proper alarmIndication to openolt stream
+func SimulateOltAlarm(ctx context.Context, req *bbsim.OLTAlarmRequest, o *devices.OltDevice) error {
+ var alarmIndication *openolt.AlarmIndication
+ var err error
+
+ //check if its a valid port id
+ switch req.InterfaceType {
+ case "nni":
+ if !IsNniPortPresentInOlt(uint32(req.InterfaceID)) {
+ return status.Errorf(codes.NotFound, strconv.Itoa(int(req.InterfaceID))+" NNI not present in olt")
+ }
+
+ case "pon":
+ if !IsPonPortPresentInOlt(uint32(req.InterfaceID)) {
+ return status.Errorf(codes.NotFound, strconv.Itoa(int(req.InterfaceID))+" PON not present in olt")
+ }
+ }
+ alarmIndication = &openolt.AlarmIndication{
+ Data: &openolt.AlarmIndication_LosInd{&openolt.LosIndication{
+ Status: req.Status,
+ IntfId: InterfaceIDToPortNo(req),
+ }},
+ }
+
+ err = o.SendAlarmIndication(ctx, alarmIndication)
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
diff --git a/internal/bbsim/api/grpc_api_server.go b/internal/bbsim/api/grpc_api_server.go
index ca311ce..7191c2e 100644
--- a/internal/bbsim/api/grpc_api_server.go
+++ b/internal/bbsim/api/grpc_api_server.go
@@ -131,15 +131,29 @@
}, nil
}
-func (s BBSimServer) SetAlarmIndication(ctx context.Context, req *bbsim.AlarmRequest) (*bbsim.Response, error) {
+func (s BBSimServer) SetOnuAlarmIndication(ctx context.Context, req *bbsim.ONUAlarmRequest) (*bbsim.Response, error) {
o := devices.GetOLT()
- err := alarmsim.SimulateAlarm(ctx, req, o)
+ err := alarmsim.SimulateOnuAlarm(ctx, req, o)
if err != nil {
return nil, err
}
res := &bbsim.Response{}
res.StatusCode = int32(codes.OK)
- res.Message = fmt.Sprintf("Alarm Indication Sent.")
+ res.Message = fmt.Sprintf("Onu Alarm Indication Sent.")
+ return res, nil
+}
+
+// SetOltAlarmIndication generates OLT Alarms for LOS
+func (s BBSimServer) SetOltAlarmIndication(ctx context.Context, req *bbsim.OLTAlarmRequest) (*bbsim.Response, error) {
+ o := devices.GetOLT()
+ err := alarmsim.SimulateOltAlarm(ctx, req, o)
+ if err != nil {
+ return nil, err
+ }
+
+ res := &bbsim.Response{}
+ res.StatusCode = int32(codes.OK)
+ res.Message = fmt.Sprintf("Olt Alarm Indication Sent.")
return res, nil
}
diff --git a/internal/bbsimctl/commands/olt.go b/internal/bbsimctl/commands/olt.go
index 9ff6a30..d77cf77 100644
--- a/internal/bbsimctl/commands/olt.go
+++ b/internal/bbsimctl/commands/olt.go
@@ -47,12 +47,13 @@
type OltReboot 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"`
+ 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"`
}
func RegisterOltCommands(parser *flags.Parser) {
diff --git a/internal/bbsimctl/commands/oltalarms.go b/internal/bbsimctl/commands/oltalarms.go
new file mode 100755
index 0000000..645aade
--- /dev/null
+++ b/internal/bbsimctl/commands/oltalarms.go
@@ -0,0 +1,145 @@
+/*
+ * 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"
+ "os"
+ "strings"
+
+ "github.com/jessevdk/go-flags"
+ "github.com/olekukonko/tablewriter"
+ pb "github.com/opencord/bbsim/api/bbsim"
+ "github.com/opencord/bbsim/internal/bbsim/alarmsim"
+ "github.com/opencord/bbsim/internal/bbsimctl/config"
+ log "github.com/sirupsen/logrus"
+)
+
+const (
+ DEFAULT_OLT_ALARM_LIST_FORMAT = "table{{ .Name }}"
+)
+
+type OltInterfaceStatus string
+
+type OltInterfaceID uint32
+
+type OltAlarmNameString string
+
+type OltAlarmListOutput struct {
+ Name string
+}
+
+type OltAlarmRaise struct {
+ Args struct {
+ Name OltAlarmNameString
+ IntfID OltInterfaceID
+ } `positional-args:"yes" required:"yes"`
+}
+
+type OltAlarmClear struct {
+ Args struct {
+ Name OltAlarmNameString
+ IntfID OltInterfaceID
+ } `positional-args:"yes" required:"yes"`
+}
+
+type OltAlarmList struct{}
+
+type OltAlarmOptions struct {
+ Raise OltAlarmRaise `command:"raise"`
+ Clear OltAlarmClear `command:"clear"`
+ List OltAlarmList `command:"list"`
+}
+
+// Execute alarm raise
+func (o *OltAlarmRaise) Execute(args []string) error {
+ client, conn := connect()
+ defer conn.Close()
+
+ ctx, cancel := context.WithTimeout(context.Background(), config.GlobalConfig.Grpc.Timeout)
+ defer cancel()
+
+ req := pb.OLTAlarmRequest{InterfaceType: string(o.Args.Name),
+ InterfaceID: uint32(o.Args.IntfID),
+ Status: "on"}
+
+ res, err := client.SetOltAlarmIndication(ctx, &req)
+ if err != nil {
+ log.Fatalf("Cannot raise OLT alarm: %v", err)
+ return err
+ }
+
+ fmt.Println(fmt.Sprintf("[Status: %d] %s", res.StatusCode, res.Message))
+ return nil
+}
+
+// Execute alarm clear
+func (o *OltAlarmClear) Execute(args []string) error {
+ client, conn := connect()
+ defer conn.Close()
+
+ ctx, cancel := context.WithTimeout(context.Background(), config.GlobalConfig.Grpc.Timeout)
+ defer cancel()
+
+ req := pb.OLTAlarmRequest{InterfaceType: string(o.Args.Name),
+ InterfaceID: uint32(o.Args.IntfID),
+ Status: "off"}
+
+ res, err := client.SetOltAlarmIndication(ctx, &req)
+
+ if err != nil {
+ log.Fatalf("Cannot clear OLT alarm: %v", err)
+ return err
+ }
+
+ fmt.Println(fmt.Sprintf("[Status: %d] %s", res.StatusCode, res.Message))
+ return nil
+}
+
+// Execute OLT alarm list
+func (o *OltAlarmList) Execute(args []string) error {
+ OltAlarmsValue := [][]string{}
+ OltAlarmstable := tablewriter.NewWriter(os.Stdout)
+ fmt.Fprintf(os.Stdout, "OLT Alarms List:\n")
+ OltAlarmstable.SetHeader([]string{"OLT Alarms"})
+
+ alarmNames := make([]AlarmListOutput, len(alarmsim.OltAlarmNameMap))
+ i := 0
+ for k := range alarmsim.OltAlarmNameMap {
+ alarmNames[i] = AlarmListOutput{Name: k}
+ OltAlarmsValue = append(OltAlarmsValue, []string{k})
+ i++
+ }
+ for _, v := range OltAlarmsValue {
+ OltAlarmstable.Append(v)
+ }
+ OltAlarmstable.Render()
+ return nil
+}
+
+func (o *OltAlarmNameString) Complete(match string) []flags.Completion {
+ list := make([]flags.Completion, 0)
+ for k := range alarmsim.OltAlarmNameMap {
+ if strings.HasPrefix(k, match) {
+ list = append(list, flags.Completion{Item: k})
+ }
+ }
+
+ return list
+}
diff --git a/internal/bbsimctl/commands/onu.go b/internal/bbsimctl/commands/onu.go
index 9e41990..2815501 100644
--- a/internal/bbsimctl/commands/onu.go
+++ b/internal/bbsimctl/commands/onu.go
@@ -92,6 +92,7 @@
RestartDchp ONUDhcpRestart `command:"dhcp_restart"`
Igmp ONUIgmp `command:"igmp"`
TrafficSchedulers ONUTrafficSchedulers `command:"traffic_schedulers"`
+ Alarms AlarmOptions `command:"alarms"`
}
type ONUTrafficSchedulers struct {
diff --git a/internal/bbsimctl/commands/alarms.go b/internal/bbsimctl/commands/onualarms.go
similarity index 78%
rename from internal/bbsimctl/commands/alarms.go
rename to internal/bbsimctl/commands/onualarms.go
index 044d74a..dcf53a3 100755
--- a/internal/bbsimctl/commands/alarms.go
+++ b/internal/bbsimctl/commands/onualarms.go
@@ -20,18 +20,15 @@
import (
"context"
"fmt"
+ "os"
+ "strings"
+
"github.com/jessevdk/go-flags"
+ "github.com/olekukonko/tablewriter"
pb "github.com/opencord/bbsim/api/bbsim"
"github.com/opencord/bbsim/internal/bbsim/alarmsim"
"github.com/opencord/bbsim/internal/bbsimctl/config"
- "github.com/opencord/cordctl/pkg/format"
log "github.com/sirupsen/logrus"
- "os"
- "strings"
-)
-
-const (
- DEFAULT_ALARM_LIST_FORMAT = "table{{ .Name }}"
)
type AlarmNameString string
@@ -64,8 +61,8 @@
List AlarmList `command:"list"`
}
-// add optional parameters from the command-line to the AlarmRequest
-func addParameters(parameters []string, req *pb.AlarmRequest) error {
+// add optional parameters from the command-line to the ONUAlarmRequest
+func addParameters(parameters []string, req *pb.ONUAlarmRequest) error {
req.Parameters = make([]*pb.AlarmParameter, len(parameters))
for i, kv := range parameters {
parts := strings.Split(kv, "=")
@@ -77,10 +74,6 @@
return nil
}
-func RegisterAlarmCommands(parser *flags.Parser) {
- parser.AddCommand("alarm", "Alarm Commands", "Commands to raise and clear alarms", &AlarmOptions{})
-}
-
// Execute alarm raise
func (o *AlarmRaise) Execute(args []string) error {
client, conn := connect()
@@ -89,7 +82,7 @@
ctx, cancel := context.WithTimeout(context.Background(), config.GlobalConfig.Grpc.Timeout)
defer cancel()
- req := pb.AlarmRequest{AlarmType: string(o.Args.Name),
+ req := pb.ONUAlarmRequest{AlarmType: string(o.Args.Name),
SerialNumber: string(o.Args.SerialNumber),
Status: "on"}
@@ -98,7 +91,7 @@
return err
}
- res, err := client.SetAlarmIndication(ctx, &req)
+ res, err := client.SetOnuAlarmIndication(ctx, &req)
if err != nil {
log.Fatalf("Cannot raise alarm: %v", err)
return err
@@ -116,7 +109,7 @@
ctx, cancel := context.WithTimeout(context.Background(), config.GlobalConfig.Grpc.Timeout)
defer cancel()
- req := pb.AlarmRequest{AlarmType: string(o.Args.Name),
+ req := pb.ONUAlarmRequest{AlarmType: string(o.Args.Name),
SerialNumber: string(o.Args.SerialNumber),
Status: "off"}
@@ -125,7 +118,7 @@
return err
}
- res, err := client.SetAlarmIndication(ctx, &req)
+ res, err := client.SetOnuAlarmIndication(ctx, &req)
if err != nil {
log.Fatalf("Cannot clear alarm: %v", err)
@@ -136,23 +129,30 @@
return nil
}
-// Execute alarm list
+// Execute OLT alarm list
func (o *AlarmList) Execute(args []string) error {
- alarmNames := make([]AlarmListOutput, len(alarmsim.AlarmNameMap))
+ OnuAlarmsValue := [][]string{}
+ OnuAlarmstable := tablewriter.NewWriter(os.Stdout)
+ fmt.Fprintf(os.Stdout, "ONU Alarms List:\n")
+ OnuAlarmstable.SetHeader([]string{"ONU Alarms"})
+
+ alarmNames := make([]AlarmListOutput, len(alarmsim.OnuAlarmNameMap))
i := 0
- for k := range alarmsim.AlarmNameMap {
+ for k := range alarmsim.OnuAlarmNameMap {
alarmNames[i] = AlarmListOutput{Name: k}
+ OnuAlarmsValue = append(OnuAlarmsValue, []string{k})
i++
}
- // print out
- tableFormat := format.Format(DEFAULT_ALARM_LIST_FORMAT)
- tableFormat.Execute(os.Stdout, true, alarmNames)
+ for _, v := range OnuAlarmsValue {
+ OnuAlarmstable.Append(v)
+ }
+ OnuAlarmstable.Render()
return nil
}
func (onuSn *AlarmNameString) Complete(match string) []flags.Completion {
list := make([]flags.Completion, 0)
- for k := range alarmsim.AlarmNameMap {
+ for k := range alarmsim.OnuAlarmNameMap {
if strings.HasPrefix(k, match) {
list = append(list, flags.Completion{Item: k})
}