Queries traffic statistics of an Anti-DDoS Origin instance within a specific time period.

Usage notes

You can call the DescribeTraffic operation to query traffic statistics of an Anti-DDoS Origin instance within a specific time period.

Note When you call this operation, you must configure the InstanceId parameter to specify the Anti-DDoS Origin instance whose traffic statistics you want to query.

Limits

You can call this operation once per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeTraffic

The operation that you want to perform. Set the value to DescribeTraffic.

InstanceId String No ddosbgp-cn-n6w203qg****

The ID of the Anti-DDoS Origin instance to query.

Note You can call the DescribeInstanceList operation to query the IDs of all Anti-DDoS Origin instances.

If you specify an on-demand instance, you must configure the Interval parameter.

Ipnet String No 111.XX.XX.0/24

The Classless Inter-Domain Routing (CIDR) block of the on-demand instance that you want to query.

Ip String No 39.XX.XX.96

The public IP address of the asset to query. If you do not specify this parameter, the traffic statistics of all public IP addresses that are protected by the Anti-DDoS Origin instance are queried.

Note The public IP address must be a protected object of the Anti-DDoS Origin instance. You can call the DescribePackIpList operation to query all protected objects of the Anti-DDoS Origin instance.
StartTime Integer Yes 1619798400

The beginning of the time range to query. The value is a UNIX timestamp. Unit: seconds.

EndTime Integer No 1563445054

The end of the time range to query. The value is a UNIX timestamp. Unit: seconds.

If you do not specify this parameter, the current system time is used as the end time.

Interval Integer No 5

The interval at which the traffic statistics are calculated. Unit: seconds. Default value: 5.

FlowType String No max

The type of the traffic statistics to query. Valid values:

  • max: the peak traffic within the specified interval
  • avg: the average traffic within the specified interval
ResourceGroupId String No rg-acfm2pz25js****

The ID of the resource group to which the Anti-DDoS Origin instance belongs in Resource Management.

If you do not specify this parameter, the instance belongs to the default resource group.

RegionId String No cn-hangzhou

The ID of the region where the Anti-DDoS Origin instance resides.

Note You can call the DescribeRegions operation to query the most recent region list.

All Alibaba Cloud API operations must include common request parameters. For more information about common request parameters, see Common parameters.

For more information about sample requests, see the "Examples" section of this topic.

Response parameters

Parameter Type Example Description
RequestId String 6A507DC8-F657-4C13-84E2-D1D1B9400753

The ID of the request.

FlowList Array of Flow

The queried traffic statistics.

Time Integer 1620951900

The time when the traffic statistics are calculated. This value is a UNIX timestamp. Unit: seconds.

FlowType String max

The type of the traffic statistics. Valid values:

  • max: the peak traffic within the specified interval
  • avg: the average traffic within the specified interval
AttackPps Long 0

The packet forwarding rate of attack traffic. Unit: packets per second.

Note This parameter is returned only if attack traffic exists.
Name String 8e33f19e-5644-11eb-b5c1-d89d67182200

The ID of the traffic statistics.

Pps Integer 274

The packet forwarding rate of the total traffic. Unit: packets per second.

Kbps Integer 417

The bandwidth of the total traffic. Unit: Kbit/s.

AttackBps Long 0

The bandwidth of attack traffic. Unit: bit/s.

Note This parameter is returned only if attack traffic exists.

Examples

Sample requests

http(s)://[Endpoint]/?Action=DescribeTraffic
&StartTime=1619798400
&InstanceId=ddosbgp-cn-n6w203qg****
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<?xml version="1.0" encoding="UTF-8" ?>
<DescribeTrafficResponse>
	<FlowList>
		<Pps>274</Pps>
		<Kbps>417</Kbps>
		<FlowType>max</FlowType>
		<Time>1620890570</Time>
		<Name>8e33f19e-5644-11eb-b5c1-d89d67182200</Name>
	</FlowList>
	<FlowList>
		<Pps>10</Pps>
		<Kbps>62</Kbps>
		<FlowType>max</FlowType>
		<Time>1620951900</Time>
		<Name>8e33f19e-5644-11eb-b5c1-d89d67182200</Name>
	</FlowList>
	<RequestId>3986BADC-F6F7-4874-BF71-E5306BABBE75</RequestId>
</DescribeTrafficResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "FlowList" : [ {
    "Pps" : 274,
    "Kbps" : 417,
    "FlowType" : "max",
    "Time" : 1620890570,
    "Name" : "8e33f19e-5644-11eb-b5c1-d89d67182200"
  }, {
    "Pps" : 10,
    "Kbps" : 62,
    "FlowType" : "max",
    "Time" : 1620951900,
    "Name" : "8e33f19e-5644-11eb-b5c1-d89d67182200"
  } ],
  "RequestId" : "3986BADC-F6F7-4874-BF71-E5306BABBE75"
}

Error codes

For a list of error codes, visit the API Error Center.