Updated on 2024-06-07 GMT+08:00

Querying Slow Query Log Files (SQL Server)

Function

This API is used to query slow query log files.

  • Before calling an API, you need to understand the API in Authentication.

Constraints

This API is supported only for Microsoft SQL Server.

URI

  • URI format

    GET /v3/{project_id}/instances/{instance_id}/slowlog-files

  • Parameter description
    Table 1 Parameter description

    Name

    Mandatory

    Description

    project_id

    Yes

    Project ID of a tenant in a region.

    For details about how to obtain the project ID, see Obtaining a Project ID.

    instance_id

    Yes

    ID of the instance to be queried.

    offset

    No

    Index offset.

    If offset is set to N, the resource query starts from the N+1 piece of data. The value is 0 by default, indicating that the query starts from the first piece of data. The value cannot be a negative number.

    limit

    No

    Number of records on each page. Its value range is from 1 to 100. The parameter value is 10 by default if it is not specified.

Request

  • Request parameters

    None

  • URI example

    GET https://{endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/instances/cee5265e1e5845649e354841234567dfin01/slowlog-files

Response

  • Normal response
    Table 2 Parameter description

    Name

    Type

    Description

    list

    Array of objects

    Slow log file information. For details, see Table 3.

    total_count

    Integer

    Total number of files.

    Table 3 SlowLogFile field data structure description

    Name

    Type

    Description

    file_name

    String

    File name.

    file_size

    String

    File size in bytes.

  • Example normal response
    {
      "total_count" : 1,
      "list" : [ {
        "file_name" : "SQLTrace.trc",
        "file_size" : "1024"
      } ]
    }
  • Abnormal response

    For details, see Abnormal Request Results.

Status Code

Error Code

For details, see Error Codes.