2 namespace "urn:opendaylight:netvirt:natservice:rpc";
5 import ietf-yang-types { prefix "yang"; }
6 import ietf-inet-types {
8 revision-date "2013-07-15";
11 revision "2017-02-09" {
12 description "NAT RPC module";
15 grouping nat-router-info {
17 description "Router UUID";
21 description "Router Name";
27 list snat-ip-mapping {
29 description "Internal IP Address of VM";
33 description "Internal Port";
37 description "External Fixed IP Address used for SNAT Translation";
41 description "External Port used for SNAT Translation";
45 description "Protocol Type";
51 grouping dnat-configuration {
52 list dnat-ip-mapping {
54 description "Internal IP Address";
58 description "Floating IP Address used for DNAT Translation";
68 uses dnat-configuration;
73 rpc get_nat_translations_on_router {
74 description "Provides the NAT translations for given router uuid";
77 description "Router UUID";
87 Sample output of get_nat_translations_on_router RPC
92 "router-uuid": "feca5b1a-8ca8-43c1-b85d-80542144435d",
95 "external-port": "49152",
96 "internal-port": "33811",
97 "internal-ip": "20.0.0.5",
98 "external-ip": "172.170.0.3",
102 "router-name": "router2",
105 "external-ip": "172.170.0.100",
106 "internal-ip": "20.0.0.5"
116 rpc get_nat_translations_on_vpn {
117 description "Provides the NAT translations for given vpn uuid";
120 description "External VPN UUID";
130 Sample output for get_nat_translations_on_vpn RPC
135 "router-uuid": "2e4563c4-c051-44f9-a84a-0d6814f2b83e",
136 "router-name": "router1",
139 "external-port": "49152",
140 "internal-port": "39268",
141 "internal-ip": "10.0.0.5",
142 "external-ip": "172.160.0.3",
148 "router-uuid": "feca5b1a-8ca8-43c1-b85d-80542144435d",
151 "external-port": "49152",
152 "internal-port": "33811",
153 "internal-ip": "20.0.0.5",
154 "external-ip": "172.170.0.3",
158 "router-name": "router2",
161 "external-ip": "172.170.0.100",
162 "internal-ip": "20.0.0.5"
171 rpc get_nat_translations_for_network_and_ipaddress {
172 description "Provides the NAT translations for given IP Address";
175 description "Network UUID of the Internal IP address provided";
180 description "Internal IP address of VM";
182 type inet:ip-address;
186 leaf nat-translation {
187 description "Represents whether its an SNAT or DNAT translation";
191 description "External IP address used for NAT translation";
195 description "Internal IP address";
199 description "External Port";
203 description "Internal Port";
207 description "Protocol Type";
216 "nat-translation": "DNAT",
217 "external-ip-address": "172.160.0.100"
224 "nat-translation": "SNAT",
225 "external-port": "49152",
226 "internal-port": "6543",
227 "internal-ip": "10.0.0.5",
228 "external-ip": "172.160.0.3",