Queries traffic details for pay-as-you-go billing.
Operation description
For pay-as-you-go users, details are provided at the instance level. For subscription users, only overall queries are supported.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Lang |
string |
No |
The language of the request and response. Valid values:
|
zh |
| PageSize |
integer |
No |
The number of entries to return on each page. Default value: 10. Maximum value: 50. |
10 |
| CurrentPage |
integer |
No |
The page number of the page to return. Default value: 1. |
1 |
| StartTime |
string |
Yes |
Set the start time for the query. Use the YYYYMMDD date format. |
20240101 |
| EndTime |
string |
Yes |
Set the end time for the query. Use the YYYYMMDD date format. |
20240131 |
| SearchItem |
string |
No |
The IP address or instance ID of the asset. |
192.0.XX.XX |
| TrafficType |
string |
Yes |
The type of the firewall border for which to query traffic. This parameter is required. Valid values:
|
VPC_TRAFFIC |
| Order |
string |
No |
The field to use for sorting. Valid values:
|
resourceId |
| RegionNo |
string |
No |
The region information. |
cn-beijing |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| TotalCount |
integer |
The total number of traffic statistics entries. |
132 |
| RequestId |
string |
The ID of the request. |
0525EADE-C112-5702-A5BC-0E2F6F94DB23 |
| TrafficList |
array<object> |
The list of traffic statistics. |
|
|
object |
The traffic statistics information. |
||
| TrafficDay |
string |
The date of the traffic statistics. |
20231001 |
| TrafficType |
string |
The type of the firewall border for which traffic is queried. Valid values:
|
EIP_TRAFFIC |
| InstanceId |
string |
The ID of the asset instance. |
i-8vb2d7c9mtn0bo9qcraq |
| ResourceId |
string |
The ID of the resource. For Internet border traffic, this is the public IP address of the asset. For NAT border traffic, this is the instance ID of the firewall. |
39.106.146.214 |
| InstanceType |
string |
The asset type. This value is valid only for the Internet border. |
EcsPublicIP |
| TotalBytes |
integer |
The total network throughput for both inbound and outbound traffic, in bytes. |
1215096939 |
| InBytes |
integer |
The inbound network throughput, in bytes. |
1115096939 |
| OutBytes |
integer |
The outbound network throughput, in bytes. |
100000000 |
| ProtectionDuration |
integer |
The protection duration, in hours. |
20 |
| RegionNo |
string |
The ID of the region. |
cn-beijing |
Examples
Success response
JSON format
{
"TotalCount": 132,
"RequestId": "0525EADE-C112-5702-A5BC-0E2F6F94DB23",
"TrafficList": [
{
"TrafficDay": "20231001",
"TrafficType": "EIP_TRAFFIC",
"InstanceId": "i-8vb2d7c9mtn0bo9qcraq",
"ResourceId": "39.106.146.214",
"InstanceType": "EcsPublicIP",
"TotalBytes": 1215096939,
"InBytes": 1115096939,
"OutBytes": 100000000,
"ProtectionDuration": 20,
"RegionNo": "cn-beijing"
}
]
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | ErrorAliUid | The aliuid is invalid. | The aliuid is invalid. |
| 400 | ErrorNotPostpayUser | not Postpay User. | Non-pay-as-you-go Users. |
| 400 | ErrorTimeError | The time is invalid. | The time is invalid. |
| 400 | ErrorPageNo | Either page number or page size is invalid. | Either page number or page size is invalid. |
| 400 | ErrorDBSelectError | A database select error occurred. | The error message returned because an internal error has occurred in querying the database. |
| 400 | ErrorMarshalJSON | internal error. | Internal error. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.