Asynchronously queries the IDs of SQL queries that generate the specified MySQL error code in the SQL Explorer results of a database instance.

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 instances 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

ParameterTypeRequiredExampleDescription
ActionStringYesGetAsyncErrorRequestListByCode

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

InstanceIdStringYesrm-2ze8g2am97624****

The ID of the instance.

NodeIdStringNopi-wz9s658475e58****

The ID of the node.

Note This parameter is required for PolarDB for MySQL instances.
StartLongNo1642556990714

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.
EndLongNo1642566830000

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.
ErrorCodeStringNo1064

The error code. You can call the GetAsyncErrorRequestStatByCode operation to query the MySQL error codes that can be generated in the SQL Explorer results of an instance.

Response parameters

ParameterTypeExampleDescription
CodeLong200

The returned HTTP status code.

MessageStringSuccessful

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.
DataObject

The returned data.

failBooleanfalse

Indicates whether the asynchronous request failed. Valid values:

  • true: The asynchronous request failed.
  • false: The asynchronous request is successful.
resultArray of list

The IDs of SQL queries that generate the specified MySQL error code.

sqlIdStringad78a4e7d3ce81590c9dc2d5f4bc****

The ID of the SQL query.

instanceIdStringrm-2ze8g2am97624****

The ID of the instance.

resultIdStringasync__c39d43ece52d35267cc4b92a0c26****

The ID of the asynchronous request.

isFinishBooleantrue

Indicates whether the asynchronous request is complete.

  • true
  • false
stateStringSUCCESS

The state of the asynchronous request.

  • RUNNING
  • SUCCESS
  • FAIL
completeBooleantrue

Indicates whether the asynchronous request is complete. Valid values:

  • true
  • false
timestampLong1644559407740

The time when the asynchronous request was made. The value of this parameter is a UNIX timestamp. Unit: milliseconds.

RequestIdString9CB97BC4-6479-55D0-B9D0-EA925AFE****

The ID of the request.

SuccessBooleantrue

Indicates whether the request is successful. Valid values:

  • true
  • false

Examples

Sample requests

http(s)://das.cn-shanghai.aliyuncs.com/?Action=GetAsyncErrorRequestListByCode
&InstanceId=rm-2ze8g2am97624****
&Start=1642556990714
&End=1642566830000
&ErrorCode=1064
&<Common request parameters>

Sample success responses

XML format

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

<GetAsyncErrorRequestListByCodeResponse>
    <Code>200</Code>
    <Message>Successful</Message>
    <Data>
        <fail>false</fail>
        <result>
            <sqlId>ad78a4e7d3ce81590c9dc2d5f4bc****</sqlId>
            <instanceId>rm-2ze8g2am97624****</instanceId>
        </result>
        <resultId>async__c39d43ece52d35267cc4b92a0c26****</resultId>
        <isFinish>true</isFinish>
        <state>SUCCESS</state>
        <complete>true</complete>
        <timestamp>1644559407740</timestamp>
    </Data>
    <RequestId>9CB97BC4-6479-55D0-B9D0-EA925AFE****</RequestId>
    <Success>true</Success>
</GetAsyncErrorRequestListByCodeResponse>

JSON format

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

{
  "Code" : 200,
  "Message" : "Successful",
  "Data" : {
    "fail" : false,
    "result" : [ {
      "sqlId" : "ad78a4e7d3ce81590c9dc2d5f4bc****",
      "instanceId" : "rm-2ze8g2am97624****"
    } ],
    "resultId" : "async__c39d43ece52d35267cc4b92a0c26****",
    "isFinish" : true,
    "state" : "SUCCESS",
    "complete" : true,
    "timestamp" : 1644559407740
  },
  "RequestId" : "9CB97BC4-6479-55D0-B9D0-EA925AFE****",
  "Success" : true
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidParamsThe 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.