DescribeSqlPatternCompareReports
Queries the list of SQL Pattern comparison reports.
Operation description
Queries the SQL Pattern comparison reports created by the current Alibaba Cloud account for a specified instance. RAM users can query reports that belong to their parent Alibaba Cloud account.
The following pagination methods are supported:
Page number-based pagination (recommended): Use
PageNumberandPageSize.Token-based pagination: Use
MaxResultsandNextToken.
The two pagination methods cannot be used together. When you use page number-based pagination, the
MaxResultsparameter that is automatically included by the platform does not take effect.The list returns only unexpired reports in the
PENDING,RUNNING, orSUCCESSstate.Use
DetailEnabledto determine whether report details can be queried. UseCancelAvailableto determine whether a report can be canceled.Reports are valid for 7 days and are isolated by instance and Alibaba Cloud account.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID of the instance. |
cn-beijing |
| DBClusterId |
string |
Yes |
The ID of the AnalyticDB for MySQL instance. |
am-2ze1234567890**** |
| PageNumber |
integer |
No |
The page number. Pages start from 1. Default value: 1. Note
Use this parameter together with |
2 |
| PageSize |
integer |
No |
The number of rows per page. Valid values: 1 to 100. Default value: 50. Note
Use this parameter together with |
50 |
| MaxResults |
integer |
No |
The number of rows per page for token-based pagination. Valid values: 1 to 100. Default value: 50. Note
|
50 |
| NextToken |
string |
No |
The token for the next page. Note
|
djE6Mjo1MA |
| Order |
string |
No |
Sorts the query results by a specified field. The value is a JSON array string, for example,
Note
If you do not specify this parameter, the results are sorted by |
[{"Field":"CreatedAt","Type":"Desc"}] |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The paging results of the report list. |
||
| Items |
array<object> |
The list of reports on the current page. An empty array is returned if no reports match the conditions. |
|
|
object |
A single SQL Pattern comparison report. |
||
| CancelAvailable |
boolean |
Indicates whether the report can be canceled. The value is true when the report is in the PENDING or RUNNING state. |
false |
| CompareEndTime |
string |
The end time of time range 2. The time is in the yyyy-MM-ddTHH:mmZ UTC format. |
2026-09-08T01:00Z |
| CompareStartTime |
string |
The start time of time range 2. The time is in the yyyy-MM-ddTHH:mmZ UTC format. |
2026-09-08T00:00Z |
| CreatedAt |
string |
The time when the report was created. The time is in the yyyy-MM-ddTHH:mmZ UTC format. |
2026-09-08T01:05Z |
| DetailEnabled |
boolean |
Indicates whether report details can be queried. The value is true when the report is in the SUCCESS state. |
true |
| EndTime |
string |
The end time of time range 1. The time is in the yyyy-MM-ddTHH:mmZ UTC format. |
2026-09-07T01:00Z |
| ReportId |
integer |
The ID of the SQL Pattern comparison report. |
1001 |
| ReportType |
string |
The report type. Valid values:
Valid values:
|
CHANGED |
| ReportTypeName |
string |
The name of the report type. |
Changed Pattern Comparison Report |
| RowNumber |
integer |
The sequence number in the current sorted result. The value starts from 1. |
1 |
| StartTime |
string |
The start time of time range 1. The time is in the yyyy-MM-ddTHH:mmZ UTC format. |
2026-09-07T00:00Z |
| Status |
string |
The report status. Valid values:
Note
The current list returns only reports in the Valid values:
|
SUCCESS |
| MaxResults |
integer |
The number of rows per page used in this query. |
50 |
| NextToken |
string |
The token for the next page. An empty value indicates that no more pages are available. |
djE6Mjo1MA |
| PageNumber |
integer |
The page number used in this query. Pages start from 1. |
2 |
| PageSize |
integer |
The number of rows per page used in this query. |
50 |
| RequestId |
string |
The request ID. |
9A1B2C3D-4E5F-6789-ABCD-0123456789AB |
| TotalCount |
integer |
The total number of reports that match the conditions. |
51 |
Examples
Success response
JSON format
{
"Items": [
{
"CancelAvailable": false,
"CompareEndTime": "2026-09-08T01:00Z",
"CompareStartTime": "2026-09-08T00:00Z",
"CreatedAt": "2026-09-08T01:05Z",
"DetailEnabled": true,
"EndTime": "2026-09-07T01:00Z",
"ReportId": 1001,
"ReportType": "CHANGED",
"ReportTypeName": "变化 Pattern 对比报告",
"RowNumber": 1,
"StartTime": "2026-09-07T00:00Z",
"Status": "SUCCESS"
}
],
"MaxResults": 50,
"NextToken": "djE6Mjo1MA",
"PageNumber": 2,
"PageSize": 50,
"RequestId": "9A1B2C3D-4E5F-6789-ABCD-0123456789AB",
"TotalCount": 51
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | IdempotentParameterMismatch | The request uses the same client token as a previous, but non-identical request. Do not reuse a client token with different requests, unless the requests are identical. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.