tencent cloud

Feedback

DescribeTopL7AnalysisData

Last updated: 2024-04-09 10:26:05

    1. API Description

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

    This API is used to query the top-ranked L7 traffic data.

    A maximum of 100 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 Params. The value used for this API: DescribeTopL7AnalysisData.
    Version Yes String Common Params. The value used for this API: 2022-09-01.
    Region No String Common Params. This parameter is not required.
    StartTime Yes Timestamp ISO8601 The start time.
    EndTime Yes Timestamp ISO8601 The end time.
    MetricName Yes String Metrics to query. Valid values:
  • l7Flow_outFlux_country: Query traffic by country/region;
  • l7Flow_outFlux_statusCode: Query traffic by status code;
  • l7Flow_outFlux_domain: Query traffic by domain;
  • l7Flow_outFlux_url: Query traffic by URL;
  • l7Flow_outFlux_resourceType: Query traffic by resource type;
  • l7Flow_outFlux_sip: Query traffic by source IP;
  • l7Flow_outFlux_referers: Query traffic by refer information;
  • l7Flow_outFlux_ua_device: Query traffic by device;
  • l7Flow_outFlux_ua_browser: Query traffic by browser;
  • l7Flow_outFlux_us_os: Query traffic by OS;
  • l7Flow_request_country: Query requests by country/region;
  • l7Flow_request_statusCode: Query requests by status code;
  • l7Flow_request_domain: Query requests by domain;
  • l7Flow_request_url: Query requests by URL;
  • l7Flow_request_resourceType: Query requests by resource type;
  • l7Flow_request_sip: Query requests by source IP;
  • l7Flow_request_referer: Query requests by refer information;
  • l7Flow_request_ua_device: Query requests by device;
  • l7Flow_request_ua_browser: Query requests by browser;
  • l7Flow_request_us_os: Query requests by OS.

  • ZoneIds.N No Array of String ZoneId set. This parameter is required.
    Limit No Integer Queries the top N data entries. Maximum value: 1000. Top 10 data entries will be queried if this field is not specified.
    Filters.N No Array of QueryCondition Filters
  • country
    Filter by the Country/Region. The country/region follows ISO 3166 specification.
  • province
    Filter by the specified province name. It’s only available when Area is mainland.
  • isp
    : Filter by the specified ISP. It’s only available when Area is mainland.
    Values:
    2: CTCC;
    26: CUCC;
    1046: CMCC;
    3947: CTT;
    38: CERNET;
    43: GWBN;
    0: Others.
  • domain
    : Filter by the specified sub-domain name, such as test.example.com
  • url:
    Filter by the specified URL Path (such as /content or content/test.jpg.
    If this parameter is specified, the max query period is the last 30 days.
    The max data query scope stated in the service package specifications of the site (if ZoneIds specified) becomes invalid.
  • referer:
    Filter by the specified Referer header, such as example.com.
    If this parameter is specified, the max query period is the last 30 days.
    The max data query scope stated in the service package specifications of the site (if ZoneIds specified) becomes invalid.
  • resourceType:
    Filter by the specified resource file type, such as jpg, css.
    If this parameter is specified, the max query period is the last 30 days.
    The max data query scope stated in the service package specifications of the site (if ZoneIds specified) becomes invalid.
  • protocol:
    Filter by the specified HTTP protocol version
    Values:
    HTTP/1.0: HTTP 1.0;
    HTTP/1.1: HTTP 1.1;
    HTTP/2.0: HTTP 2.0;
    HTTP/3.0: HTTP 3.0;
    WebSocket: WebSocket.
  • socket:
    Filter by the specified HTTP protocol type
    Values:
    HTTP: HTTP protocol;
    HTTPS: HTTPS protocol;
    QUIC: QUIC protocol.
  • statusCode:
    Filter by the Status Code
    If this parameter is specified, the max query period is the last 30 days.
    The max data query scope stated in the service package specifications of the site (if ZoneIds specified) becomes invalid.
    Values:
    1XX: Status code of type 1xx
    100: 100 status code
    101: 101 status code
    102: 102 status code
    2XX: Status code of type 2xx
    200: 200 status code
    201: 201 status code
    202: 202 status code
    203: 203 status code
    204: 204 status code
    205: 205 status code
    206: 206 status code
    207: 207 status code
    3XX: Status code of type 3xx
    300: 300 status code
    301: 301 status code
    302: 302 status code
    303: 303 status code
    304: 304 status code
    305: 305 status code
    307: 307 status code
    4XX: Status code of type 4xx
    400: 400 status code
    401: 401 status code
    402: 402 status code
    403: 403 status code
    404: 404 status code
    405: 405 status code
    406: 406 status code
    407: 407 status code
    408: 408 status code
    409: 409 status code
    410: 410 status code
    411: 411 status code
    412: 412 status code
    412: 413 Status Code
    414: 414 status code
    415: 415 status code
    416: 416 status code
    417: 417 status code
    422: 422 status code
    423: 423 status code
    424: 424 status code
    426: 426 status code
    451: 451 status code
    5XX: Status code of type 5xx
    500: 500 status code
    501: 501 status code
    502:502 status code
    503: 503 status code
    504: 504 status code
    505: 505 status code
    506: 506 status code
    507: 507 status code
    510: 510 status code
    514: 514 status code
    544: 544 Status Code.
  • browserType:
    Filter by the specified browser type.
    If this parameter is specified, the max query period is the last 30 days.
    The max data query scope stated in the service package specifications of the site (if ZoneIds specified) becomes invalid.

  • Values:
    Firefox: Firefox browser;
    Chrome: Chrome browser;
    Safari: Safari browser;
    MicrosoftEdge: Microsoft Edge browser;
    IE: IE browser;
    Opera: Opera browser;
    QQBrowser: QQ browser;
    LBBrowser: LB browser;
    MaxthonBrowser: Maxthon browser;
    SouGouBrowser: Sogou browser;
    BIDUBrowser: Baidu browser;
    TaoBrowser: Tao browser;
    UBrowser: UC browser;
    Other: Other browsers;
    Empty: The browser type is not specified;
    Bot: Web crawler.
  • deviceType:
    Filter by the device type.
    If this parameter is specified, the max query period is the last 30 days.
    The max data query scope stated in the service package specifications of the site (if ZoneIds specified) becomes invalid.
    Values:
    TV: TV;
    Tablet: Tablet;
    Mobile: Mobile phone;
    Desktop: Desktop device;
    Other: Other device;
    Empty: Device type not specified.
  • operatingSystemType:
    Filter by the operating system.
    If this parameter is specified, the max query period is the last 30 days.
    The max data query scope stated in the service package specifications of the site (if ZoneIds specified) becomes invalid.
    Values:
    Linux: Linux OS;
    MacOS: Mac OS;
    Android: Android OS;
    IOS: iOS OS;
    Windows: Windows OS;
    NetBSD: NetBSD OS;
    ChromiumOS: Chromium OS;
    Bot: Web crawler:
    Other: Other OS;
    Empty: The OS is not specified.
  • tlsVersion:
    Filter by the TLS version.
    If this parameter is specified, the max query period is the last 30 days.
    The max data query scope stated in the service package specifications of the site (if ZoneIds specified) becomes invalid.
    Values:
    TLS1.0: TLS 1.0;
    TLS1.1: TLS 1.1;
    TLS1.2: TLS 1.2;
    TLS1.3: TLS 1.3.
  • ipVersion
    Filter by the specified IP version.
    Values:
    4: IPv4;
    6: IPv6.
  • tagKey
    Filter by the Tag Key.
  • tagValue
    Filter by the Tag Value.
  • Interval No String The query time granularity. Values:
  • min: 1 minute;
  • 5min: 5 minute;
  • hour: 1 hour;
  • day: 1 day.
  • If this field is not specified, the granularity will be determined based on the interval between the start time and end time as follows: 1-minute granularity applies for a 1-hour interval, 5-minute granularity for a 2-day interval, 1-hour granularity for a 7-day interval, and 1-day granularity for an interval of over 7 days.
    Area No String Geolocation scope. Values:
  • overseas: Regions outside the Chinese mainland
  • mainland: Chinese mainland
  • global: Global
  • If this field is not specified, the default value global is used.

    3. Output Parameters

    Parameter Name Type Description
    TotalCount Integer Total number of query results.
    Data Array of TopDataRecord The list of top-ranked L7 traffic data.
    Note: This field may return null, indicating that no valid values can be obtained.
    RequestId String The 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 the Top Traffic Data with the Specified Protocol

    Query L7 data analysis top traffic data.

    Input Example

    POST / HTTP/1.1
    Host: teo.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeTopL7AnalysisData
    <Common request parameters>
    
    {
        "Area": "mainland",
        "Interval": "day",
        "Limit": "1",
        "StartTime": "2022-07-31T00:00:00+08:00",
        "EndTime": "2022-08-29T19:17:59+08:00",
        "MetricName": "l7Flow_outFlux_url",
        "Filters": [
            {
                "Key": "protocol",
                "Operator": "equals",
                "Value": [
                    "HTTP/1.0",
                    "HTTP/1.1"
                ]
            }
        ],
        "ZoneIds": [
            "zone-2mzegj4vln5f"
        ]
    }
    

    Output Example

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

    Example2 Querying the Top Traffic Data with the Specified Tag

    Querying the Top Traffic Data with the Specified Tag

    Input Example

    POST / HTTP/1.1
    Host: teo.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeTopL7AnalysisData
    <Common request parameters>
    
    {
        "Area": "mainland",
        "Interval": "day",
        "Limit": "1",
        "StartTime": "2022-07-31T00:00:00+08:00",
        "EndTime": "2022-08-29T19:17:59+08:00",
        "MetricName": "l7Flow_outFlux_url",
        "Filters": [
            {
                "Key": "tagKey",
                "Operator": "equals",
                "Value": [
                    "test1"
                ]
            },
            {
                "Key": "tagValue",
                "Operator": "equals",
                "Value": [
                    "a.com",
                    "b.com"
                ]
            }
        ],
        "ZoneIds": [
            "zone-2mzegj4vln5f"
        ]
    }
    

    Output Example

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

    Example3 Query L7 data analysis top traffic data.

    Query L7 data analysis top traffic data.

    Input Example

    POST / HTTP/1.1
    Host: teo.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeTopL7AnalysisData
    <Common request parameters>
    
    {
        "Area": "mainland",
        "Interval": "day",
        "Limit": "1",
        "StartTime": "2022-07-31T00:00:00+08:00",
        "EndTime": "2022-08-29T19:17:59+08:00",
        "MetricName": "l7Flow_outFlux_url",
        "ZoneIds": [
            "zone-2mzegj4vln5f"
        ]
    }
    

    Output Example

    {
        "Response": {
            "RequestId": "7c499897-8ad9-4a2d-884e-6154f283d7f6",
            "Data": [
                {
                    "DetailData": [
                        {
                            "Key": "/",
                            "Value": 7410001
                        }
                    ],
                    "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 Code Description
    FailedOperation Operation failed.
    InternalError.ProxyServer An unknown error occurred in the backend server.
    InvalidParameter Parameter error.
    InvalidParameterValue Invalid parameter value.
    LimitExceeded The quota limit has been reached.
    LimitExceeded.QueryTimeLimitExceeded Query time limit exceeded.
    OperationDenied Operation denied.
    ResourceNotFound The resource doesn’t exist.
    ResourceUnavailable The resource is unavailable.
    UnauthorizedOperation.CamUnauthorized CAM is not authorized.
    UnauthorizedOperation.NoPermission The sub-account is not authorized for the operation. Please get permissions first.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support