blob: ab4360bb46f7414cd784a6e0a229defbba90dd12 [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`
22 Topics []string `yaml: topics`
Ganesh Bhure8d0c9942019-05-24 11:42:09 +053023}
Matteo Scandoloa8bd93e2018-09-13 13:36:50 -070024
Ganesh Bhure8d0c9942019-05-24 11:42:09 +053025type LoggerInfo struct {
Daniele Morobe242582019-10-01 14:02:46 -070026 LogLevel string `yaml: loglevel`
27 Host string `yaml: host`
Ganesh Bhure8d0c9942019-05-24 11:42:09 +053028}
29
30type TargetInfo struct {
Daniele Morobe242582019-10-01 14:02:46 -070031 Type string `yaml: type`
32 Name string `yaml: name`
33 Port int `yaml: port`
34 Description string `yaml: description`
Ganesh Bhure8d0c9942019-05-24 11:42:09 +053035}
36
37type Config struct {
Daniele Morobe242582019-10-01 14:02:46 -070038 Broker BrokerInfo `yaml: broker`
39 Logger LoggerInfo `yaml: logger`
40 Target TargetInfo `yaml: "target"`
Ganesh Bhure8d0c9942019-05-24 11:42:09 +053041}
42
43// KPI Events format
Matteo Scandoloa8bd93e2018-09-13 13:36:50 -070044type Metrics struct {
45 TxBytes float64 `json:"tx_bytes"`
46 TxPackets float64 `json:"tx_packets"`
47 TxErrorPackets float64 `json:"tx_error_packets"`
48 TxBcastPackets float64 `json:"tx_bcast_packets"`
49 TxUnicastPackets float64 `json:"tx_ucast_packets"`
50 TxMulticastPackets float64 `json:"tx_mcast_packets"`
51 RxBytes float64 `json:"rx_bytes"`
52 RxPackets float64 `json:"rx_packets"`
53 RxErrorPackets float64 `json:"rx_error_packets"`
54 RxBcastPackets float64 `json:"rx_bcast_packets"`
55 RxMulticastPackets float64 `json:"rx_mcast_packets"`
Scott Bakere8537af2018-10-22 14:53:44 -070056
Daniele Morobe242582019-10-01 14:02:46 -070057 LaserBiasCurrent float64 `json:"laser_bias_current"`
58 Temperature float64 `json:"temperature"`
59 PowerFeedVoltage float64 `json:"power_feed_voltage"`
Ganesh Bhure967018e2019-07-29 14:48:32 +053060 MeanOpticalLaunchPower float64 `json:"mean_optical_launch_power"`
61 ReceivedOpticalPower float64 `json:"received_optical_power"`
62
Scott Bakere8537af2018-10-22 14:53:44 -070063 // ONU Ethernet_Bridge_Port_history
Daniele Morobe242582019-10-01 14:02:46 -070064 Packets float64 `json:"packets"`
65 Octets float64 `json:"octets"`
Matteo Scandoloa8bd93e2018-09-13 13:36:50 -070066}
67
68type Context struct {
69 InterfaceID string `json:"intf_id"`
70 PonID string `json:"pon_id"`
71 PortNumber string `json:"port_no"`
Scott Bakere8537af2018-10-22 14:53:44 -070072
73 // ONU Performance Metrics
Daniele Morobe242582019-10-01 14:02:46 -070074 ParentClassId string `json:"parent_class_id"`
Scott Bakere8537af2018-10-22 14:53:44 -070075 ParentEntityId string `json:"parent_entity_id"`
Daniele Morobe242582019-10-01 14:02:46 -070076 Upstream string `json:"upstream"`
Matteo Scandoloa8bd93e2018-09-13 13:36:50 -070077}
78
79type Metadata struct {
80 LogicalDeviceID string `json:"logical_device_id"`
81 Title string `json:"title"`
82 SerialNumber string `json:"serial_no"`
83 Timestamp float64 `json:"ts"`
84 DeviceID string `json:"device_id"`
85 Context *Context `json:"context"`
86}
87
88type SliceData struct {
89 Metrics *Metrics `json:"metrics"`
90 Metadata *Metadata `json:"metadata"`
91}
92
Matteo Scandoloaab36db2018-10-09 19:54:11 -070093type VolthaKPI struct {
Matteo Scandoloa8bd93e2018-09-13 13:36:50 -070094 Type string `json:"type"`
95 Timestamp float64 `json:"ts"`
96 SliceDatas []*SliceData `json:"slice_data"`
97}
Matteo Scandoloaab36db2018-10-09 19:54:11 -070098
99type OnosPort struct {
100 PortID string `json:"portId"`
101 RxPackets float64 `json:"pktRx"`
102 TxPackets float64 `json:"pktTx"`
103 RxBytes float64 `json:"bytesRx"`
104 TxBytes float64 `json:"bytesTx"`
105 RxPacketsDrop float64 `json:"pktRxDrp"`
106 TxPacketsDrop float64 `json:"pktTxDrp"`
107}
108
109type OnosKPI struct {
110 DeviceID string `json:"deviceId"`
111 Ports []*OnosPort `json:"ports"`
112}
Ganesh Bhure8d0c9942019-05-24 11:42:09 +0530113
114type ImporterKPI struct {
Ganesh Bhure7f9eccb2019-11-27 16:24:24 +0530115 PortId string
Daniele Moro707c2092019-12-06 16:39:18 -0800116 LaserBiasCurrent float64
117 Temperature float64
118 TxPower float64
119 Voltage float64
kartikey dubey72ef3b82019-05-27 06:50:04 +0000120}
121
122type OnosAaaKPI struct {
Shubham Sharma57600bf2019-08-09 07:09:57 +0000123 RxAcceptResponses float64 `json:"acceptResponsesRx"`
124 RxRejectResponses float64 `json:"rejectResponsesRx"`
125 RxChallengeResponses float64 `json:"challengeResponsesRx"`
126 TxAccessRequests float64 `json:"accessRequestsTx"`
127 RxInvalidValidators float64 `json:"invalidValidatorsRx"`
128 RxUnknownType float64 `json:"unknownTypeRx"`
129 PendingRequests float64 `json:"pendingRequests"`
130 RxDroppedResponses float64 `json:"droppedResponsesRx"`
131 RxMalformedResponses float64 `json:"malformedResponsesRx"`
132 RxUnknownserver float64 `json:"unknownServerRx"`
133 RequestRttMillis float64 `json:"requestRttMillis"`
134 RequestReTx float64 `json:"requestReTx"`
135 RxEapolLogoff float64 `json:"eapolLogoffRx"`
136 TxEapolResIdentityMsg float64 `json:"eapolResIdentityMsgTrans"`
137 TxAuthSuccess float64 `json:"eapolAuthSuccessTrans"`
138 TxAuthFailure float64 `json:"eapolAuthFailureTrans"`
139 TxStartReq float64 `json:"eapolStartReqTrans"`
140 EapPktTxAuthChooseEap float64 `json:"eapPktTxauthChooseEap"`
141 TxResponseNotNak float64 `json:"eapolTransRespNotNak"`
Daniele Moro707c2092019-12-06 16:39:18 -0800142 EapolFramesTx float64 `json:"eapolFramesTx"`
143 AuthStateIdle float64 `json:"authStateIdle"`
144 RequestIdFramesTx float64 `json:"requestIdFramesTx"`
145 RequestEapFramesTx float64 `json:"requestEapFramesTx"`
146 InvalidPktType float64 `json:"invalidPktType"`
147 InvalidBodyLength float64 `json:"invalidBodyLength"`
148 ValidEapolFramesRx float64 `json:"validEapolFramesRx"`
149 PendingResSupplicant float64 `json:"pendingResSupplicant"`
150 RxResIdEapFrames float64 `json:"resIdEapFramesRx"`
kartikey dubey72ef3b82019-05-27 06:50:04 +0000151}
Daniele Morobe242582019-10-01 14:02:46 -0700152
Daniele Moro707c2092019-12-06 16:39:18 -0800153type OnosBngKPI struct {
Ganesh Bhure7f9eccb2019-11-27 16:24:24 +0530154 Mac string `json:"macAddress"`
155 Ip string `json:"ipAddress"`
156 PppoeSessionId int `json:"pppoeSessionId"`
157 AttachmentType string `json:"attachmentType"`
158 STag int `json:"sTag"`
159 CTag int `json:"cTag"`
160 OnuSerialNumber string `json:"onuSerialNumber"`
Daniele Moro707c2092019-12-06 16:39:18 -0800161 DeviceId string `json:"deviceId"`
162 PortNumber string `json:"portNumber"`
163 UpTxBytes *float64 `json:"upTxBytes,omitempty"`
164 UpTxPackets *float64 `json:"upTxPackets,omitempty"`
165 UpRxBytes *float64 `json:"upRxBytes,omitempty"`
166 UpRxPackets *float64 `json:"upRxPackets,omitempty"`
167 UpDropBytes *float64 `json:"upDropBytes,omitempty"`
168 UpDropPackets *float64 `json:"upDropPackets,omitempty"`
169 DownRxBytes *float64 `json:"downRxBytes,omitempty"`
170 DownRxPackets *float64 `json:"downRxPackets,omitempty"`
171 DownTxBytes *float64 `json:"downTxBytes,omitempty"`
172 DownTxPackets *float64 `json:"downTxPackets,omitempty"`
173 DownDropBytes *float64 `json:"downDropBytes,omitempty"`
174 DownDropPackets *float64 `json:"downDropPackets,omitempty"`
175 ControlPackets *float64 `json:"controlPackets,omitempty"`
Ganesh Bhure7f9eccb2019-11-27 16:24:24 +0530176 Timestamp string `json:"timestamp"`
Daniele Morobe242582019-10-01 14:02:46 -0700177}