Remove redundant names in paths
[netvirt.git] / 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 false;
76               type boolean;
77               default false;
78               description "Flag to enable the leaking of BGP routes learnt from one VPN to another VPN";
79           }
80
81           leaf connected-routes-leaking {
82               mandatory false;
83               type boolean;
84               default false;
85               description "Flag to enable the leaking of directly connected routes learnt from one VPN to another VPN";
86           }
87
88           leaf static-routes-leaking {
89               mandatory false;
90               type boolean;
91               default false;
92               description "Flag to enable the leaking of static routes learnt from one VPN to another VPN";
93           }
94
95           must "first-endpoint and second-endpoint";  // To ensure both endpoints are present
96       }
97   }
98
99   container inter-vpn-link-states {
100       list inter-vpn-link-state {
101           key "inter-vpn-link-name";
102
103           leaf inter-vpn-link-name {
104               type string;
105           }
106
107           leaf state {
108               type enumeration {
109                   enum active;
110                   enum error;
111               }
112               description "Holds the current state of the InterVPN Link";
113           }
114
115           container first-endpoint-state {
116               uses vpn-endpoint-state-attribs;
117           }
118
119           container second-endpoint-state {
120               uses vpn-endpoint-state-attribs;
121           }
122
123           leaf error-description {
124               type string;
125           }
126        }
127    }
128
129   notification inter-vpn-link-creation-error {
130       container inter-vpn-link-creation-error-message {
131           leaf error-message {
132               type "string";
133           }
134       }
135   }
136
137 }