All Products
Search
Document Center

Cloud Firewall:DescribePostpayTrafficDetail

Last Updated:Dec 13, 2024

Queries the details of traffic billed based on the pay-as-you-go billing method.

Operation description

If you use Cloud Firewall that uses the pay-as-you-go billing method, you can call this operation to query traffic details accurate to the granularity of specific resource instances. If you use Cloud Firewall that uses the subscription billing method, you can call this operation to query the overall traffic details.

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:
    • 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
yundun-cloudfirewall:DescribePostpayTrafficDetailget
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
LangstringNo

The language of the content within the request and response. Valid values:

  • zh (default): Chinese
  • en: English
zh
PageSizelongNo

The number of entries per page. Default value: 10. Maximum value: 50.

10
CurrentPagelongNo

The page number. Default value: 1.

1
StartTimestringYes

The beginning of the time range to query. Specify a value in the YYYYMMDD format.

20230101
EndTimestringYes

The end of the time range to query. Specify a value in the YYYYMMDD format.

20230130
SearchItemstringNo

The instance ID or the IP address of the asset.

192.0.XX.XX
TrafficTypestringYes

The traffic type. This parameter is required. Valid values:

  • EIP_TRAFFIC: traffic for the Internet firewall.
  • NatGateway_TRAFFIC: traffic for NAT firewalls.
  • VPC_TRAFFIC: traffic for virtual private cloud (VPC) firewalls.
EIP_TRAFFIC
OrderstringNo

The field based on which you want to sort the query results. Valid values:

  • resourceId
  • trafficDay
resourceId
RegionNostringNo

The region ID.

cn-beijing

Response parameters

ParameterTypeDescriptionExample
object
TotalCountinteger

The total number of entries returned.

132
RequestIdstring

The ID of the request.

0525EADE-C112-5702-A5BC-0E2F6F94DB23
TrafficListarray<object>

The statistics on traffic.

Dataobject
TrafficDaystring

The date on which the statistics are collected.

20231001
TrafficTypestring

The traffic type. Valid values:

  • EIP_TRAFFIC: traffic for the Internet firewall
  • NatGateway_TRAFFIC: traffic for NAT firewalls
  • VPC_TRAFFIC: traffic for VPC firewalls
EIP_TRAFFIC
InstanceIdstring

The instance ID of the asset.

i-8vb2d7c9mtn0bo9qcraq
ResourceIdstring

The resource ID. The resource ID for the Internet firewall is the public IP address that is protected the Internet firewall, and the resource ID for a NAT firewall is the instance ID of the NAT firewall.

39.106.146.214
InstanceTypestring

The asset type. This value takes effect only for the Internet firewall.

EcsPublicIP
TotalByteslong

The total inbound and outbound network throughput, which indicates the total number of bytes that are received and sent. Unit: bytes.

1215096939
InByteslong

The inbound network throughput, which indicates the total number of bytes that are received Unit: bytes.

1115096939
OutByteslong

The outbound network throughput, which indicates the total number of bytes that are sent. Unit: bytes.

100000000
ProtectionDurationlong

Protection duration. Unit: hours.

20
RegionNostring

The region ID.

cn-beijing

Examples

Sample success responses

JSONformat

{
  "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 codeError codeError messageDescription
400ErrorAliUidThe aliuid is invalid.The aliuid is invalid.
400ErrorNotPostpayUsernot Postpay User.Non-pay-as-you-go Users.
400ErrorTimeErrorThe time is invalid.The time is invalid.
400ErrorPageNoEither page number or page size is invalid.Either page number or page size is invalid.
400ErrorDBSelectErrorA database select error occurred.The error message returned because an internal error has occurred in querying the database.
400ErrorMarshalJSONinternal error.Internal error.

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

Change history

Change timeSummary of changesOperation
2024-09-24The Error code has changed. The request parameters of the API has changed. The response structure of the API has changedView Change Details
2024-08-29API Description Update. The Error code has changed. The response structure of the API has changedView Change Details
2024-08-08The response structure of the API has changedView Change Details