Yang changes for l3vpn
[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-instances/l3vpn:vpn-instance" {
34         leaf vpn-id { type uint32;}
35         uses vpn-route-list;
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     /* Data models to adhere to restart requirements */
58     container vpn-instance-to-vpn-id {
59        list vpn-instance {
60           key vpn-instance-name;
61           leaf vpn-instance-name {
62              type string;
63           }
64           leaf vpn-id {
65              type uint32;
66           }
67           leaf vrf-id {
68               description
69                  "The vrf-id command configures a route distinguisher (RD)
70                   for the IPv4 or IPv6 address family of a VPN instance or
71                   vpn instance name for internal vpn case.";
72               type string;
73           }
74        }
75     }
76
77     container vpn-instance-op-data {
78         config false;
79         list vpn-instance-op-data-entry {
80            key vrf-id;
81            leaf vpn-id { type uint32;}
82            leaf vrf-id {
83               description
84                  "The vrf-id command configures a route distinguisher (RD)
85                   for the IPv4 or IPv6 address family of a VPN instance or
86                   vpn instance name for internal vpn case.";
87               type string;
88            }
89
90            uses vpn-route-list;
91            list vpn-to-dpn-list {
92                key dpnId;
93                leaf dpnId {
94                   type uint64;
95                }
96                list vpn-interfaces {
97                   key interface-name;
98                   leaf interface-name {
99                       type string;
100                   }
101                }
102            }
103         }
104     }
105
106 }