Matteo Scandolo | a8bd93e | 2018-09-13 13:36:50 -0700 | [diff] [blame] | 1 | // 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 | |
| 15 | package main |
| 16 | |
Ganesh Bhure | 8d0c994 | 2019-05-24 11:42:09 +0530 | [diff] [blame] | 17 | // configuration |
| 18 | type BrokerInfo struct { |
Daniele Moro | be24258 | 2019-10-01 14:02:46 -0700 | [diff] [blame] | 19 | Name string `yaml: name` |
| 20 | Host string `yaml: host` |
| 21 | Description string `yaml: description` |
| 22 | Topics []string `yaml: topics` |
Ganesh Bhure | 8d0c994 | 2019-05-24 11:42:09 +0530 | [diff] [blame] | 23 | } |
Matteo Scandolo | a8bd93e | 2018-09-13 13:36:50 -0700 | [diff] [blame] | 24 | |
Ganesh Bhure | 8d0c994 | 2019-05-24 11:42:09 +0530 | [diff] [blame] | 25 | type LoggerInfo struct { |
Daniele Moro | be24258 | 2019-10-01 14:02:46 -0700 | [diff] [blame] | 26 | LogLevel string `yaml: loglevel` |
| 27 | Host string `yaml: host` |
Ganesh Bhure | 8d0c994 | 2019-05-24 11:42:09 +0530 | [diff] [blame] | 28 | } |
| 29 | |
| 30 | type TargetInfo struct { |
Daniele Moro | be24258 | 2019-10-01 14:02:46 -0700 | [diff] [blame] | 31 | Type string `yaml: type` |
| 32 | Name string `yaml: name` |
| 33 | Port int `yaml: port` |
| 34 | Description string `yaml: description` |
Ganesh Bhure | 8d0c994 | 2019-05-24 11:42:09 +0530 | [diff] [blame] | 35 | } |
| 36 | |
kesavand | 0c06492 | 2020-12-15 15:36:25 +0530 | [diff] [blame] | 37 | type ConvInfo struct { |
| 38 | Onusnhex bool `yaml: onusnhex` |
| 39 | } |
| 40 | |
Ganesh Bhure | 8d0c994 | 2019-05-24 11:42:09 +0530 | [diff] [blame] | 41 | type Config struct { |
Daniele Moro | be24258 | 2019-10-01 14:02:46 -0700 | [diff] [blame] | 42 | Broker BrokerInfo `yaml: broker` |
| 43 | Logger LoggerInfo `yaml: logger` |
| 44 | Target TargetInfo `yaml: "target"` |
kesavand | 0c06492 | 2020-12-15 15:36:25 +0530 | [diff] [blame] | 45 | Conv ConvInfo `yaml: "conv"` |
Ganesh Bhure | 8d0c994 | 2019-05-24 11:42:09 +0530 | [diff] [blame] | 46 | } |
| 47 | |
| 48 | // KPI Events format |
Matteo Scandolo | a8bd93e | 2018-09-13 13:36:50 -0700 | [diff] [blame] | 49 | type Metrics struct { |
| 50 | TxBytes float64 `json:"tx_bytes"` |
| 51 | TxPackets float64 `json:"tx_packets"` |
| 52 | TxErrorPackets float64 `json:"tx_error_packets"` |
| 53 | TxBcastPackets float64 `json:"tx_bcast_packets"` |
| 54 | TxUnicastPackets float64 `json:"tx_ucast_packets"` |
| 55 | TxMulticastPackets float64 `json:"tx_mcast_packets"` |
| 56 | RxBytes float64 `json:"rx_bytes"` |
| 57 | RxPackets float64 `json:"rx_packets"` |
| 58 | RxErrorPackets float64 `json:"rx_error_packets"` |
| 59 | RxBcastPackets float64 `json:"rx_bcast_packets"` |
| 60 | RxMulticastPackets float64 `json:"rx_mcast_packets"` |
Scott Baker | e8537af | 2018-10-22 14:53:44 -0700 | [diff] [blame] | 61 | |
Daniele Moro | be24258 | 2019-10-01 14:02:46 -0700 | [diff] [blame] | 62 | LaserBiasCurrent float64 `json:"laser_bias_current"` |
| 63 | Temperature float64 `json:"temperature"` |
| 64 | PowerFeedVoltage float64 `json:"power_feed_voltage"` |
Ganesh Bhure | 967018e | 2019-07-29 14:48:32 +0530 | [diff] [blame] | 65 | MeanOpticalLaunchPower float64 `json:"mean_optical_launch_power"` |
| 66 | ReceivedOpticalPower float64 `json:"received_optical_power"` |
| 67 | |
Scott Baker | e8537af | 2018-10-22 14:53:44 -0700 | [diff] [blame] | 68 | // ONU Ethernet_Bridge_Port_history |
Daniele Moro | be24258 | 2019-10-01 14:02:46 -0700 | [diff] [blame] | 69 | Packets float64 `json:"packets"` |
| 70 | Octets float64 `json:"octets"` |
Matteo Scandolo | a8bd93e | 2018-09-13 13:36:50 -0700 | [diff] [blame] | 71 | } |
| 72 | |
| 73 | type Context struct { |
| 74 | InterfaceID string `json:"intf_id"` |
| 75 | PonID string `json:"pon_id"` |
| 76 | PortNumber string `json:"port_no"` |
Scott Baker | e8537af | 2018-10-22 14:53:44 -0700 | [diff] [blame] | 77 | |
| 78 | // ONU Performance Metrics |
Daniele Moro | be24258 | 2019-10-01 14:02:46 -0700 | [diff] [blame] | 79 | ParentClassId string `json:"parent_class_id"` |
Scott Baker | e8537af | 2018-10-22 14:53:44 -0700 | [diff] [blame] | 80 | ParentEntityId string `json:"parent_entity_id"` |
Daniele Moro | be24258 | 2019-10-01 14:02:46 -0700 | [diff] [blame] | 81 | Upstream string `json:"upstream"` |
Matteo Scandolo | a8bd93e | 2018-09-13 13:36:50 -0700 | [diff] [blame] | 82 | } |
| 83 | |
| 84 | type Metadata struct { |
| 85 | LogicalDeviceID string `json:"logical_device_id"` |
| 86 | Title string `json:"title"` |
| 87 | SerialNumber string `json:"serial_no"` |
| 88 | Timestamp float64 `json:"ts"` |
| 89 | DeviceID string `json:"device_id"` |
| 90 | Context *Context `json:"context"` |
| 91 | } |
| 92 | |
| 93 | type SliceData struct { |
| 94 | Metrics *Metrics `json:"metrics"` |
| 95 | Metadata *Metadata `json:"metadata"` |
| 96 | } |
| 97 | |
Matteo Scandolo | aab36db | 2018-10-09 19:54:11 -0700 | [diff] [blame] | 98 | type VolthaKPI struct { |
Matteo Scandolo | a8bd93e | 2018-09-13 13:36:50 -0700 | [diff] [blame] | 99 | Type string `json:"type"` |
| 100 | Timestamp float64 `json:"ts"` |
| 101 | SliceDatas []*SliceData `json:"slice_data"` |
| 102 | } |
Matteo Scandolo | aab36db | 2018-10-09 19:54:11 -0700 | [diff] [blame] | 103 | |
| 104 | type OnosPort struct { |
| 105 | PortID string `json:"portId"` |
| 106 | RxPackets float64 `json:"pktRx"` |
| 107 | TxPackets float64 `json:"pktTx"` |
| 108 | RxBytes float64 `json:"bytesRx"` |
| 109 | TxBytes float64 `json:"bytesTx"` |
| 110 | RxPacketsDrop float64 `json:"pktRxDrp"` |
| 111 | TxPacketsDrop float64 `json:"pktTxDrp"` |
| 112 | } |
| 113 | |
| 114 | type OnosKPI struct { |
| 115 | DeviceID string `json:"deviceId"` |
| 116 | Ports []*OnosPort `json:"ports"` |
| 117 | } |
Ganesh Bhure | 8d0c994 | 2019-05-24 11:42:09 +0530 | [diff] [blame] | 118 | |
| 119 | type ImporterKPI struct { |
Ganesh Bhure | 7f9eccb | 2019-11-27 16:24:24 +0530 | [diff] [blame] | 120 | PortId string |
Daniele Moro | 707c209 | 2019-12-06 16:39:18 -0800 | [diff] [blame] | 121 | LaserBiasCurrent float64 |
| 122 | Temperature float64 |
| 123 | TxPower float64 |
| 124 | Voltage float64 |
kartikey dubey | 72ef3b8 | 2019-05-27 06:50:04 +0000 | [diff] [blame] | 125 | } |
| 126 | |
| 127 | type OnosAaaKPI struct { |
Shubham Sharma | 57600bf | 2019-08-09 07:09:57 +0000 | [diff] [blame] | 128 | RxAcceptResponses float64 `json:"acceptResponsesRx"` |
| 129 | RxRejectResponses float64 `json:"rejectResponsesRx"` |
| 130 | RxChallengeResponses float64 `json:"challengeResponsesRx"` |
| 131 | TxAccessRequests float64 `json:"accessRequestsTx"` |
| 132 | RxInvalidValidators float64 `json:"invalidValidatorsRx"` |
| 133 | RxUnknownType float64 `json:"unknownTypeRx"` |
| 134 | PendingRequests float64 `json:"pendingRequests"` |
| 135 | RxDroppedResponses float64 `json:"droppedResponsesRx"` |
| 136 | RxMalformedResponses float64 `json:"malformedResponsesRx"` |
| 137 | RxUnknownserver float64 `json:"unknownServerRx"` |
| 138 | RequestRttMillis float64 `json:"requestRttMillis"` |
| 139 | RequestReTx float64 `json:"requestReTx"` |
| 140 | RxEapolLogoff float64 `json:"eapolLogoffRx"` |
| 141 | TxEapolResIdentityMsg float64 `json:"eapolResIdentityMsgTrans"` |
| 142 | TxAuthSuccess float64 `json:"eapolAuthSuccessTrans"` |
| 143 | TxAuthFailure float64 `json:"eapolAuthFailureTrans"` |
| 144 | TxStartReq float64 `json:"eapolStartReqTrans"` |
| 145 | EapPktTxAuthChooseEap float64 `json:"eapPktTxauthChooseEap"` |
| 146 | TxResponseNotNak float64 `json:"eapolTransRespNotNak"` |
Daniele Moro | 707c209 | 2019-12-06 16:39:18 -0800 | [diff] [blame] | 147 | EapolFramesTx float64 `json:"eapolFramesTx"` |
| 148 | AuthStateIdle float64 `json:"authStateIdle"` |
| 149 | RequestIdFramesTx float64 `json:"requestIdFramesTx"` |
| 150 | RequestEapFramesTx float64 `json:"requestEapFramesTx"` |
| 151 | InvalidPktType float64 `json:"invalidPktType"` |
| 152 | InvalidBodyLength float64 `json:"invalidBodyLength"` |
| 153 | ValidEapolFramesRx float64 `json:"validEapolFramesRx"` |
| 154 | PendingResSupplicant float64 `json:"pendingResSupplicant"` |
| 155 | RxResIdEapFrames float64 `json:"resIdEapFramesRx"` |
kartikey dubey | 72ef3b8 | 2019-05-27 06:50:04 +0000 | [diff] [blame] | 156 | } |
Daniele Moro | be24258 | 2019-10-01 14:02:46 -0700 | [diff] [blame] | 157 | |
Daniele Moro | 707c209 | 2019-12-06 16:39:18 -0800 | [diff] [blame] | 158 | type OnosBngKPI struct { |
Ganesh Bhure | 7f9eccb | 2019-11-27 16:24:24 +0530 | [diff] [blame] | 159 | Mac string `json:"macAddress"` |
| 160 | Ip string `json:"ipAddress"` |
| 161 | PppoeSessionId int `json:"pppoeSessionId"` |
| 162 | AttachmentType string `json:"attachmentType"` |
| 163 | STag int `json:"sTag"` |
| 164 | CTag int `json:"cTag"` |
| 165 | OnuSerialNumber string `json:"onuSerialNumber"` |
Daniele Moro | 707c209 | 2019-12-06 16:39:18 -0800 | [diff] [blame] | 166 | DeviceId string `json:"deviceId"` |
| 167 | PortNumber string `json:"portNumber"` |
| 168 | UpTxBytes *float64 `json:"upTxBytes,omitempty"` |
| 169 | UpTxPackets *float64 `json:"upTxPackets,omitempty"` |
| 170 | UpRxBytes *float64 `json:"upRxBytes,omitempty"` |
| 171 | UpRxPackets *float64 `json:"upRxPackets,omitempty"` |
| 172 | UpDropBytes *float64 `json:"upDropBytes,omitempty"` |
| 173 | UpDropPackets *float64 `json:"upDropPackets,omitempty"` |
| 174 | DownRxBytes *float64 `json:"downRxBytes,omitempty"` |
| 175 | DownRxPackets *float64 `json:"downRxPackets,omitempty"` |
| 176 | DownTxBytes *float64 `json:"downTxBytes,omitempty"` |
| 177 | DownTxPackets *float64 `json:"downTxPackets,omitempty"` |
| 178 | DownDropBytes *float64 `json:"downDropBytes,omitempty"` |
| 179 | DownDropPackets *float64 `json:"downDropPackets,omitempty"` |
| 180 | ControlPackets *float64 `json:"controlPackets,omitempty"` |
Ganesh Bhure | 7f9eccb | 2019-11-27 16:24:24 +0530 | [diff] [blame] | 181 | Timestamp string `json:"timestamp"` |
Daniele Moro | be24258 | 2019-10-01 14:02:46 -0700 | [diff] [blame] | 182 | } |