All Products
Search
Document Center

NAT Gateway:DescribeSnatTableEntries

Last Updated:Jan 12, 2026
This topic is generated by a machine translation engine without any human intervention. ALIBABA CLOUD DOES NOT GUARANTEE THE ACCURACY OF MACHINE TRANSLATED CONTENT. To request a human-translated version of this topic or provide feedback on this translation, please include it in the feedback form.

Queries SNAT entries.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The ID of the region where you want to create the NAT gateway.

You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou
SnatTableIdstringNo

The ID of the SNAT table.

Note You must specify at least one of SnatTableId and NatGatewayId.
stb-8vbczigrhop8x5u3t****
SnatEntryIdstringNo

The ID of the SNAT entry.

snat-8vbae8uqh7rjpk7d2****
SourceVSwitchIdstringNo

The ID of the vSwitch.

  • When you query SNAT entries of Internet NAT gateways, this parameter specifies that Elastic Compute Service (ECS) instances in the vSwitch can use SNAT entries to access the Internet.
  • When you query SNAT entries of virtual private cloud (VPC) NAT gateways, this parameter specifies that ECS instances in the vSwitch can use SNAT entries to access external networks.
vsw-3xbjkhjshjdf****
SourceCIDRstringNo

The source CIDR block specified in the SNAT entry.

116.22.XX.XX/24
SnatIpstringNo
  • When you query SNAT entries of Internet NAT gateways, this parameter specifies the EIP in an SNAT entry.
  • When you query SNAT entries of VPC NAT gateways, this parameter specifies the NAT IP address in an SNAT entry.
116.22.XX.XX
SnatEntryNamestringNo

The name of the SNAT entry.

The name must be 2 to 128 characters in length, and can contain digits, underscores (_), and hyphens (-). The name must start with a letter.

SnatEntry-1
PageNumberintegerNo

The page number. Default value: 1.

1
PageSizeintegerNo

The number of entries per page. Maximum value: 50. Default value: 10.

10
NatGatewayIdstringNo

The ID of the NAT gateway.

Note You must specify at least one of SnatTableId and NatGatewayId.
ngw-bp1uewa15k4iy5770****
NetworkInterfaceIdsarrayNo

The ID of the elastic network interface to be queried.

stringNo

Elastic Network Interface ID

eni-gw8g131ef2dnbu3k****

Response parameters

ParameterTypeDescriptionExample
object
PageSizeinteger

The number of entries per page.

5
RequestIdstring

The request ID.

6D7E89B1-1C5B-412B-8585-4908E222EED5
PageNumberinteger

The number of the returned page.

1
TotalCountinteger

The number of returned entries.

1
SnatTableEntriesarray<object>

Details of SNAT entries.

SnatTableEntryobject
Statusstring

The status of the SNAT entry. Valid values:

  • Pending
  • Available
  • Deleting
Pending
SnatEntryNamestring

The name of the SNAT entry.

SnatEntry-1
SourceVSwitchIdstring
  • When you query SNAT entries of Internet NAT gateways, this parameter indicates the ID of the vSwitch that uses SNAT to access the Internet.
  • When you query SNAT entries of VPC NAT gateways, this parameter indicates the ID of the vSwitch that uses SNAT to access external networks.
vsw-3xbdsffvfgdfds****
SourceCIDRstring

The source CIDR block specified in the SNAT entry.

116.22.XX.XX/24
SnatEntryIdstring

The ID of the SNAT entry.

snat-kmd6nv8fy****
SnatTableIdstring

The ID of the SNAT table to which the SNAT entry belongs.

stb-gz3r3odawdgffde****
SnatIpstring
  • When you query SNAT entries of Internet NAT gateways, this parameter indicates the EIP in an SNAT entry.
  • When you query SNAT entries of VPC NAT gateways, this parameter indicates the NAT IP address in an SNAT entry.
116.22.XX.XX
NatGatewayIdstring

The ID of the NAT gateway to which the SNAT entry belongs.

ngw-bp1uewa15k4iy5770****
NetworkInterfaceIdstring

Elastic Network Interface ID

eni-gw8g131ef2dnbu3k****
EipAffinitystring

Whether to enable IP affinity. Values:

  • 0: Disable IP affinity. - 1: Enable IP affinity.
Note After enabling the IP affinity switch, if an SNAT entry is bound to multiple EIPs or NAT IPs, the same client will use the same EIP or NAT IP for access. Otherwise, the client will randomly select from the bound EIPs or NAT IPs for access.
1

Examples

Sample success responses

JSONformat

{
  "PageSize": 5,
  "RequestId": "6D7E89B1-1C5B-412B-8585-4908E222EED5",
  "PageNumber": 1,
  "TotalCount": 1,
  "SnatTableEntries": {
    "SnatTableEntry": [
      {
        "Status": "Pending",
        "SnatEntryName": "SnatEntry-1",
        "SourceVSwitchId": "vsw-3xbdsffvfgdfds****",
        "SourceCIDR": "116.22.XX.XX/24",
        "SnatEntryId": "snat-kmd6nv8fy****",
        "SnatTableId": "stb-gz3r3odawdgffde****",
        "SnatIp": "116.22.XX.XX",
        "NatGatewayId": "ngw-bp1uewa15k4iy5770****",
        "NetworkInterfaceId": "eni-gw8g131ef2dnbu3k****",
        "EipAffinity": 1
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidName.MalformedThe specified Name is not valid.The Name parameter is set to an invalid value.
400DESCRIBE_SNAT_PARAM_INVALIDSnatTableId and natGatewayId can not both be null-
404InvalidRegionId.NotFoundThe specified RegionId does not exist in our records.The specified region ID does not exist.
404InvalidSnatTableId.NotFoundSpecified SNAT table does not exist.The specified SNAT table does not exist.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-08-09The Error code has changed. The request parameters of the API has changed. The response structure of the API has changedView Change Details
2024-05-06API Description Update. The Error code has changed. The response structure of the API has changedView Change Details
2023-08-09The Error code has changed. The response structure of the API has changedView Change Details
2023-03-01The Error code has changedView Change Details