BGPCEP-685: Add Peer Release session rpc
[bgpcep.git] / bgp / rib-impl / src / main / yang / bgp-stats-peer.yang
1 module bgp-stats-peer {
2     namespace "urn:opendaylight:params:xml:ns:yang:controller:bgp:stats:peer";
3     prefix "bgp-stats-peer";
4
5     import bgp-peer { prefix peer; revision-date 2016-06-06; }
6     import bgp-multiprotocol { prefix bgp-mp; revision-date 2013-09-19; }
7     import bgp-message { prefix bgp-msg; revision-date 2013-09-19; }
8     import ietf-yang-types { prefix yang; revision-date 2013-07-15; }
9
10     organization "Brocade Communications Systems, Inc.";
11     contact "Kevin Wang <kwang@brocade.com>";
12
13     description
14         "This module contains the base data model of BGP peer statistic.
15
16         Copyright (c) 2016 Brocade Communications Systems, Inc. All rights reserved.
17
18         This program and the accompanying materials are made available
19         under the terms of the Eclipse Public License v1.0 which
20         accompanies this distribution, and is available at
21         http://www.eclipse.org/legal/epl-v10.html";
22
23     revision 2016-06-06 {
24         description "Initial revision";
25     }
26
27     grouping bgp-message-state {
28         leaf count {
29             description "Total number of BGP messages.";
30             type yang:zero-based-counter32;
31         }
32
33         leaf timestamp {
34             description "The BGP message timestamp (seconds).";
35             type yang:timestamp;
36         }
37     }
38
39     grouping bgp-message-stats {
40         container received {
41             description "The received BGP messages statistics.";
42             uses bgp-message-state;
43         }
44
45         container sent {
46             description "The sent BGP messages statistics.";
47             uses bgp-message-state;
48         }
49     }
50
51     grouping bgp-peer-state {
52         container bgp-peer-state {
53             list route-table {
54                 key "afi safi";
55                 uses bgp-mp:bgp-table-type;
56
57                 leaf adj-rib-in-routes-count {
58                     description "The total number of Adj-RIB-In routes in table.";
59                     type yang:zero-based-counter32;
60                 }
61
62                 leaf adj-rib-out-routes-count {
63                     description "The total number of Adj-RIB-Out routes in table.";
64                     type yang:zero-based-counter32;
65                 }
66
67                 leaf effective-rib-in-routes-count {
68                     description "The total number of Effective-RIB-In routes in table.";
69                     type yang:zero-based-counter32;
70                 }
71             }
72
73             leaf session-established-count {
74                 description "The total number of time the BGP session was transitioned to Up state.";
75                 type yang:zero-based-counter32;
76             }
77         }
78     }
79
80     grouping bgp-session-state {
81         container bgp-session-state {
82
83             leaf session-state {
84                 description "The BGP peer connection state.";
85                 type string;
86             }
87
88             leaf session-duration {
89                 description "The session duration (time formated d:HH:mm:ss).";
90                 type string;
91             }
92
93             leaf holdtime-current {
94                 description "Time interval (in seconds) for HoldTimer established with the peer.";
95                 type uint16;
96                 default 0;
97             }
98
99             leaf keepalive-current {
100                 description "Time interval (in seconds) for KeepAlive established with the peer.";
101                 type uint16;
102                 default 0;
103             }
104
105             container remote-peer-preferences {
106                 description "The BGP remote peer preferences, to which this BGP peer is connected.";
107                 uses peer:bgp-peer-preferences;
108             }
109
110             container local-peer-preferences {
111                 description "The BGP local peer preferences.";
112                 uses peer:bgp-peer-preferences;
113             }
114
115             container messages-stats {
116                 description "The BGP messages statistics.";
117                 container total-msgs {
118                     description "The statistics for all received/sent BGP messages.";
119                     uses bgp-message-stats;
120                 }
121
122                 container keep-alive-msgs {
123                     description "The statistics for received/sent BGP Keep-Alive messages.";
124                     uses bgp-message-stats;
125                 }
126
127                 container update-msgs {
128                     description "The statistics for received/sent BGP Update messages.";
129                     uses bgp-message-stats;
130                 }
131
132                 container route-refresh-msgs {
133                     description "The statistics for received/sent BGP Route Refresh messages.";
134                     uses bgp-message-stats;
135                 }
136
137                 container error-msgs {
138                     container error-received-total {
139                         description "The total number of received BGP Error (notification) messages.";
140                         uses bgp-message-state;
141                     }
142
143                     list error-received {
144                         description "The received BGP Error (notification) messages.";
145                         key "error-code error-subcode";
146
147                         uses bgp-message-state;
148                         uses bgp-msg:notify-message;
149                     }
150
151                     container error-sent-total {
152                         description "The total number of sent BGP Error (notification) messages.";
153                         uses bgp-message-state;
154                     }
155
156                     list error-sent {
157                         description "The sent BGP Error (notification) messages.";
158                         key "error-code error-subcode";
159
160                         uses bgp-message-state;
161                         uses bgp-msg:notify-message;
162                     }
163                 }
164             }
165         }
166     }
167
168     grouping bgp-peer-stats {
169         uses bgp-peer-state;
170         uses bgp-session-state;
171     }
172 }