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 the 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 region ID of the NAT gateway.

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

SnatTableId String No stb-8vbczigrhop8x5u3t****

The ID of the SNAT table.

Note You must set at least one of the SnatTableId and NatGatewayId parameters.
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 specified in 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, and can contain digits, underscores (_), and hyphens (-). The name must start with a letter.

PageNumber Integer No 1

The number of the page to return. Default value: 1.

PageSize Integer No 10

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

NatGatewayId String No ngw-bp1uewa15k4iy5770****

The ID of the NAT gateway.

Note You must set at least one of the SnatTableId and NatGatewayId parameters.

Response parameters

Parameter Type Example Description
PageSize Integer 5

The number of entries returned per page.

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

The ID of the request.

PageNumber Integer 1

The page number of the returned page.

TotalCount Integer 1

The number of entries returned.

SnatTableEntries Array of SnatTableEntry

The details of the SNAT entries.

SnatTableEntry
Status String Pending

The status of the SNAT entry. Valid values:

  • Pending: being created or modified
  • Available: available
  • Deleting: being deleted
SnatEntryName String SnatEntry-1

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

The source CIDR block specified in the SNAT entry.

SnatEntryId String snat-kmd6nv8fy****

The ID of the SNAT entry.

SnatTableId String stb-gz3r3odawdgffde****

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

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.

Examples

Sample requests

http(s)://[Endpoint]/?Action=DescribeSnatTableEntries
&RegionId=cn-hangzhou
&SnatTableId=stb-8vbczigrhop8x5u3t****
&SnatEntryId=snat-8vbae8uqh7rjpk7d2****
&SourceVSwitchId=vsw-3xbjkhjshjdf****
&SourceCIDR=116.22.XX.XX/24
&SnatIp=116.22.XX.XX
&SnatEntryName=SnatEntry-1
&PageNumber=1
&PageSize=10
&NatGatewayId=ngw-bp1uewa15k4iy5770****
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

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

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "PageSize" : 5,
  "RequestId" : "6D7E89B1-1C5B-412B-8585-4908E222EED5",
  "PageNumber" : 1,
  "TotalCount" : 1,
  "SnatTableEntries" : [ {
    "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"
  } ]
}

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 Error Center.