All Products
Search
Document Center

Network Intelligence Service:GetNatTopN

Last Updated:Sep 13, 2024

Queries the real-time SNAT performance ranking of a NAT gateway.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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:
    • The required resource types are displayed in bold characters.
    • 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
nis:GetNatTopNlist
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringNo

The ID of the region in which the NAT gateway is deployed.

cn-shanghai
NatGatewayIdstringYes

The ID of the NAT gateway.

ngw-sample***
BeginTimelongYes

The beginning of the time range to query in milliseconds. If you do not specify EndTime, the point in time specified by BeginTime is queried.

1638239092000
EndTimelongNo

The end of the time range to query in milliseconds. The time range specified by BeginTime and EndTime cannot exceed 86400000 milliseconds (24 hours).

1638239093000
OrderBystringNo

The metric that is used for real-time SNAT performance ranking. Valid values:

  • InBps: inbound data transfer. Unit: bit/s.
  • OutBps: outbound data transfer. Unit: bit/s.
  • InPps: inbound packet forwarding rate. Unit: packets per second.
  • OutPps: outbound packet forwarding rate. Unit: packets per second.
  • NewSessionPerSecond: new connection creation rate. Unit: connections per second.
  • ActiveSessionCount: number of concurrent connections. Unit: connections.
InBps
TopNintegerNo

The number of entries to return for real-time SNAT performance ranking. Valid values: 1 to 100. Default value: 10.

10
IpstringNo

Query ranking statistics for a specific IP address. If you specify this parameter, you do not need to specify TopN or OrderBy.

192.168.156.101

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

77C512B5-12f3-f892-BD94-88A98271C1A0
NatGatewayTopNarray<object>

An array of statistics about real-time SNAT performance ranking.

object

The fields that are included in the statistics about real-time SNAT performance ranking. The values of the fields are averages within the time range from BeginTime to EndTime.

Ipstring

The IP address.

192.168.156.101
InBpsfloat

The inbound data transfer. Unit: bit/s.

100
OutBpsfloat

The outbound data transfer. Unit: bit/s.

200
InPpsfloat

The inbound packet forwarding rate. Unit: packets per second.

10
OutPpsfloat

The outbound packet forwarding rate. Unit: packets per second.

20
InFlowPerMinutefloat

This field is reserved and not in use.

10
OutFlowPerMinutefloat

This field is reserved and not in use.

10
NewSessionPerSecondfloat

The new connection creation rate. Unit: connections per second.

2
ActiveSessionCountfloat

The number of concurrent connections. Unit: connections.

8
IsTopNOpenboolean

Indicates whether Network Intelligence Service (NIS) is activated. The NatGatewayTopN parameter returns an empty array when NIS is not activated.

  • true: activated
  • false: not activated
true

Examples

Sample success responses

JSONformat

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

Error codes

HTTP status codeError codeError messageDescription
400IllegalParam.TopNThe TopN(%s) should not greater than 100.Only top 100 are supported. Actual input: (%s).
400IllegalParam.BeginTimeAndEndTimeIt only supports querying data for up to 7 days: %s.You can query data within the last seven days: %s.
400IllegalParam.ResourceIdThe specified resourceId (%s) may be not exist.The specified instance (%s) may not exist. Check the spelling.
400IllegalParam.OrderByThe specified param of orderBy (%s) is invalid.The specified sort field (%s) is invalid.

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

Change history

Change timeSummary of changesOperation
2024-07-10The API operation is deprecated. The Error code has changedView Change Details
2023-04-27The Error code has changedView Change Details