Downloads the summary information of SQL queries that meet specific conditions in an AnalyticDB for MySQL cluster.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DownloadDiagnosisRecords

The operation that you want to perform. Set the value to DownloadDiagnosisRecords.

DBClusterId String Yes am-****************

The ID of the cluster.

Note You can call the DescribeDBClusters operation to query detailed information of all AnalyticDB for MySQL clusters within a specific region, including cluster IDs.
StartTime String Yes 1625220210000

The beginning of the time range to query. Specify the time in the UNIX timestamp format. Unit: milliseconds.

Note You can view only data from the last 14 days.
EndTime String Yes 1625220213000

The end of the time range to query. Specify the time in the UNIX timestamp format. Unit: milliseconds.

Note
  • The end time must be later than the start time.
  • The interval between the start time and the end time cannot exceed 24 hours.
RegionId String No cn-hangzhou

The region ID of the cluster.

Note You can call the DescribeRegions operation to query the regions and zones supported by AnalyticDB for MySQL, including the region IDs.
QueryCondition String Yes {"Type":"status","Value":"finished"}

The SQL query condition, which can be a combination of the Type and Value fields or a combination of the Type, Min, and Max fields. Specify the condition in the JSON format. Type specifies the SQL query dimension. Valid values for Type: maxCost, status, and cost. Value, Min, or Max specifies the SQL query range for the dimension. Valid values:

  • {"Type":"maxCost","Value":"100"}: specifies to filter out the top 100 most time-consuming SQL queries. Value can be set only to 100.
  • {"Type":"status","Value":"finished"}: specifies to filter out executed SQL queries. You can set Value to running or failed to filter out SQL queries that are being executed or failed to be executed.
  • {"Type":"cost","Min":"10","Max":"200"}: specifies to filter out SQL queries whose execution durations are between 10 and 200. Unit: milliseconds. You can also customize the maximum and minimum execution durations.
Keyword String No select

The keyword for the SQL query.

MinPeakMemory Long No 88000000

The minimum peak memory of the SQL query . Unit: byte.

MaxPeakMemory Long No 88000000

The maximum peak memory of the SQL query. Unit: byte.

MinScanSize Long No 100000000

The minimum scan size of the SQL query. Unit: byte.

MaxScanSize Long No 110000000

The maximum scan size of the SQL query. Unit: byte.

ResourceGroup String No user_default

The resource group to which the SQL query belongs.

Note You can call the DescribeDiagnosisDimensions operation to query the resource group, database name, username, and source IP address that are associated with the SQL query.
UserName String No test_user

The name of the user who executes the SQL query.

Note You can call the DescribeDiagnosisDimensions operation to query the resource group, database name, username, and source IP address that are associated with the SQL query.
Database String No adb_demo

The name of the database on which the SQL query is executed.

Note You can call the DescribeDiagnosisDimensions operation to query the resource group, database name, username, and source IP address that are associated with the SQL query.
ClientIp String No 106.11.***.***

The source IP address.

Note You can call the DescribeDiagnosisDimensions operation to query the resource group, database name, username, and source IP address that are associated with the SQL query.
Lang String No zh

The languages available for file titles and some error messages. Default value: zh. Valid values:

  • zh: Simplified Chinese
  • en: English
  • ja: Japanese
  • zh-tw: Traditional Chinese

Response parameters

Parameter Type Example Description
DownloadId Integer 68

The ID of the download task.

RequestId String D4ACF4E0-2952-3A87-9A2C-474058******

The ID of the request.

Examples

Sample requests

http(s)://adb.aliyuncs.com/?Action=DownloadDiagnosisRecords
&DBClusterId=am-****************
&StartTime=1625220210000
&EndTime=1625220213000
&QueryCondition={"Type":"status","Value":"finished"}
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DownloadDiagnosisRecordsResponse>
    <RequestId>D4ACF4E0-2952-3A87-9A2C-474058******</RequestId>
    <DownloadId>68</DownloadId>
</DownloadDiagnosisRecordsResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "D4ACF4E0-2952-3A87-9A2C-474058******",
  "DownloadId" : 68
}

Error codes

For a list of error codes, visit the API Error Center.