You can call the DescribeDomainsUsageByDay operation to query the monitoring data with a time granularity of one day.

  • If neither the StartTime nor EndTime parameter is set, the data within the last 24 hours is queried.
  • If you set both the StartTime and EndTime parameters, the data within the specified time range is queried.
Note
  • You can query one domain name or all domain names under your account.
  • The maximum time range that you can specify is the last 90 days.

Debugging

Alibaba Cloud provides OpenAPI Explorer to simplify API usage. You can use OpenAPI Explorer to search for APIs, call APIs, and dynamically generate SDK example code.

Request parameters

Parameter Type Required Description
Action String  Yes The operation that you want to perform. Set this parameter to DescribeDomainsUsageByDay.
DomainName String No The domain name that you want to query. You can specify only one domain name. If you do not set this parameter, all domain names under your account are queried.
StartTime String No The beginning of the time range where the data is queried.
  • Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format.
  • The time must be in UTC.
EndTime String No
  • The end of the time range where the data is queried. The end time must be later than the start time.
  • Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format.
  • The time must be in UTC.

Response parameters

Parameter Type Description
RequestId String The ID of the request.
DomainName String The domain name information.
DataInterval String The data sampling interval, which is one day.
StartTime DateTime The beginning of the time range where the data was queried.
EndTime DateTime The end of the time range where the data was queried.
UsageByDays UsageByDay[] The monitoring data retrieved at each data sampling interval.
UsageTotal UsageTotal The summarized monitoring data.

UsageByDay

Parameter Type Description
TimeStamp String The timestamp of the data.
Qps String The queries per second.
BytesHitRate String The byte hit rate.
RequestHitRate String  The request hit rate.
MaxBps String  The peak bandwidth.
MaxBpsTime String The time when the bandwidth reached the peak value.
MaxSrcBps String The peak back-to-origin bandwidth.
MaxSrcBpsTime String  The time when the back-to-origin bandwidth reached the peak value.
TotalAccess String The total amount of queries.
TotalTraffic String  The total amount of network traffic.

UsageTotal

Parameter Type Description
BytesHitRate String The byte hit rate.
RequestHitRate String  The request hit rate.
MaxBps String  The peak bandwidth.
MaxBpsTime String The time when the bandwidth reached the peak value.
MaxSrcBps String The peak back-to-origin bandwidth.
maxSrcBpsTime String  The time when the back-to-origin bandwidth reached the peak value.
TotalAccess String The total amount of queries.
TotalTraffic String  The total amount of network traffic.

Examples

Sample request

http://cdn.aliyuncs.com?Action=DescribeDomainsUsageByDay&DomainName=example.com
&StartTime=2015-11-29T00:00:00Z
&EndTime=2015-11-30T00:00:00Z
&<Common request parameters>

Sample success response

JSON format

{
  "UsageTotal": {
    "RequestHitRate": "69.92610837438424",
    "MaxSrcBpsTime": "2015-12-02 17:20",
    "MaxBps": "1.0747912780000001E8",
    "MaxSrcBps": "2108177.5",
    "TotalTraffic": "1117711832100",
    "TotalAccess": "1319500",
    "MaxBpsTime": "2015-12-02 23:55",
    "BytesHitRate": "97.03110726801242"
  },
  "DataInterval": "86400",
  "UsageByDays": {
    "UsageByDay": [
      {
        "TimeStamp": "2015-12-01",
        "RequestHitRate": "70.24770071912111",
        "MaxSrcBpsTime": "2015-12-01 22:30",
        "MaxSrcBps": "1044521.5000000001",
        "MaxBps": "1.050307709E8",
        "TotalTraffic": "564300099309",
        "TotalAccess": "645093",
        "MaxBpsTime": "2015-12-01 01:20",
        "Qps": "7.466354166666667",
        "BytesHitRate": "97.46250599529726"
      },
      {
        "TimeStamp": "2015-12-02",
        "RequestHitRate": "69.61849446995657",
        "MaxSrcBpsTime": "2015-12-02 17:20",
        "MaxSrcBps": "2108177.5",
        "MaxBps": "1.0747912780000001E8",
        "TotalTraffic": "553411732791",
        "TotalAccess": "674407",
        "MaxBpsTime": "2015-12-02 23:55",
        "Qps": "7.805636574074074",
        "BytesHitRate": "96.59122077803737"
      }
    ]
  },
  "RequestId": "C88EF8ED-72F0-45EA-9E86-95114E224FC5",
  "DomainName": "example.com",
  "EndTime": "2015-12-02T00:00:00Z",
  "StartTime": "2015-12-01T00:00:00Z"
}

Error codes

Error code Error message HTTP status code Description
InvalidStartTime.Malformed Specified StartTime is malformed. 400 The error message returned because the format of the StartTime parameter is invalid.
InvalidEndTime.Malformed Specified EndTime is malformed. 400 The error message returned because the format of the EndTime parameter is invalid.
InvalidStartTime.ValueNotSupported The specified value of parameter StartTime is not supported. 400 The error message returned because the time range specified by the EndTime and StartTime parameters exceeds 90 days.
InvalidDomain.NotFound The domain provided does not exist in our records. 404 The error message returned because the domain name does not exist or does not belong to you.
InvalidEndTime.Mismatch Specified EndTime does not math the specified StartTime. 400 The error message returned because the EndTime is earlier than the StartTime.