GetNatTopN
Retrieves the real-time SNAT forwarding data rankings for a NAT gateway.
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
Test
RAM authorization
|
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 |
| 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 |
| 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.