[To be taken offline] Obtain domain bandwidth data - GetNewUcdnDomainBandwidth
Overview
Obtain domain bandwidth data
💡 This interface is about to be deprecated, use GetUcdnDomainBandwidthV2 to get domain bandwidth data.
Definition
Public Parameters
Parameter Name | Type | Description Information | Required |
---|---|---|---|
Action | string | Corresponding API command name, the current API is GetNewUcdnDomainBandwidth . | 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, and the sub-account must be filled in. Please refer to the GetProjectList interface. | No |
Type | int | Time granularity (0 represents a granularity of 5 minutes, 1 represents a granularity of 1 hour, 2 represents a granularity of one day) | Yes |
DomainId.N | string | Domain ID, the ID generated when creating a domain. Default to all domains. | No |
Areacode | string | Query bandwidth region 'cn' represents domestic, 'abroad' represents overseas. If not filled, the default is all regions. | No |
BeginTime | int | The start time of the query, formatted as Unix Timestamp. If there is an EndTime, BeginTime must be assigned. If not assigned, a missing parameter error will be returned. If there is no EndTime, BeginTime can also be unassigned. The default EndTime is the current time, and the default BeginTime is the current time of the previous day. | No |
EndTime | int | The end time of the query, in Unix Timestamp format. EndTime defaults to the current time, and BeginTime defaults to the time 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 |
BandwidthList | array[BandwidthInfo] | Bandwidth Information List, see BandwidthInfo | No |
Traffic | float | The total CDN traffic used from the start time to the end time, unit GB. | No |
Data Model
BandwidthInfo
Field Name | Type | Description Information | Required |
---|---|---|---|
Time | int | Time point for bandwidth acquisition. Format: Timestamp | No |
CdnBandwidth | float | The return value is the peak bandwidth of CDN within the specified time interval, in Mbps. If the request parameter Type is 0, then Value is the bandwidth value with a granularity of five minutes. If Type is 1, then Value is the peak bandwidth for 1 hour. If Type is 2, then Value is the peak bandwidth within a day. | No |
Example
Request Example
https://api.surfercloud.com/?Action=GetNewUcdnDomainBandwidth
&ProjectId=org-xxxxx
&DomainId.n=KrgnhdNW
&Areacode=nallEbvw
&BeginTime=1
&EndTime=9
&Type=6
Response Example
{
"Action": "GetNewUcdnDomainBandwidthResponse",
"BandwidthList": [
{
"CdnBandwidth": 7.16981,
"OriginBandwidth": 6.21946,
"Time": 6
},
{
"CdnBandwidth": 9.33524,
"OriginBandwidth": 5.85159,
"Time": 6
},
{
"CdnBandwidth": 5.84444,
"OriginBandwidth": 5.55357,
"Time": 3
}
],
"RetCode": 0,
"Traffic": 8.33753
}