All Products
Search
Document Center

NAT Gateway:DescribeNatGatewayAssociateNetworkInterfaces

Last Updated:Oct 28, 2025

Queries elastic network interfaces (ENIs) associated with a virtual private cloud (VPC) NAT gateway when the VPC NAT gateway serves as a PrivateLink service resource. This feature is not publicly available.

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

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
vpc:DescribeNatGatewayAssociateNetworkInterfaceslist
NatGateway
acs:vpc:{#regionId}:{#accountId}:natgateway/{#NatGatewayId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the Internet NAT gateway.

Call the DescribeRegions operation to query the region list.

cn-hangzhou
NatGatewayIdstringYes

The ID of the NAT gateway.

ngw-bp1uewa15k4iy5770****
ResourceGroupIdstringNo

The resource group ID.

rg-acfmxazdjdhd****
Tagarray<object>No

The information about resource tags.

objectNo

The tag.

KeystringNo

The tag key You can specify at most 20 tag keys. It cannot be an empty string,

The tag key can be up to 64 characters in length and cannot contain http:// or https://. The tag key cannot start with aliyun or acs:.

FinanceDept
ValuestringNo

The tag key. You can specify at most 20 tag keys. It cannot be an empty string.

The tag key can be up to 64 characters in length and cannot contain http:// or https://. The tag key cannot start with aliyun or acs:.

FinanceJoshua
ClientTokenstringNo

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The client token can contain only ASCII characters.

Note If you do not set this parameter, the value of RequestId is used.**** The RequestId may be different for each request.
5A2CFF0E-5718-45B5-9D4D-70B3FF****
Filterarray<object>No

The filter information. You can specify a filter key and a filter value.

objectNo

The information about the filter.

KeystringNo

The filter key.

  • ResourceId
Note Specify the service resource ID in the Value field.
  • NetworkInterfaceId
Note Specify the ENI ID in the Value field.
  • ResourceOwnerId
Note Specify the UID of the account to which the service resource belongs.
ResourceId
ValuestringNo

Separate multiple values with commas (,).

ep-8psre8c8936596cd****
NextTokenstringNo

The pagination token that is used in the next request to retrieve a new page of results. Valid value:

  • If no value is returned for NetToken, you do not need to specify this parameter.
  • If a value is returned for NextToken, you must specify the token that is obtained from the previous query as the value of NextToken.
caeba0bbb2be03f84eb48b699f0a****
MaxResultsintegerNo

The number of entries to return per page. Valid values: 1 to 100. Default value: 20.

20

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

Request ID.

2315DEB7-5E92-423A-91F7-4C1EC9AD****
NextTokenstring

Indicates whether the token for the next query exists. Valid value:

  • If NextToken is empty, there is no next page.
  • If the value returned of NextToken is not empty, the value indicates the token that is used for the next query.
caeba0bbb2be03f84eb48b699f0a****
MaxResultsinteger

The number of entries to return per page. Valid values: 1 to 100. Default value: 20.

20
NatGatewayIdstring

The ID of the VPC NAT gateway.

ngw-bp1uewa15k4iy5770****
TotalCountinteger

The total number of entries.

1
AssociateNetworkInterfacesarray<object>

The ENIs associated with the VPC NAT gateway.

AssociateNetworkInterfaceobject

The details of the ENI.

NetworkInterfaceIdstring

The ID of the ENI.

eni-gw8g131ef2dnbu3k****
ResourceIdstring

The ID of the service resource.

ep-8psre8c8936596cd****
ResourceTypestring

The type of the service resource.

PrivateLink
ResourceOwnerIdstring

The UID of the account to which the service resource belongs.

138859086900****
IPv4Setsarray<object>

The IPv4 addresses of the ENIs.

IPv4Setobject

The IPv4 address of the ENI.

IPv4Addressstring

The primary private IP address of the ENI.

172.17.**.**
Primaryboolean

Indicates whether the IP address is the primary private IP address. Valid values:

  • true: Primary private IP address
  • false: Secondary private IP addresses
true
TunnelIndexstring

The ID of the tunnel index.

41a5489ea2a0****
Countinteger

Number of associated ENIs.

0

Examples

Sample success responses

JSONformat

{
  "RequestId": "2315DEB7-5E92-423A-91F7-4C1EC9AD****",
  "NextToken": "caeba0bbb2be03f84eb48b699f0a****",
  "MaxResults": 20,
  "NatGatewayId": "ngw-bp1uewa15k4iy5770****",
  "TotalCount": 1,
  "AssociateNetworkInterfaces": {
    "AssociateNetworkInterface": [
      {
        "NetworkInterfaceId": "eni-gw8g131ef2dnbu3k****",
        "ResourceId": "ep-8psre8c8936596cd****",
        "ResourceType": "PrivateLink",
        "ResourceOwnerId": "138859086900****",
        "IPv4Sets": {
          "IPv4Set": [
            {
              "IPv4Address": "172.17.**.**",
              "Primary": true
            }
          ]
        },
        "TunnelIndex": "41a5489ea2a0****",
        "ResourceVpcId": ""
      }
    ]
  },
  "Count": 0
}

Error codes

HTTP status codeError codeError messageDescription
400InstanceNotExist.NatGatewayIdThe NAT gateway instance is not exist.The NAT Gateway instance does not exist.
400IllegalParam.ResourceOwnerIdThe param of resource owner ID is illegal.The parameter of resource owner ID is illegal.

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

Change history

Change timeSummary of changesOperation
2024-12-30The Error code has changed. The response structure of the API has changedView Change Details
2024-10-23The Error code has changed. The response structure of the API has changedView Change Details