You can call the DescribeDomainRealTimeSrcTrafficData operation to query back-to-origin network traffic with a time granularity of one minute. The network traffic is measured in bits.

  • If neither the StartTime nor EndTime parameter is set, the data within the last 24 hours is queried.
  • If you set both the StartTime and EndTime parameters, the data within the specified time range is queried.
Note
  • You can query one or more domains and separate them with commas (,).
  • The maximum time range that you can specify is the last 90 days.

Debugging

Alibaba Cloud provides OpenAPI Explorer to simplify API usage. You can use OpenAPI Explorer to search for APIs, call APIs, and dynamically generate SDK example code.

Request parameters

Parameter Type Required Description
Action String  Yes The operation that you want to perform. Set this parameter to DescribeDomainRealTimeSrcTrafficData.
DomainName String No
  • The domain name. If you do not specify a domain name, all of your domain names are queried.
  • You can specify one or more domain names.
  • Separate multiple domain names with commas (,).
StartTime String No The beginning of the time range where the data is queried.
  • Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format.
  • The time must be in UTC.
  • If you do not set this parameter, the data within the last hour is queried.
EndTime String No
  • The end of the time range where the data is queried. The end time must be later than the start time.
  • Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format.
  • The time must be in UTC.

Response parameters

Parameter Type Description
DomainName String The domain name information.
DataInterval String The data sampling interval. Unit: seconds.
StartTime DateTime The beginning of the time range where the data was queried.
EndTime DateTime The end of the time range where the data was queried.
RealTimeSrcTrafficDataPerInterval UsageData[] The back-to-origin network traffic retrieved at each sampling interval.

UsageData

Name Type Description
TimeStamp String The timestamp of the data.
Value String The detailed back-to-origin network traffic information.

Examples

Sample request

http://cdn.aliyuncs.com?Action=DescribeDomainRealTimeSrcTrafficData&DomainName=example.com
&StartTime=2015-12-10T20:00:00Z
&EndTime=2015-12-10T20:01:00Z
&<Common request parameters>

Sample success response

JSON format

{
    "DomainName": "example.com",
    "DataInterval": "60",
    "RealTimeSrcTrafficDataPerInterval": {
        "DataModule": [
            {
                "TimeStamp": "2015-12-10T20:00:00Z",
                "Value": "0"
            },
            {
                "TimeStamp": "2015-12-10T20:01:00Z",
                "Value": "0"
            }
        ]
    },
    "RequestId": "A666D44F-19D6-490E-97CF-1A64AB962C57",
    "StartTime": "2015-12-10T20:00:00Z",
    "EndTime": "2015-12-10T20:01:00Z"
}
			

Error codes

Error code Error message HTTP status code Description
Throttling Request was denied due to request throttling. 503 The error message returned because the request is denied due to network traffic throttling.
IllegalOperation Illegal domain, operation is not permitted. 403 The error message returned because the domain name is invalid.
OperationDenied Your account does not open CDN service yet. 403 The error message returned because the CDN service is not activated.
OperationDenied Your CDN service is suspended. 403 The error message returned because the CDN service is suspended.
InvalidDomain.NotFound The domain provided does not belong to you. 404 The error message returned because the domain name does not exist or does not belong to you.
InvalidDomain.Offline The domain provided is offline. 404 The error message returned because the domain name is disabled.
ServiceBusy The specified Domain is configuring, please retry later. 403 The error message returned because the domain name is being configured. Please try again later.
InvalidDomain.Configure_failed Failed to configure the provided domain. 500 The error message returned because the domain name configuration fails.
MissingParameter StartTime and EndTime can not be single. 400 The error message returned because you must set both the StartTime and EndTime parameters.
InvalidStartTime.Malformed Specified start time is malformed. 400 The error message returned because the format of the StartTime parameter is invalid.
InvalidEndTime.Malformed Specified end time is malformed. 400 The error message returned because the format of the EndTime parameter is invalid.
InvalidEndTime.Mismatch Specified end time does not math the specified start time. 400 The error message returned because the EndTime is earlier than the StartTime.
InvalidStartTime.ValueNotSupported Specified end time does not math the specified start time. 400 The error message returned because the time range specified by the StartTime and EndTime parameters exceeds 90 days.