DescribeEcdnStatistics

Last updated: 2020-07-31 11:15:00

1. API Description

Domain name for API request: ecdn.tencentcloudapi.com.

This API is used to query ECDN real-time access monitoring data and supports the following metrics:

  • Traffic (in bytes)
  • Bandwidth (in bps)
  • Number of requests
  • Response time (in ms)
  • Number of 2xx status codes and details of status codes starting with 2
  • Number of 3xx status codes and details of status codes starting with 3
  • Number of 4xx status codes and details of status codes starting with 4
  • Number of 5xx status codes and details of status codes starting with 5

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common parameter. The value used for this API: DescribeEcdnStatistics.
Version Yes String Common parameter. The value used for this API: 2019-10-12.
Region No String Common parameter. This parameter is not required for this API.
StartTime Yes Timestamp Query start time, such as 2019-12-13 00:00:00
EndTime Yes Timestamp Query end time, such as 2019-12-13 23:59:59
Metrics.N Yes Array of String Specifies the query metric, which can be:
flux: traffic in bytes
bandwidth: bandwidth in bps
request: number of requests
delay: response time in ms
2xx: returns the number of 2xx status codes or details of status codes starting with 2
3xx: returns the number of 3xx status codes or details of status codes starting with 3
4xx: returns the number of 4xx status codes or details of status codes starting with 4
5xx: returns the number of 5xx status codes or details of status codes starting with 5
static_request: number of static requests
static_flux: static traffic in bytes
static_bandwidth: static bandwidth in bps
dynamic_request: number of dynamic requests
dynamic_flux: dynamic traffic in bytes
dynamic_bandwidth: dynamic bandwidth in bps
Interval Yes Integer Time granularity, which can be:
1 day 1, 5, 15, 30, 60, 120, 240, 1440
2-3 days 15, 30, 60, 120, 240, 1440
4-7 days 30, 60, 120, 240, 1440
8-90 days 60, 120, 240, 1440
Domains.N No Array of String Specifies the list of domain names to be queried

Up to 30 acceleration domain names can be queried at a time.
Projects.N No Array of Integer Specifies the project ID to be queried, which can be viewed here
If no domain name is entered, the specified project will be queried; otherwise, the domain name will prevail

3. Output Parameters

Parameter Name Type Description
Data Array of ResourceData Returned data details of the specified conditional query
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Querying access data

Input Example

https://ecdn.tencentcloudapi.com/?Action=DescribeEcdnStatistics
&StartTime=2018-09-04 00:00:00
&EndTime=2018-09-04 12:00:00
&Metrics.0=flux
&Interval=60
&Domains.0=www.test.com
&Project=0
&<Common request parameters>

Output Example

{
  "Response": {
    "RequestId": "13d41d37-546f-42ed-a3b9-ff82a51ecd0a",
    "Data": [
      {
        "Resource": "www.test.com",
        "EcdnData": [
          {
            "Metric": [
              "flux",
              "request"
            ],
            "DetailData": [
              {
                "Time": "2019-12-13 00:00:00",
                "Value": [
                  10,
                  20
                ]
              },
              {
                "Time": "2019-12-13 00:05:00",
                "Value": [
                  20,
                  30
                ]
              }
            ]
          }
        ]
      }
    ]
  }
}

5. Developer Resources

API Explorer

This tool allows online call, signature authentication, SDK code generation and quick search of APIs to greatly improve the efficiency of using TencentCloud APIs.

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
InternalError.EcdnDbError Internal data error. Please submit a ticket for troubleshooting.
InternalError.EcdnSystemError System error. Please submit a ticket for troubleshooting.
InvalidParameter.EcdnInvalidParamInterval Invalid statistical granularity. Please see the sample statistical analysis in the documentation.
InvalidParameter.EcdnParamError Parameter error. Please see the sample parameters in the documentation.
InvalidParameter.EcdnStatInvalidDate Invalid date. Please see the sample date in the documentation.
InvalidParameter.EcdnStatInvalidMetric Invalid statistical type. Please see the sample statistical analysis in the documentation.
ResourceNotFound.EcdnDomainNotExists This domain name does not exist under the account. Please check and try again.
ResourceNotFound.EcdnHostNotExists This domain name does not exist under the account. Please check and try again.
ResourceNotFound.EcdnProjectNotExists The project does not exist.
ResourceNotFound.EcdnUserNotExists The ECDN service has not been activated. Please activate it first before using this API.
UnauthorizedOperation.EcdnAccountUnauthorized The sub-account is unauthorized to query full data.
UnauthorizedOperation.EcdnCamUnauthorized No CAM policy is configured for the sub-account.
UnauthorizedOperation.EcdnHostUnauthorized The acceleration domain name is not authorized for the ECDN sub-account.
UnauthorizedOperation.EcdnNoDomainUnauthorized The sub-account does not have the permission to access the domain name. Please try again after authorization.
UnauthorizedOperation.EcdnProjectUnauthorized The project is not authorized for the sub-account.

Was this page helpful?

Was this page helpful?

  • Not at all
  • Not very helpful
  • Somewhat helpful
  • Very helpful
  • Extremely helpful
Send Feedback
Help