DescribeTopFunctionAnalysisData

1. API Description

Domain name for API request: teo.intl.tencentcloudapi.com.

This API is used to query the topN data of Edge Functions by a specified dimension. Note that the data returned by this API has a delay of about 10 minutes. We recommend that you query the data generated at least 10 minutes before the current time.

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 NameRequiredTypeDescription
ActionYesStringCommon Params. The value used for this API: DescribeTopFunctionAnalysisData.
VersionYesStringCommon Params. The value used for this API: 2022-09-01.
RegionNoStringCommon Params. This parameter is not required.
ZoneIds.NYesArray of String

Set of site IDs. Enter at least one site ID.

StartTimeYesTimestamp ISO8601

Start time.

EndTimeYesTimestamp ISO8601End time. The query time range (EndTime - StartTime) must be no longer than 7 days.
MetricNameYesStringThe metric to query. Valid values:
  • function_requestCount_functionResult: counts Edge Function requests by the dimension of execution result.
  • function_requestCount_functionName: counts Edge Function requests by the dimension of function name.
  • function_requestCount_domain: counts Edge Function requests by the dimension of domain name.
LimitNoInteger

Number of top data entries to query. The maximum value is 1000. If not specified, the default value is 10, indicating that the top 10 data entries are queried.

Filters.NNoArray of QueryConditionFilter conditions. The maximum number of values in Filters.Value is 20. The detailed filter condition keys are as follows:
  • domain: filters by subdomain name. Example value: www.example.com.
  • function-name: filters by Edge Function name. Example value: test051301-zone-2r2fdoxxxx-130000000.
  • function-result: filters by Edge Function execution result. Valid values for the corresponding Value:
    • success: success.
    • fail: failure.
IntervalNoStringQuery time granularity. Valid values:
  • min: 1 minute.
  • 5min: 5 minutes.
  • hour: 1 hour.
  • day: 1 day.
If this parameter is not specified, the granularity is automatically inferred based on the interval between the start time and the end time. The specific rules are as follows: within 2 hours, the granularity is min; within 2 days, the granularity is 5min; within 7 days, the granularity is hour; longer than 7 days, the granularity is day.
AreaNoStringThe region the data belongs to. Valid values:
  • overseas: data from the global area (excluding the Chinese mainland).
  • mainland: data from the Chinese mainland.
  • global: global data.
If this parameter is not specified, the default value is global.

3. Output Parameters

Parameter NameTypeDescription
TotalCountInteger

Total number of query results.

DataArray of TopDataRecord

List of topN data by the statistical dimension specified by MetricName.

RequestIdStringThe unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Querying Top Function Name Request Count Data for a Specified Domain

Input Example

POST / HTTP/1.1
Host: teo.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeTopFunctionAnalysisData
<Common request parameters>

{
    "ZoneIds": [
        "zone-2mzegj4vln5f"
    ],
    "StartTime": "2022-07-31T00:00:00+08:00",
    "EndTime": "2022-08-29T19:17:59+08:00",
    "MetricName": "function_requestCount_functionName",
    "Area": "mainland",
    "Interval": "day",
    "Limit": "1",
    "Filters": [
        {
            "Key": "domain",
            "Operator": "equals",
            "Value": [
                "www.baidu.com"
            ]
        }
    ]
}

Output Example

{
    "Response": {
        "RequestId": "7c499897-8ad9-4a2d-884e-6154f283d723",
        "Data": [
            {
                "DetailData": [
                    {
                        "Key": "test051301-zone-2mzegj4vln5f-13000000",
                        "Value": 1210001
                    }
                ],
                "TypeKey": "251227260"
            }
        ],
        "TotalCount": 1
    }
}

5. Developer Resources

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 CodeDescription
FailedOperationOperation failed.
InternalError.ProxyServerUnknown error occurs on the real server.
InvalidParameterParameter error.
InvalidParameterValueParameter value error.
LimitExceededThe quota limit is exceeded.
LimitExceeded.QueryTimeLimitExceededQuery time range exceeds the limit.
OperationDeniedOperation denied.
ResourceNotFoundThe resource does not exist.
ResourceUnavailableResources are unavailable.
UnauthorizedOperation.CamUnauthorizedUnauthorized Cam operation.
UnauthorizedOperation.NoPermissionThe sub-account does not have operation permissions. Add the required permissions and try again.