2e2220885b5d797950e8ef46c87e3cf927db9a5c
[bgpcep.git] / bmp / bmp-api / src / main / yang / bmp-monitor.yang
1 module bmp-monitor {
2     yang-version 1;
3     namespace "urn:opendaylight:params:xml:ns:yang:bmp-monitor";
4     prefix "bmp-mon";
5
6     import bgp-rib { prefix rib; revision-date 2013-09-25; }
7     import bgp-multiprotocol { prefix bgp-mp; revision-date 2013-09-19; }
8     import bmp-message { prefix bmp-msg; revision-date 2015-05-12; }
9     import ietf-inet-types { prefix inet; revision-date 2013-07-15; }
10     import ietf-yang-types { prefix yang; revision-date 2013-07-15; }
11
12     organization "Cisco Systems, Inc.";
13     contact "Milos Fabian <milfabia@cisco.com>";
14
15     description
16         "This module contains the base data model of a BMP monitor.
17
18         Copyright (c)2015 Cisco Systems, Inc. All rights reserved.
19
20         This program and the accompanying materials are made available
21         under the terms of the Eclipse Public License v1.0 which
22         accompanies this distribution, and is available at
23         http://www.eclipse.org/legal/epl-v10.html";
24
25     revision "2015-05-12" {
26         description
27             "Initial revision.";
28     }
29
30     typedef router-id {
31         description "Monitored router identified by IP address.";
32         type inet:ip-address;
33     }
34
35     typedef monitor-id {
36         description "The name of BMP monitoring station instance.";
37         type string;
38     }
39
40     typedef status {
41         type enumeration {
42             enum up;
43             enum down;
44         }
45     }
46
47     grouping afi-safi-route-counter {
48         list afi-safi {
49             uses bgp-mp:bgp-table-type;
50             key "afi safi";
51             leaf count {
52                 type yang:gauge64;
53             }
54         }
55     }
56
57     grouping peers {
58         list peer {
59             key "peer-id";
60             leaf peer-id {
61                 type rib:peer-id;
62             }
63             uses bmp-msg:peer;
64             leaf router-distinguisher {
65                 type string;
66             }
67             container peer-session {
68                 uses bmp-msg:peer-up;
69                 leaf status {
70                     type status;
71                 }
72                 uses bmp-msg:timestamp;
73             }
74             container stats {
75                 leaf rejected-prefixes {
76                     type yang:counter32;
77                 }
78                 leaf duplicate-prefix-advertisements {
79                     type yang:counter32;
80                 }
81                 leaf duplicate-withdraws {
82                     type yang:counter32;
83                 }
84                 leaf invalidated-cluster-list-loop {
85                     type yang:counter32;
86                 }
87                 leaf invalidated-as-path-loop {
88                     type yang:counter32;
89                 }
90                 leaf invalidated-originator-id {
91                     type yang:counter32;
92                 }
93                 leaf invalidated-as-confed-loop {
94                     type yang:counter32;
95                 }
96                 leaf adj-ribs-in-routes {
97                     type yang:gauge64;
98                 }
99                 leaf loc-rib-routes {
100                     type yang:gauge64;
101                 }
102                 container per-afi-safi-adj-rib-in-routes {
103                     uses afi-safi-route-counter;
104                 }
105                 container per-afi-safi-loc-rib-routes {
106                     uses afi-safi-route-counter;
107                 }
108                 leaf updates-treated-as-withdraw {
109                     type yang:counter32;
110                 }
111                 leaf prefixes-treated-as-withdraw {
112                     type yang:counter32;
113                 }
114                 leaf duplicate-updates {
115                     type yang:counter32;
116                 }
117                 uses bmp-msg:timestamp;
118             }
119             container pre-policy-rib {
120                 uses rib:rib;
121             }
122             container post-policy-rib {
123                 uses rib:rib;
124             }
125             container mirrors {
126                 leaf information {
127                     type bmp-msg:mirror-information-code;
128                 }
129                 uses bmp-msg:timestamp;
130             }
131         }
132     }
133
134     grouping routers {
135         list router {
136             key "router-id";
137             leaf name {
138                 type string;
139             }
140             leaf description {
141                 type string;
142             }
143             leaf info {
144                 type string;
145             }
146             leaf router-id {
147                 type router-id;
148             }
149             leaf status {
150                 type status;
151             }
152             uses peers;
153         }
154     }
155
156     container bmp-monitor {
157         list monitor {
158             config false;
159             key "monitor-id";
160             leaf monitor-id {
161                 type monitor-id;
162             }
163             uses routers;
164         }
165     }
166 }