blob: 2f928441bce141b8744bd4e219418c4047f2e019 [file] [log] [blame]
Matteo Scandoloa8bd93e2018-09-13 13:36:50 -07001// Copyright 2018 Open Networking Foundation
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package main
16
Ganesh Bhure8d0c9942019-05-24 11:42:09 +053017// configuration
18type BrokerInfo struct {
Daniele Morobe242582019-10-01 14:02:46 -070019 Name string `yaml: name`
20 Host string `yaml: host`
21 Description string `yaml: description`
kesavandc71914f2022-03-25 11:19:03 +053022 Partitions int `yaml: partitions`
23 Replicas int `yaml: replicas`
Daniele Morobe242582019-10-01 14:02:46 -070024 Topics []string `yaml: topics`
Ganesh Bhure8d0c9942019-05-24 11:42:09 +053025}
Matteo Scandoloa8bd93e2018-09-13 13:36:50 -070026
Ganesh Bhure8d0c9942019-05-24 11:42:09 +053027type LoggerInfo struct {
Daniele Morobe242582019-10-01 14:02:46 -070028 LogLevel string `yaml: loglevel`
29 Host string `yaml: host`
Ganesh Bhure8d0c9942019-05-24 11:42:09 +053030}
31
32type TargetInfo struct {
Daniele Morobe242582019-10-01 14:02:46 -070033 Type string `yaml: type`
34 Name string `yaml: name`
35 Port int `yaml: port`
36 Description string `yaml: description`
Ganesh Bhure8d0c9942019-05-24 11:42:09 +053037}
38
kesavand0c064922020-12-15 15:36:25 +053039type ConvInfo struct {
kesavandc71914f2022-03-25 11:19:03 +053040 Onusnhex bool `yaml: onusnhex`
kesavand0c064922020-12-15 15:36:25 +053041}
42
Ganesh Bhure8d0c9942019-05-24 11:42:09 +053043type Config struct {
Daniele Morobe242582019-10-01 14:02:46 -070044 Broker BrokerInfo `yaml: broker`
45 Logger LoggerInfo `yaml: logger`
46 Target TargetInfo `yaml: "target"`
kesavand0c064922020-12-15 15:36:25 +053047 Conv ConvInfo `yaml: "conv"`
Ganesh Bhure8d0c9942019-05-24 11:42:09 +053048}
49
50// KPI Events format
Matteo Scandoloa8bd93e2018-09-13 13:36:50 -070051type Metrics struct {
52 TxBytes float64 `json:"tx_bytes"`
53 TxPackets float64 `json:"tx_packets"`
54 TxErrorPackets float64 `json:"tx_error_packets"`
55 TxBcastPackets float64 `json:"tx_bcast_packets"`
56 TxUnicastPackets float64 `json:"tx_ucast_packets"`
57 TxMulticastPackets float64 `json:"tx_mcast_packets"`
58 RxBytes float64 `json:"rx_bytes"`
59 RxPackets float64 `json:"rx_packets"`
60 RxErrorPackets float64 `json:"rx_error_packets"`
61 RxBcastPackets float64 `json:"rx_bcast_packets"`
62 RxMulticastPackets float64 `json:"rx_mcast_packets"`
Scott Bakere8537af2018-10-22 14:53:44 -070063
Daniele Morobe242582019-10-01 14:02:46 -070064 LaserBiasCurrent float64 `json:"laser_bias_current"`
65 Temperature float64 `json:"temperature"`
66 PowerFeedVoltage float64 `json:"power_feed_voltage"`
Ganesh Bhure967018e2019-07-29 14:48:32 +053067 MeanOpticalLaunchPower float64 `json:"mean_optical_launch_power"`
68 ReceivedOpticalPower float64 `json:"received_optical_power"`
69
Scott Bakere8537af2018-10-22 14:53:44 -070070 // ONU Ethernet_Bridge_Port_history
Daniele Morobe242582019-10-01 14:02:46 -070071 Packets float64 `json:"packets"`
72 Octets float64 `json:"octets"`
Matteo Scandoloa8bd93e2018-09-13 13:36:50 -070073}
74
75type Context struct {
76 InterfaceID string `json:"intf_id"`
77 PonID string `json:"pon_id"`
78 PortNumber string `json:"port_no"`
Scott Bakere8537af2018-10-22 14:53:44 -070079
80 // ONU Performance Metrics
Daniele Morobe242582019-10-01 14:02:46 -070081 ParentClassId string `json:"parent_class_id"`
Scott Bakere8537af2018-10-22 14:53:44 -070082 ParentEntityId string `json:"parent_entity_id"`
Daniele Morobe242582019-10-01 14:02:46 -070083 Upstream string `json:"upstream"`
Matteo Scandoloa8bd93e2018-09-13 13:36:50 -070084}
85
86type Metadata struct {
87 LogicalDeviceID string `json:"logical_device_id"`
88 Title string `json:"title"`
89 SerialNumber string `json:"serial_no"`
90 Timestamp float64 `json:"ts"`
91 DeviceID string `json:"device_id"`
92 Context *Context `json:"context"`
93}
94
95type SliceData struct {
96 Metrics *Metrics `json:"metrics"`
97 Metadata *Metadata `json:"metadata"`
98}
99
Matteo Scandoloaab36db2018-10-09 19:54:11 -0700100type VolthaKPI struct {
Matteo Scandoloa8bd93e2018-09-13 13:36:50 -0700101 Type string `json:"type"`
102 Timestamp float64 `json:"ts"`
103 SliceDatas []*SliceData `json:"slice_data"`
104}
Matteo Scandoloaab36db2018-10-09 19:54:11 -0700105
106type OnosPort struct {
107 PortID string `json:"portId"`
108 RxPackets float64 `json:"pktRx"`
109 TxPackets float64 `json:"pktTx"`
110 RxBytes float64 `json:"bytesRx"`
111 TxBytes float64 `json:"bytesTx"`
112 RxPacketsDrop float64 `json:"pktRxDrp"`
113 TxPacketsDrop float64 `json:"pktTxDrp"`
114}
115
116type OnosKPI struct {
117 DeviceID string `json:"deviceId"`
118 Ports []*OnosPort `json:"ports"`
119}
Ganesh Bhure8d0c9942019-05-24 11:42:09 +0530120
121type ImporterKPI struct {
Ganesh Bhure7f9eccb2019-11-27 16:24:24 +0530122 PortId string
Daniele Moro707c2092019-12-06 16:39:18 -0800123 LaserBiasCurrent float64
124 Temperature float64
125 TxPower float64
126 Voltage float64
kartikey dubey72ef3b82019-05-27 06:50:04 +0000127}
128
129type OnosAaaKPI struct {
Shubham Sharma57600bf2019-08-09 07:09:57 +0000130 RxAcceptResponses float64 `json:"acceptResponsesRx"`
131 RxRejectResponses float64 `json:"rejectResponsesRx"`
132 RxChallengeResponses float64 `json:"challengeResponsesRx"`
133 TxAccessRequests float64 `json:"accessRequestsTx"`
134 RxInvalidValidators float64 `json:"invalidValidatorsRx"`
135 RxUnknownType float64 `json:"unknownTypeRx"`
136 PendingRequests float64 `json:"pendingRequests"`
137 RxDroppedResponses float64 `json:"droppedResponsesRx"`
138 RxMalformedResponses float64 `json:"malformedResponsesRx"`
139 RxUnknownserver float64 `json:"unknownServerRx"`
140 RequestRttMillis float64 `json:"requestRttMillis"`
141 RequestReTx float64 `json:"requestReTx"`
142 RxEapolLogoff float64 `json:"eapolLogoffRx"`
143 TxEapolResIdentityMsg float64 `json:"eapolResIdentityMsgTrans"`
144 TxAuthSuccess float64 `json:"eapolAuthSuccessTrans"`
145 TxAuthFailure float64 `json:"eapolAuthFailureTrans"`
146 TxStartReq float64 `json:"eapolStartReqTrans"`
147 EapPktTxAuthChooseEap float64 `json:"eapPktTxauthChooseEap"`
148 TxResponseNotNak float64 `json:"eapolTransRespNotNak"`
Daniele Moro707c2092019-12-06 16:39:18 -0800149 EapolFramesTx float64 `json:"eapolFramesTx"`
150 AuthStateIdle float64 `json:"authStateIdle"`
151 RequestIdFramesTx float64 `json:"requestIdFramesTx"`
152 RequestEapFramesTx float64 `json:"requestEapFramesTx"`
153 InvalidPktType float64 `json:"invalidPktType"`
154 InvalidBodyLength float64 `json:"invalidBodyLength"`
155 ValidEapolFramesRx float64 `json:"validEapolFramesRx"`
156 PendingResSupplicant float64 `json:"pendingResSupplicant"`
157 RxResIdEapFrames float64 `json:"resIdEapFramesRx"`
kartikey dubey72ef3b82019-05-27 06:50:04 +0000158}
Daniele Morobe242582019-10-01 14:02:46 -0700159
Daniele Moro707c2092019-12-06 16:39:18 -0800160type OnosBngKPI struct {
Ganesh Bhure7f9eccb2019-11-27 16:24:24 +0530161 Mac string `json:"macAddress"`
162 Ip string `json:"ipAddress"`
163 PppoeSessionId int `json:"pppoeSessionId"`
164 AttachmentType string `json:"attachmentType"`
165 STag int `json:"sTag"`
166 CTag int `json:"cTag"`
167 OnuSerialNumber string `json:"onuSerialNumber"`
Daniele Moro707c2092019-12-06 16:39:18 -0800168 DeviceId string `json:"deviceId"`
169 PortNumber string `json:"portNumber"`
170 UpTxBytes *float64 `json:"upTxBytes,omitempty"`
171 UpTxPackets *float64 `json:"upTxPackets,omitempty"`
172 UpRxBytes *float64 `json:"upRxBytes,omitempty"`
173 UpRxPackets *float64 `json:"upRxPackets,omitempty"`
174 UpDropBytes *float64 `json:"upDropBytes,omitempty"`
175 UpDropPackets *float64 `json:"upDropPackets,omitempty"`
176 DownRxBytes *float64 `json:"downRxBytes,omitempty"`
177 DownRxPackets *float64 `json:"downRxPackets,omitempty"`
178 DownTxBytes *float64 `json:"downTxBytes,omitempty"`
179 DownTxPackets *float64 `json:"downTxPackets,omitempty"`
180 DownDropBytes *float64 `json:"downDropBytes,omitempty"`
181 DownDropPackets *float64 `json:"downDropPackets,omitempty"`
182 ControlPackets *float64 `json:"controlPackets,omitempty"`
Ganesh Bhure7f9eccb2019-11-27 16:24:24 +0530183 Timestamp string `json:"timestamp"`
Daniele Morobe242582019-10-01 14:02:46 -0700184}