Queries SNAT entries.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates a sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeSnatTableEntries

The operation that you want to perform. Set the value to DescribeSnatTableEntries.

RegionId String Yes cn-hangzhou

The ID of the region where the NAT gateway is deployed.

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

SnatTableId String Yes stb-8vbczigrhop8x5u3t****

The ID of the SNAT table.

SnatEntryId String No snat-8vbae8uqh7rjpk7d2****

The ID of the SNAT entry.

SourceVSwitchId String No vsw-3xbjkhjshjdf****

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.
SourceCIDR String No 116.22.XX.XX/24

The source CIDR block of the SNAT entry.

SnatIp String No 116.22.XX.XX
  • 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.
SnatEntryName String No SnatEntry-1

The name of the SNAT entry.

The name must be 2 to 128 characters in length. It must start with a letter but cannot start with http:// or https://.

PageNumber Integer No 1

The number of the page returned. Default value: 1.

PageSize Integer No 10

The number of entries to return on each page. Maximum value: 50. Default value: 10.

Response parameters

Parameter Type Example Description
SnatTableEntries Array of SnatTableEntry

Details of SNAT entries.

SnatTableEntry
SnatEntryId String snat-kmd6nv8fy****

The ID of the SNAT entry.

SnatEntryName String SnatEntry-1

The name of the SNAT entry.

SnatIp String 116.22.XX.XX
  • 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.
SnatTableId String stb-gz3r3odawdgffde****

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

SourceCIDR String 116.22.XX.XX/24

The source CIDR block of the SNAT entry.

SourceVSwitchId String vsw-3xbdsffvfgdfds****
  • 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.
Status String Pending

The status of the SNAT entry. Valid values:

  • Pending: being created or modified
  • Available: available
  • Deleting: being deleted
TotalCount Integer 1

The total number of entries returned.

PageNumber Integer 1

The page number of the returned page.

PageSize Integer 5

The number of entries returned per page.

RequestId String 6D7E89B1-1C5B-412B-8585-4908E222EED5

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=DescribeSnatTableEntries
&RegionId=cn-hangzhou
&SnatTableId=stb-8vbczigrhop8x5u3t****
&<Common request parameters>

Sample success responses

XML format

<DescribeSnatTableEntriesResponse>
  <TotalCount>1</TotalCount>
  <PageSize>5</PageSize>
  <RequestId>6D7E89B1-1C5B-412B-8585-4908E222EED5</RequestId>
  <PageNumber>1</PageNumber>
  <SnatTableEntries>
        <SnatTableEntry>
              <Status>Pending</Status>
              <SourceVSwitchId>vsw-3xbdsffvfgdfds****</SourceVSwitchId>
              <SnatEntryName>SnatEntry-1</SnatEntryName>
              <SourceCIDR>116.22.XX.XX/24</SourceCIDR>
              <SnatEntryId>snat-kmd6nv8fy****</SnatEntryId>
              <SnatIp>116.22.XX.XX</SnatIp>
              <SnatTableId>stb-gz3r3odawdgffde****</SnatTableId>
        </SnatTableEntry>
  </SnatTableEntries>
</DescribeSnatTableEntriesResponse>

JSON format

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

Error codes

HttpCode Error code Error message Description
404 InvalidRegionId.NotFound The specified RegionId does not exist in our records. The error message returned because the specified region ID does not exist.
404 InvalidSnatTableId.NotFound Specified SNAT table does not exist. The error message returned because the specified SNAT table does not exist. Check whether the ID of the SNAT table is valid.

For a list of error codes, visit the API Error Center.