Querying Bandwidth Data
Function
This API is used to query bandwidth data of a streaming domain name.
URI
GET /v1/{project_id}/stream/bandwidth
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID. For details about how to obtain a project ID, see "Obtaining a Project ID" . |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
domain |
No |
String |
Streaming domain name. If no domain names are specified, the total bandwidth of all domain names in each account is queried. |
|
start_time |
No |
String |
Start time in the format of yyyy-MM-ddTHH:mm:ssZ (UTC time) |
|
end_time |
No |
String |
End time in the format of yyyy-MM-ddTHH:mm:ssZ (UTC time).
|
|
step |
No |
Integer |
Statistical period Unit: minute |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
User token. The token is obtained by calling the IAM API used to obtain a user token. The token is the value of X-Subject-Token in the response header. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
total |
Integer |
Total number of elements in the query result |
|
bandwidth_info |
Array of BandwidthInfo objects |
Bandwidth information |
|
Parameter |
Type |
Description |
|---|---|---|
|
bw_bps |
Integer |
Peak bandwidth, in bit/s |
|
timestamp |
String |
Start time of a sampling period. The value is UTC time in the format of yyyy-MM-ddTHH:mm:ssZ. |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error Code |
|
error_msg |
String |
Error description |
Example Requests
GET https://{endpoint}/v1/{project_id}/stream/bandwidth?domain=play.example.huawei.com
Example Responses
Status code: 200
Bandwidth data queried successfully.
{
"total" : 1,
"bandwidth_info" : [ {
"bw_bps" : 1024,
"timestamp" : "2018-05-19T21:10:15Z"
} ]
}
Status code: 400
Failed to query bandwidth data.
{
"error_code" : "LIVE.100011001",
"error_msg" : "Request Illegal"
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Bandwidth data queried successfully. |
|
400 |
Failed to query bandwidth data. |
Error Codes
See Error Codes.
Last Article: Modifying the Attribute of a Disabled Stream
Next Article: Querying Traffic Data
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.