Get NSX-T NAT Rule Details
To view the details of an NSX-T NAT rule, use the following request:
GET /nsxt_edge_gateways/:nsxt_edge_gateway_id/nat_rules/:id.xml
GET /nsxt_edge_gateways/:nsxt_edge_gateway_id/nat_rules/:id.json
XML Request Example
curl -i -X GET http://onapp.test/nsxt_edge_gateways/:nsxt_edge_gateway_id/nat_rules/:id.xml -u 'user_email:api_key' -H 'Accept: application/xml' -H 'Content-type: application/xml'
JSON Request Example
curl -i -X GET http://onapp.test/nsxt_edge_gateways/:nsxt_edge_gateway_id/nat_rules/:id.json -u 'user_email:api_key' -H 'Accept: application/json' -H 'Content-type: application/json'
XML Output Example
<vcloud_nsxt_nat_rule>
<id type="integer">300</id>
<identifier>8a4c6f46-1128-4902-924e-3a3eefc8ecd3</identifier>
<label>ms SNAT all fields</label>
<description>some description</description>
<enabled type="boolean">true</enabled>
<rule_type>SNAT</rule_type>
<vcloud_nsxt_edge_gateway_id type="integer">32</vcloud_nsxt_edge_gateway_id>
<port nil="true"/>
<logging type="boolean">true</logging>
<system type="boolean">false</system>
<version type="integer">0</version>
<vcloud_nsxt_application_port_profile_id nil="true"/>
<created_at type="dateTime">2022-02-02T18:28:41+03:00</created_at>
<updated_at type="dateTime">2022-02-02T18:28:41+03:00</updated_at>
<vcloud_nsxt_external_ip_address>192.168.1.49</vcloud_nsxt_external_ip_address>
<vcloud_nsxt_internal_ip_address>192.168.1.46</vcloud_nsxt_internal_ip_address>
<vcloud_nsxt_destination_ip_address>192.168.1.59</vcloud_nsxt_destination_ip_address>
</vcloud_nsxt_nat_rule>
Where:
vcloud_nsxt_nat_rule - the NSX-T NAT rule with the following information:
id - the ID of the NSX-T NAT rule
identifier - the identifier of the NSX-T NAT rule
label - the name of the NSX-T NAT rule
description - a description of an NSX-T NAT rule
enabled - true if the NSX-T NAT rule is enabled; otherwise, false
rule_type - source NAT (SNAT) or destination NAT (DNAT), NO DNAT (prevents the translation of the external IP address of packets received by an organization VDC from an external network or another organization VDC network), and NO SNAT (prevents the translation of the internal IP address of packets sent from an organization VDC out to an external network or another organization VDC network)
vcloud_nsxt_edge_gateway_id - the ID of the NSX-T edge gateway
port - applicable to a DNAT rule only; the port of packets received by an organization VDC network that is coming from an external network or another organization VDC network to be translated by the DNAT rule
logging - true if logging is enabled; otherwise, false
system - always false
version - the version of the NSX-T NAT rule. It is 0 when a rule has just been created, 1 if it has been edited once, 2 if it has been edited twice, etc.
vcloud_nsxt_application_port_profile_id - the ID of the NSX-T application port profile
created_at - the date when the NSX-T NAT rule was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format
updated_at - the date when the NSX-T NAT rule was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format
vcloud_nsxt_external_ip_address - the public IP address of the NSX-T edge gateway for which you are configuring a DNAT or SNAT rule. The IP addresses must belong to the sub-allocated IP range of the edge gateway; can be IPv4 or CIDR only
vcloud_nsxt_internal_ip_address - if the type of the NSX-T NAT rule is DNAT, it is the IP address or the range of IP addresses of the virtual server for which you are configuring the DNAT rule so that they can receive traffic from the external network; if the type of the NSX-T NAT rule is SNAT or NO SNAT, it is the IP address or the range of IP addresses of the virtual servers for which you are configuring the SNAT or NO SNAT rule so that they can send traffic to the external network; can be IPv4 or CIDR only
vcloud_nsxt_destination_ip_address - the IP address or the range of IP addresses in CIDR format to which traffic is applied by a SNAT or NO SNAT rule. If blank, a SNAT rule applies to all destinations outside of the local subnet