tencent cloud

Feedback

DescribeNatGatewaySourceIpTranslationNatRules

Last updated: 2024-11-25 20:08:45

    1. API Description

    Domain name for API request: vpc.intl.tencentcloudapi.com.

    This API is used to query the NAT gateway's SNAT forwarding rules.

    A maximum of 20 requests can be initiated per second for this API.

    We recommend you to use API Explorer
    Try it
    API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

    2. Input Parameters

    The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

    Parameter Name Required Type Description
    Action Yes String Common Params. The value used for this API: DescribeNatGatewaySourceIpTranslationNatRules.
    Version Yes String Common Params. The value used for this API: 2017-03-12.
    Region Yes String Common Params. For more information, please see the list of regions supported by the product.
    NatGatewayId Yes String The unique ID of the NAT Gateway, such as nat-123xx454.
    Filters.N No Array of Filter Filter:
  • resource-id: The subnet ID (such as subnet-0yi4hekt) or CVM ID
  • public-ip-address: The EIP, such as 139.199.232.238
  • description The rule description
  • Offset No Integer Offset. Default value: 0.
    Limit No Integer Number of returned results. Default value: 20. Maximum value: 100.

    3. Output Parameters

    Parameter Name Type Description
    SourceIpTranslationNatRuleSet Array of SourceIpTranslationNatRule Array of objects of a NAT gateway's SNAT rules.
    Note: this field may return null, indicating that no valid values can be obtained.
    TotalCount Integer The number of eligible object arrays of a NAT gateway's forwarding rules.
    RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

    4. Example

    Example1 Querying the SNAT forwarding rules of a NAT gateway

    This example shows you how to use the Filter array to obtain the SNAT forwarding rules of a NAT gateway.

    Input Example

    https://vpc.intl.tencentcloudapi.com/?Action=DescribeNatGatewaySourceIpTranslationNatRules
    &NatGatewayId=nat-3isn9hr0
    &Filters.0.Name=resource-id
    &Filters.0.Values.0=subnet-0yi4hekt
    &<Common request parameters>
    

    Output Example

    {
        "Response": {
            "TotalCount": 1,
            "SourceIpTranslationNatRuleSet": [
                {
                    "NatGatewaySnatId": "subnet-0yi4hekt",
                    "ResourceId": "subnet-0yi4hekt",
                    "ResourceType": "SUBNET",
                    "PublicIpAddresses": [
                        "139.199.232.238"
                    ],
                    "PrivateIpAddress": "10.80.80.0/24",
                    "Description": "test_snat",
                    "CreatedTime": "2019-05-04 13:42:11",
                    "NatGatewayId": "nat-3isn9hr0",
                    "VpcId": "vpc-0yi4hekt"
                }
            ],
            "RequestId": "eb203971-a7a0-45c1-9c72-36ad86688590"
        }
    }
    

    5. Developer Resources

    SDK

    TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

    Command Line Interface

    6. Error Code

    The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

    Error Code Description
    InternalError An internal error occurred.
    InternalServerError Internal error.
    InvalidAddressId.NotFound The specified EIP does not exist.
    InvalidParameter A parameter error occurred.
    InvalidParameter.FilterInvalidKey The specified filter condition does not exist.
    InvalidParameterValue The parameter value is invalid.
    InvalidParameterValue.LimitExceeded The parameter value exceeds the limit.
    InvalidParameterValue.Malformed Invalid input parameter format.
    InvalidParameterValue.Range The parameter value is not in the specified range.
    ResourceNotFound The resource does not exist.