Vpnmanager module sync up
[netvirt.git] / vpnservice / vpnmanager / vpnmanager-api / src / main / yang / vpn-rpc.yang
1 module vpn-rpc {
2     namespace "urn:opendaylight:netvirt:vpn:rpc";
3     prefix "vpn-rpc";
4
5     revision "2016-02-01" {
6         description "VPN Service RPC Module";
7     }
8
9     /* RPCs */
10     rpc add-static-route {
11         description "Creates a static route in a VPN, creating a new label if needed";
12         input {
13             leaf vpnInstanceName {
14                 mandatory true;
15                 type string;
16             }
17             leaf destination {
18                 mandatory true;
19                 type string;
20             }
21             leaf nexthop {
22                 description "Ip-address of the nexthop. The RPC will check if this nexthop is the endpoint
23                              of a VPN in an InterVpnLink";
24                 mandatory true;
25                 type string;
26             }
27             leaf label {
28                 description "Label for the static route. It can be left empty, in that case a new
29                             label will be autogenerated";
30                 type uint32;
31             }
32         }
33         output {
34             leaf label {
35                 description "The auto-generated label, if applies";
36                 type uint32;
37             }
38         }
39     }
40
41     rpc remove-static-route {
42         description "Removes a static route in a VPN, identified by this vpn name, destination and nexthop.
43                      Nextop is optional. If specified, the RPC will just remove one of the nexthops in the
44                      route (ECMP feature). If not specified, the whole route will be removed";
45         input {
46             leaf vpnInstanceName {
47                 mandatory true;
48                 type string;
49             }
50             leaf destination {
51                 mandatory true;
52                 type string;
53             }
54             leaf nexthop {
55                 description "Ip-address of the nexthop. If specified, just one nexthop will be removed. Removing
56                              the last nexthop in a route, will provoke the removal of the whole route";
57                 type string;
58             }
59         }
60     }
61
62     rpc add-static-route {
63         description "Creates a static route in a VPN, creating a new label if needed";
64         input {
65             leaf vpnInstanceName {
66                 mandatory true;
67                 type string;
68             }
69             leaf destination {
70                 mandatory true;
71                 type string;
72             }
73             leaf nexthop {
74                 description "Ip-address of the nexthop. The RPC will check if this nexthop is the endpoint
75                              of a VPN in an InterVpnLink";
76                 mandatory true;
77                 type string;
78             }
79             leaf label {
80                 description "Label for the static route. It can be left empty, in that case a new
81                             label will be autogenerated";
82                 type uint32;
83             }
84         }
85         output {
86             leaf label {
87                 description "The auto-generated label, if applies";
88                 type uint32;
89             }
90         }
91     }
92
93     rpc remove-static-route {
94         description "Removes a static route in a VPN, identified by this vpn name, destination and nexthop.
95                      Nextop is optional. If specified, the RPC will just remove one of the nexthops in the
96                      route (ECMP feature). If not specified, the whole route will be removed";
97         input {
98             leaf vpnInstanceName {
99                 mandatory true;
100                 type string;
101             }
102             leaf destination {
103                 mandatory true;
104                 type string;
105             }
106             leaf nexthop {
107                 description "Ip-address of the nexthop. If specified, just one nexthop will be removed. Removing
108                              the last nexthop in a route, will provoke the removal of the whole route";
109                 type string;
110             }
111         }
112     }
113
114     rpc generate-vpn-label {
115         description "to generate label for the given ip prefix from the associated VPN";
116         input {
117             leaf vpn-name {
118                 type string;
119             }
120             leaf ip-prefix {
121                 type string;
122             }
123         }
124         output {
125             leaf label {
126                 type uint32;
127             }
128         }
129     }
130
131     rpc remove-vpn-label {
132         description "to remove label for the given ip prefix from the associated VPN";
133         input {
134             leaf vpn-name {
135                 type string;
136             }
137             leaf ip-prefix {
138                 type string;
139             }
140         }
141     }
142 }