CDN Monitoring API

Last updated: 2020-05-14 17:05:44

    1. API Description

    API: GetMonitorData
    API domain name: monitor.tencentcloudapi.com

    This API is used to get the monitoring data of a Tencent Cloud product by passing in the product's namespace, object dimension, and monitoring metric.

    API call rate limit: 20 calls/second (1,200 calls/minute). A single request can get the data of up to 10 instances and up to 1,440 data points.

    This API may fail due to the rate limit if you need to call a lot of metrics and objects. We recommend that you spread the call requests over time.

    To query the monitoring data of a CDN instance, use the following input parameter values:
    &Namespace= QCE/CDN
    &Instances.N.Dimensions.0.Name=projectId
    &Instances.N.Dimensions.0.Value=project ID
    &Instances.N.Dimensions.1.Name=domain
    &Instances.N.Dimensions.1.Value=domain name

    2. Input Parameters

    The list below contains only API request parameters and certain common parameters. Common request parameters need to be added when a call is made. For more information, please see Common Params.

    2.1. Input parameters

    2.1.1. Overview of input parameters

    Parameter Name Required Type Description
    Action Yes String Common parameter. Value for this API: GetMonitorData
    Version Yes String Common parameter. Value for this API: 2018-07-24
    Region No String Common parameter, indicating the region of the instance whose monitoring data is queried. For supported regions, please see the region list supported by CVM
    Namespace Yes String Namespace. Each Tencent Cloud product has a namespace such as QCE/CDN, which must be capitalized for API 3.0
    MetricName Yes String Metric name. For more information, please see section 2.2
    Instances.N Yes Array of Instance Combination of instance object dimensions
    Period No Integer Statistical period for monitoring data in seconds. Default value: 300
    StartTime No Datetime Start time, such as "2016-01-01 10:25:00". Default value: "00:00:00" on the current day
    EndTime No Timestamp End time, which is the current time by default. endTime cannot be earlier than startTime

    2.1.2. Overview of parameters in each dimension

    Parameter Name Dimension Name Dimension Description Format
    Instances.N.Dimensions.0.Name projectId Project String-type dimension name: projectId
    Instances.N.Dimensions.0.Value projectId Project Specific project ID, such as 1
    Instances.N.Dimensions.0.Name domain Domain name String-type dimension name: domain
    Instances.N.Dimensions.0.Value domain Domain name Specific domain name, such as www.qq.com

    2.2. Metric name

    The statistical granularity (Period) and dimension (dimension) vary by metric. The DescribeBaseMetrics API can be used to get the periods and dimensions supported by each metric.

    Metric Name Description Unit
    Bandwidth Bandwidth Mbps
    Requests Requests Count

    3. Output Parameters

    Parameter Name Type Description
    MetricName String Monitoring metric
    StartTime Timestamp Data point start time
    EndTime Timestamp Data point end time
    Period Integer Statistical period
    DataPoints Array of PointsObject Monitoring data list
    RequestId String Unique request ID. Each request returns a unique ID. The RequestId is required to troubleshoot issues

    4. Error Codes

    Error Code Error Description Error Message
    -502 The resource does not exist OperationDenied.SourceNotExists
    -503 Incorrect request parameter InvalidParameter
    -505 Missing parameter InvalidParameter.MissingParameter
    -507 Limit exceeded OperationDenied.ExceedLimit
    -509 Incorrect dimension combination InvalidParameter.DimensionGroupError
    -513 Database operation failed InternalError.DBoperationFail

    5. Samples

    Sample 1

    This example shows you how to get the bandwidth monitoring data of one CDN instance at 60-second statistical period during a certain period of time.

    Input sample code

    https://monitor.tencentcloudapi.com/?Action=GetMonitorData
    &Namespace= QCE/CDN
    &MetricName=Bandwidth
    &Period=60
    &StartTime=2019-05-08T16:40:00+08:00
    &EndTime=2018-05-08T16:45:00+08:00
    &Instances.0.Dimensions.0.Name=projectId
    &Instances.0.Dimensions.0.Value=0
    &Instances.0.Dimensions.1.Name=domain
    &Instances.0.Dimensions.1.Value=www.tencent.com
    &<Common request parameters>

    Output sample code

    {
      "Response": {
        "StartTime": "2019-06-04 00:00:00",
        "EndTime": "2019-06-04 00:05:00",
        "Period": 60,
        "MetricName": "Bandwidth",
        "DataPoints": [
          {
            "Dimensions": [
              {
                "Name": "domain",
                "Value": "www.tencent.com"
              },
              {
                "Name": "projectId",
                "Value": "0"
              }
            ],
            "Timestamps": [
              1559577600,
              1559577660,
              1559577720,
              1559577780,
              1559577840,
              1559577900
            ],
            "Values": [
              0.024,
              0.022,
              0.027,
              0.024,
              0.025,
              0.025
            ]
          }
        ],
        "RequestId": "c36ea090-ebd9-4176-a88f-f88d6795e4f2"
      }
    }

    Sample 2

    This example shows you how to get the bandwidth monitoring data of multiple CDN instances at 60-second statistical period during a certain period of time.

    Input sample code

    https://monitor.tencentcloudapi.com/?Action=GetMonitorData
    &Namespace=QCE/CDN
    &MetricName=Bandwidth
    &Period=60
    &StartTime=2019-05-08T16:40:00+08:00
    &EndTime=2018-05-08T16:45:00+08:00
    &Instances.0.Dimensions.0.Name=projectId
    &Instances.0.Dimensions.0.Value=0
    &Instances.0.Dimensions.1.Name=domain
    &Instances.0.Dimensions.1.Value=www.tencent.com
    &Instances.1.Dimensions.0.Name=projectId
    &Instances.1.Dimensions.0.Value=0
    &Instances.1.Dimensions.1.Name=domain
    &Instances.1.Dimensions.1.Value=www.qcloud.com
    &<Common request parameters>

    Output sample code

    {
      "Response": {
        "StartTime": "2019-06-04 00:00:00",
        "EndTime": "2019-06-04 00:05:00",
        "Period": 60,
        "MetricName": "Bandwidth",
        "DataPoints": [
          {
            "Dimensions": [
              {
                "Name": "domain",
                "Value": "www.tencent.com"
              },
              {
                "Name": "projectId",
                "Value": "0"
              }
            ],
            "Timestamps": [
              1559577600,
              1559577660,
              1559577720,
              1559577780,
              1559577840,
              1559577900
            ],
            "Values": [
              0.024,
              0.022,
              0.027,
              0.024,
              0.025,
              0.025
            ]
          },
          {
            "Dimensions": [
              {
                "Name": "domain",
                "Value": "www.qcloud.com"
              },
              {
                "Name": "projectId",
                "Value": "0"
              }
            ],
            "Timestamps": [
              1559577600,
              1559577660,
              1559577720,
              1559577780,
              1559577840,
              1559577900
            ],
            "Values": [
              0.024,
              0.022,
              0.027,
              0.024,
              0.025,
              0.025
            ]
          }
        ],
        "RequestId": "c36ea090-ebd9-4176-a88f-f88d6795e4f2"
      }
    }

    Was this page helpful?

    Was this page helpful?

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