[To be offline] Retrieve accelerated domain traffic usage information - GetUcdnDomainTraffic
Overview
Obtain the usage information of the accelerated domain name
💡 This interface is about to be deprecated, use GetUcdnDomainBandwidthV2 to get domain traffic data.
ℹ️ Note
The traffic usage data is retained for a maximum of 3 months.
Definition
Public Parameters
Parameter Name | Type | Description Information | Required |
---|---|---|---|
Action | string | Corresponding API command name, the current API is GetUcdnDomainTraffic . | Yes |
PublicKey | string | The user's public key can be obtained from Console (opens in a new tab) | Yes |
Signature | string | User signature generated based on public key and API command, see Signature Algorithm | Yes |
Request Parameters
Parameter Name | Type | Description Information | Required |
---|---|---|---|
ProjectId | string | Project ID. If not filled in, the default project is used, sub-accounts must be filled in. Please refer to the GetProjectList interface. | No |
AccountType | string | Specify whether to query by project or by the entire account. The value 'top' means to query by the entire account, and the value 'org' means to query by project. | No |
DomainId.N | string | Domain ID, generated when creating an accelerated domain, n starts from the natural number 0. Default all domains. | No |
Areacode | string | The query traffic area 'cn' represents domestic, 'abroad' represents overseas, the default is all areas. | No |
BeginTime | int | The start date of the query, in Unix Timestamp format. If there is an EndTime, BeginTime must be assigned. | No |
EndTime | int | The end date of the query, formatted as Unix Timestamp. EndTime defaults to the current time, while BeginTime defaults to one day before the current time. | No |
Response Field
Field Name | Type | Description Information | Required |
---|---|---|---|
RetCode | int | Return status code. If it is 0, it means successful return. If it is not 0, it means failure. | Yes |
Action | string | Operation command name. | Yes |
Message | string | Returns an error message, providing detailed description when RetCode is non-zero. | No |
TrafficSet | array[UcdnDomainTrafficSet] | Traffic instance table, see UcdnDomainTrafficSet for specific structure. | No |
Data Model
UcdnDomainTrafficSet
Field Name | Type | Description Information | Required |
---|---|---|---|
Time | int | The time point of traffic acquisition, formatted as Unix Timestamp. | No |
Value | float | Query the total daily traffic, unit: GB | No |
Example
Request Example
http://api.surfercloud.com/?Action=GetUcdnDomainTraffic
&ProjectId=org-xxxxx
&DomainId.0=ucdn-xxx
&BeginTime=1420992000
&EndTime=1421166064
&Areacode=cn
&AccountType=CjFxZeTe
&AccountType=THIOdFPl
Response Example
{
" TrafficSet": [
{
"Time": " 1399305600",
"Value": 10.08
},
{
"Time": " 1399392000",
"Value": 10.08
},
{
"Time": " 1399392000",
"Value": 10.08
}
],
"Action": "GetUcdnDomainTrafficResponse",
"RetCode": 0
}