Bug 5054: Fix for switch restart
[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     augment "/l3vpn:vpn-interfaces/l3vpn:vpn-interface" {
34         ext:augment-identifier "opState";
35         leaf stateUp {type boolean; config false;}
36     }
37
38     /* Operational DS containers for reverse lookups*/
39     container prefix-to-interface {
40         config false;
41         list vpn-ids {
42            key vpn-id;
43            leaf vpn-id {type uint32;}
44            list prefixes {
45               key ip_address;
46               leaf ip_address {type string;}
47               leaf dpnId {
48                  type uint64;
49               }
50               leaf vpn-interface-name {
51                   type string;
52               }
53            }
54         }
55     }
56
57     container vpn-to-extraroute {
58         config false;
59         list vpn {
60            key vrf-id;
61            leaf vrf-id {
62               description
63                  "The vrf-id command configures a route distinguisher (RD)
64                   for the IPv4 or IPv6 address family of a VPN instance or
65                   vpn instance name for internal vpn case.";
66               type string;
67            }
68            list extraroute {
69               key prefix;
70               leaf prefix {type string;}
71                       leaf nexthop-ip {
72                           type string;
73                       }
74            }
75         }
76     }
77
78     /* Data models to adhere to restart requirements */
79     container vpn-instance-to-vpn-id {
80        list vpn-instance {
81           key vpn-instance-name;
82           leaf vpn-instance-name {
83              type string;
84           }
85           leaf vpn-id {
86              type uint32;
87           }
88           leaf vrf-id {
89               description
90                  "The vrf-id command configures a route distinguisher (RD)
91                   for the IPv4 or IPv6 address family of a VPN instance or
92                   vpn instance name for internal vpn case.";
93               type string;
94           }
95        }
96     }
97
98     container vpn-instance-op-data {
99         config false;
100         list vpn-instance-op-data-entry {
101            key vrf-id;
102            leaf vpn-id { type uint32;}
103            leaf vrf-id {
104               description
105                  "The vrf-id command configures a route distinguisher (RD)
106                   for the IPv4 or IPv6 address family of a VPN instance or
107                   vpn instance name for internal vpn case.";
108               type string;
109            }
110
111            leaf vpn-interface-count { type uint32; }
112            uses vpn-route-list;
113            list vpn-to-dpn-list {
114                key dpnId;
115                leaf dpnId {
116                   type uint64;
117                }
118                list vpn-interfaces {
119                   key interface-name;
120                   leaf interface-name {
121                       type string;
122                   }
123                }
124            }
125         }
126     }
127
128 }