BUG:5186 Fix for change in extraroutes type
[vpnservice.git] / vpnmanager / vpnmanager-api / src / main / yang / odl-l3vpn.yang
1 module odl-l3vpn {
2     namespace "urn:opendaylight:l3vpn";
3     prefix odl-l3vpn;
4
5     import yang-ext {prefix ext; revision-date "2013-07-09";}
6     import l3vpn { prefix l3vpn; revision-date "2014-08-15"; }
7
8     revision "2013-09-11" {
9         description "L3 VPN Service module";
10     }
11
12     grouping adjacency-list{
13         list adjacency{
14             key "ip_address";
15             leaf nextHopIp { type string; }
16             leaf ip_address {type string;}
17             leaf label { type uint32; config "false"; } /* optional */
18             leaf mac_address {type string;} /* optional */
19         }
20     }
21
22     grouping vpn-route-list{
23         leaf-list route-entry-id{
24             type uint32;
25         }
26     }
27
28     augment "/l3vpn:vpn-interfaces/l3vpn:vpn-interface" {
29         ext:augment-identifier "adjacencies";
30         uses adjacency-list;
31     }
32
33     /* Operational DS containers for reverse lookups*/
34     container prefix-to-interface {
35         config false;
36         list vpn-ids {
37            key vpn-id;
38            leaf vpn-id {type uint32;}
39            list prefixes {
40               key ip_address;
41               leaf ip_address {type string;}
42               leaf dpnId {
43                  type uint64;
44               }
45               leaf vpn-interface-name {
46                   type string;
47               }
48            }
49         }
50     }
51
52     container vpn-to-extraroute {
53         config false;
54         list vpn {
55            key vrf-id;
56            leaf vrf-id {
57               description
58                  "The vrf-id command configures a route distinguisher (RD)
59                   for the IPv4 or IPv6 address family of a VPN instance or
60                   vpn instance name for internal vpn case.";
61               type string;
62            }
63            list extraroute {
64               key prefix;
65               leaf prefix {type string;}
66                       leaf nexthop-ip {
67                           type string;
68                       }
69            }
70         }
71     }
72
73     /* Data models to adhere to restart requirements */
74     container vpn-instance-to-vpn-id {
75        list vpn-instance {
76           key vpn-instance-name;
77           leaf vpn-instance-name {
78              type string;
79           }
80           leaf vpn-id {
81              type uint32;
82           }
83           leaf vrf-id {
84               description
85                  "The vrf-id command configures a route distinguisher (RD)
86                   for the IPv4 or IPv6 address family of a VPN instance or
87                   vpn instance name for internal vpn case.";
88               type string;
89           }
90        }
91     }
92
93     container vpn-instance-op-data {
94         config false;
95         list vpn-instance-op-data-entry {
96            key vrf-id;
97            leaf vpn-id { type uint32;}
98            leaf vrf-id {
99               description
100                  "The vrf-id command configures a route distinguisher (RD)
101                   for the IPv4 or IPv6 address family of a VPN instance or
102                   vpn instance name for internal vpn case.";
103               type string;
104            }
105
106            leaf vpn-interface-count { type uint32; }
107            uses vpn-route-list;
108            list vpn-to-dpn-list {
109                key dpnId;
110                leaf dpnId {
111                   type uint64;
112                }
113                list vpn-interfaces {
114                   key interface-name;
115                   leaf interface-name {
116                       type string;
117                   }
118                }
119            }
120         }
121     }
122
123 }