NatNetworksResource


Create a nat network in a datacenter


POST https://example.com/api/admin/datacenters/{datacenter}/natnetworks

Roles : [ROLE_PHYS_DC_RETRIEVE_DETAILS, ROLE_VDC_MANAGE_VAPP, ROLE_VDC_ENUMERATE]

Content-Type : natnetwork Accept : natnetwork

Error Codes

  • NAT-NET-2 - NAT not supported in the device
  • NAT-NET-3 - NAT network requires a device link
  • NAT-NET-5 - Invalid format for network CIDR

Example

List nat networks in a datacenter


Retrieve NAT networks in a datacenter

GET https://example.com/api/admin/datacenters/{datacenter}/natnetworks

Roles : [ROLE_PHYS_DC_RETRIEVE_DETAILS, ROLE_VDC_MANAGE_VAPP, ROLE_VDC_ENUMERATE]

Parameter Type Default Value Description
startwith Integer 0 The first element to be retrieved of the filtered search
limit Integer 25 The number of entities to retrieve
has String If present filter by CIDR, NAME
by String Order by : {@link NatNetworkDAO.ORDER_BY}
asc boolean true If the value of the 'by' parameter must be sorted in ascending order (true) or descending order (false)

Accept : natnetworks

Example

List nat ips in a datacenter


Retrieve NAT IPs in a datacenter (any NAT network)

GET https://example.com/api/admin/datacenters/{datacenter}/natnetworks/action/allips

Roles : [ROLE_PHYS_DC_RETRIEVE_DETAILS]

Parameter Type Default Value Description
startwith Integer 0 The first element to be retrieved of the filtered search
by String ip Order by : {@link NatIpDAO.ORDER_BY}
has String If present filter by: IP
limit Integer 25 The number of entities to retrieve
asc Boolean true If the value of the 'by' parameter must be sorted in ascending order (true) or descending order (false)
all Boolean false If true also returns unavailable NAT IPs
snatdefault Boolean false If true only returns NAT IPs being used as default SNAT in some virtual datacenter

Accept : natips

Example

List nat rules in a datacenter


Retrieve NAT rules in a datacenter (any NAT IP or NAT network)

GET https://example.com/api/admin/datacenters/{datacenter}/natnetworks/action/allrules

Roles : [ROLE_PHYS_DC_RETRIEVE_DETAILS]

Parameter Type Default Value Description
startwith Integer 0 The first element to be retrieved of the filtered search
by String ip Order by
has String If present filter to apply in the search.
limit Integer 25 The number of entities to retrieve
asc Boolean true If the value of the 'by' parameter must be sorted in ascending order (true) or descending order (false)
snat Boolean If true only returns SNAT rules. If false only return DNAT rules

Accept : natrules

Example

Delete a nat network from a datacenter


DELETE https://example.com/api/admin/datacenters/{datacenter}/natnetworks/{natnetwork}

Roles : [ROLE_PHYS_DC_ALLOW_MODIFY_NETWORK]

Example

Get a nat network in a datacenter


GET https://example.com/api/admin/datacenters/{datacenter}/natnetworks/{natnetwork}

Roles : [ROLE_PHYS_DC_RETRIEVE_DETAILS, ROLE_VDC_MANAGE_VAPP, ROLE_VDC_ENUMERATE]

Accept : natnetwork

Example

Update a nat network in a datacenter


PUT https://example.com/api/admin/datacenters/{datacenter}/natnetworks/{natnetwork}

Roles : [ROLE_PHYS_DC_ALLOW_MODIFY_NETWORK]

Content-Type : natnetwork Accept : natnetwork

Error Codes

  • NAT-NET-4 - Cannot edit or delete NAT with created IPs

Example