GetNatTopN

Updated at:

Retrieves the real-time SNAT forwarding data rankings for a NAT gateway.

Note

This API has been deprecated. We recommend migrating to nis(2021-12-16) - GetNisNetworkRanking for enhanced functionality and continued support. While the deprecated API remains temporarily accessible, no further updates or bug fixes will be provided.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

nis:GetNatTopN

list

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

No

The region ID of the NAT gateway instance.

cn-shanghai

NatGatewayId

string

Yes

The instance ID of the NAT gateway.

ngw-sample***

BeginTime

integer

Yes

The start timestamp in milliseconds for the metric query. If EndTime is not specified, the query returns data at the point in time specified by BeginTime.

1638239092000

EndTime

integer

No

The end timestamp in milliseconds for the metric query. The maximum difference between BeginTime and EndTime cannot exceed 24 hours, which is 86400000 milliseconds.

1638239093000

OrderBy

string

No

The metric used to rank the real-time SNAT forwarding data of the NAT gateway. Valid values:

  • InBps: inbound traffic. Unit: bit/s.

  • OutBps: outbound traffic. Unit: bit/s.

  • InPps: inbound packet rate. Unit: packets per second.

  • OutPps: outbound packet rate. Unit: packets per second.

  • NewSessionPerSecond: New Connections. Unit: connections per second.

  • ActiveSessionCount: Concurrent Connections. Unit: connections.

InBps

TopN

integer

No

The number of entries to return for the real-time SNAT forwarding data rankings of the NAT gateway. Valid values: 1 to 100. Default value: 10.

10

Ip

string

No

The IP address for which to query monitoring metrics. If the Ip parameter is specified, you do not need to specify TopN or OrderBy.

192.168.156.101

Response elements

Element

Type

Description

Example

object

IsTopNOpen

boolean

Indicates whether the Network Intelligence Service (NIS) feature is enabled. If the feature is not enabled, NatGatewayTopN returns empty.

  • true: Enabled.

  • false: Not enabled.

true

NatGatewayTopN

array<object>

The array of real-time SNAT forwarding data rankings for the NAT gateway.

object

The real-time SNAT forwarding data ranking object for the NAT gateway. The following metrics are averaged from BeginTime to EndTime.

ActiveSessionCount

number

The number of Concurrent Connections.

8

InBps

number

The inbound traffic. Unit: bit/s.

100

InFlowPerMinute

number

A reserved field. Not currently in use.

10

InPps

number

The inbound packet rate. Unit: packets per second.

10

Ip

string

The IP address.

192.168.156.101

NewSessionPerSecond

number

The number of New Connections. Unit: connections per second.

2

OutBps

number

The outbound traffic. Unit: bit/s.

200

OutFlowPerMinute

number

A reserved field. Not currently in use.

10

OutPps

number

The outbound packet rate. Unit: packets per second.

20

RequestId

string

The request ID.

77C512B5-12f3-f892-BD94-88A98271C1A0

Examples

Success response

JSON format

{
  "IsTopNOpen": true,
  "NatGatewayTopN": [
    {
      "ActiveSessionCount": 8,
      "InBps": 100,
      "InFlowPerMinute": 10,
      "InPps": 10,
      "Ip": "192.168.156.101",
      "NewSessionPerSecond": 2,
      "OutBps": 200,
      "OutFlowPerMinute": 10,
      "OutPps": 20
    }
  ],
  "RequestId": "77C512B5-12f3-f892-BD94-88A98271C1A0"
}

Error codes

HTTP status code

Error code

Error message

Description

400 IllegalParam.TopN The TopN(%s) should not greater than 100. Only top 100 are supported. Actual input: (%s).
400 IllegalParam.BeginTimeAndEndTime It only supports querying data for up to 7 days: %s. You can query data within the last seven days: %s.
400 IllegalParam.ResourceId The specified resourceId (%s) may be not exist. The specified instance (%s) may not exist. Check the spelling.
400 IllegalParam.OrderBy The specified param of orderBy (%s) is invalid. The specified sort field (%s) is invalid.
400 IllegalParam.RegionId The specified RegionId parameter is illegal. The specified RegionId parameter is illegal.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.