Asynchronously queries the MySQL error codes in SQL Explorer data and the number of SQL templates corresponding to each error code.

Note The complete query results are not returned immediately after an asynchronous call is made. If the value of isFinish is false in the response, wait for 1 second and then re-initiate the call. The complete query results are returned until the value of isFinish is true.
  • This API operation supports only ApsaraDB RDS for MySQL instances and PolarDB for MySQL clusters for which DAS Professional Edition is enabled. For more information, see Purchase DAS Professional Edition.
  • If you use an SDK to call Database Autonomy Service (DAS), you must set the region to cn-shanghai.

Request parameters

Parameter Type Required Example Description
Action String Yes GetAsyncErrorRequestStatByCode

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

InstanceId String Yes rm-2ze8g2am97624****

The instance ID.

NodeId String No pi-wz9s658475e58****

The node ID.

Note This parameter is required for PolarDB for MySQL clusters.
Start Long No 1642556990714

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

Note The start time can be up to 90 days earlier than the current time.
End Long No 1642566830000

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 cannot exceed 24 hours.
DbName String No testdb01

The name of the database.

Response parameters

Parameter Type Example Description
Code Long 200

The returned HTTP status code.

Message String Successful

The message that is returned for the request.

Note If the request is successful, Successful is returned. If the request fails, an error message that contains information such as an error code is returned.
Data Object

The returned data.

fail Boolean false

Indicates whether the request failed. Valid values:

  • true: The request failed.
  • false: The request is successful.
isFinish Boolean true

Indicates whether the asynchronous request is complete.

  • true
  • false
resultId String async__fcd7c35788e62324622c3b4a03de****

The ID of the asynchronous request.

state String SUCCESS

The execution status of the asynchronous request.

  • RUNNING
  • SUCCESS
  • FAIL
timestamp Long 1644560866961

The time when the request is executed. The value of this parameter is a UNIX timestamp. Unit: ms.

complete Boolean true

Indicates whether the asynchronous request is complete. Valid values:

  • true
  • false
result Array of stat

Information of the returned error codes and the number of SQL templates corresponding to each error code.

instanceId String rm-2ze8g2am97624****

The instance ID.

errorCode String 1062

The error code.

count Integer 1

The number of SQL templates corresponding to the error code.

RequestId String 840F51F7-9C01-538D-94F6-AE712905****

The ID of the request.

Success Boolean true

Indicates whether the request is successful. Valid values:

  • true
  • false

Examples

Sample requests

http(s)://das.cn-shanghai.aliyuncs.com/?Action=GetAsyncErrorRequestStatByCode
&InstanceId=rm-2ze8g2am97624****
&Start=1642556990714
&End=1642566830000
&DbName=testdb01
&Common request parameters

Sample success responses

XML format

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

<GetAsyncErrorRequestStatByCodeResponse>
    <Code>200</Code>
    <Message>Successful</Message>
    <Data>
        <fail>false</fail>
        <isFinish>true</isFinish>
        <resultId>async__fcd7c35788e62324622c3b4a03de****</resultId>
        <state>SUCCESS</state>
        <timestamp>1644560866961</timestamp>
        <complete>true</complete>
        <result>
            <instanceId>rm-2ze8g2am97624****</instanceId>
            <errorCode>1062</errorCode>
            <count>1</count>
        </result>
    </Data>
    <RequestId>840F51F7-9C01-538D-94F6-AE712905****</RequestId>
    <Success>true</Success>
</GetAsyncErrorRequestStatByCodeResponse>

JSON format

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

{
  "Code" : 200,
  "Message" : "Successful",
  "Data" : {
    "fail" : false,
    "isFinish" : true,
    "resultId" : "async__fcd7c35788e62324622c3b4a03de****",
    "state" : "SUCCESS",
    "timestamp" : 1644560866961,
    "complete" : true,
    "result" : {
      "instanceId" : "rm-2ze8g2am97624****",
      "errorCode" : 1062,
      "count" : 1
    }
  },
  "RequestId" : "840F51F7-9C01-538D-94F6-AE712905****",
  "Success" : true
}

Error codes

HTTP status code Error code Error message Description
400 InvalidParams The request parameters are invalid. The error message returned because the specified request parameters are invalid.

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