BUG 6487: Extra routes to IVpnLink endpoint not in FIB
[netvirt.git] / vpnservice / vpnmanager / vpnmanager-api / src / main / yang / inter-vpn-link.yang
1 module inter-vpn-link {
2
3   namespace "urn:opendaylight:params:xml:ns:yang:netvirt:inter-vpn-link";
4   prefix "inter-vpn-link";
5
6   import ietf-inet-types { prefix inet; revision-date "2013-07-15"; }
7
8   import ietf-yang-types { prefix yang; revision-date "2013-07-15"; }
9
10   import config { prefix config; revision-date 2013-04-05; }
11
12   description
13     "Service definition for inter-vpn-link project";
14
15   revision "2016-03-11" {
16       description
17         "Initial revision";
18     }
19
20   grouping vpn-endpoint-attribs {
21       leaf vpn-uuid {
22           mandatory "true";
23           type yang:uuid;
24           description "UUID of the VPN to which this endpoint belongs to";
25       }
26
27       leaf ip-address {
28           mandatory "true";
29           type inet:ipv4-address;
30           description "IP address of the endpoint";
31        }
32   }
33
34
35   grouping vpn-endpoint-state-attribs {
36       leaf vpn-uuid {
37           type yang:uuid;
38           description "UUID of the VPN to which this endpoint belongs to";
39       }
40
41       leaf-list dp-id {
42           type uint64;
43
44           description "list of DPNs where this endpoint of the Link has been instantiated";
45       }
46
47       leaf lport-tag {
48           type uint32;
49
50       }
51   }
52
53   container inter-vpn-links {
54       list inter-vpn-link {
55           key "name";
56           max-elements "unbounded";
57           min-elements "0";
58
59           leaf name {
60               mandatory "true";
61               type string;
62               description "Inter VPN link name";
63           }
64
65
66           container first-endpoint {
67               uses vpn-endpoint-attribs;
68           }
69
70          container second-endpoint {
71               uses vpn-endpoint-attribs;
72           }
73
74           leaf bgp-routes-leaking {
75               mandatory "true";
76               type boolean;
77               description "Flag to enable the leaking of BGP routes learnt from one VPN to another VPN";
78           }
79
80           must "first-endpoint and second-endpoint";  // To ensure both endpoints are present
81       }
82   }
83
84   container inter-vpn-link-states {
85       list inter-vpn-link-state {
86           key "inter-vpn-link-name";
87
88           leaf inter-vpn-link-name {
89               type string;
90           }
91
92           leaf state {
93               type enumeration {
94                   enum active;
95                   enum error;
96               }
97               description "Holds the current state of the InterVPN Link";
98           }
99
100           container first-endpoint-state {
101               uses vpn-endpoint-state-attribs;
102           }
103
104           container second-endpoint-state {
105               uses vpn-endpoint-state-attribs;
106           }
107
108           leaf error-description {
109               type string;
110           }
111        }
112    }
113
114   notification inter-vpn-link-creation-error {
115       container inter-vpn-link-creation-error-message {
116           leaf error-message {
117               type "string";
118           }
119       }
120   }
121
122 }