Asynchronously obtains the number of failed executions of specified SQL templates based on SQL Explorer data.

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 GetAsyncErrorRequestStatResult

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

InstanceId String Yes rm-2ze8g2am97624****

The instance ID.

NodeId String No pi-bp179lg03445l****

The node ID.

Note This parameter is required for PolarDB for MySQL clusters.
SqlIdList String No ad78a4e7d3ce81590c9dc2d5f4bc****,0f92feacd92c048b06a16617a633****

The ID of the SQL template. Separate multiple SQL IDs with commas (,). You can call the GetAsyncErrorRequestListByCode operation to query the ID of the SQL template for which MySQL error code is returned.

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 asynchronous request failed. Valid values:

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

Indicates whether the asynchronous request is complete.

  • true
  • false
resultId String async__61f45ee381b2fa4e8a6545e3bee9****

The ID of the asynchronous request.

state String SUCCESS

The state of the asynchronous request.

  • RUNNING
  • SUCCESS
  • FAIL
timestamp Long 1644558576717

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

complete Boolean true

Indicates whether the asynchronous request is complete.

  • true
  • false
result Array of Object

The list of the returned data.

Object

The returned data of the asynchronous request.

sqlId String ad78a4e7d3ce81590c9dc2d5f4bc****

The ID of the SQL template.

instanceId String rm-2ze8g2am97624****

The instance ID.

count Integer 1

The number of failed executions.

RequestId String 3FC3F8EB-3564-5D1A-B187-3B03E5B0****

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=GetAsyncErrorRequestStatResult
&InstanceId=rm-2ze8g2am97624****
&SqlIdList=ad78a4e7d3ce81590c9dc2d5f4bc****,0f92feacd92c048b06a16617a633****
&Start=1642556990714
&End=1642566830000
&DbName=testdb01
&Common request parameters

Sample success responses

XML format

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

<GetAsyncErrorRequestStatResultResponse>
    <Code>200</Code>
    <Message>Successful</Message>
    <Data>
        <fail>false</fail>
        <isFinish>true</isFinish>
        <resultId>async__61f45ee381b2fa4e8a6545e3bee9****</resultId>
        <state>SUCCESS</state>
        <timestamp>1644558576717</timestamp>
        <complete>true</complete>
        <result>
            <key>
                <sqlId>ad78a4e7d3ce81590c9dc2d5f4bc****</sqlId>
                <instanceId>rm-2ze8g2am97624****</instanceId>
                <count>1</count>
            </key>
        </result>
    </Data>
    <RequestId>3FC3F8EB-3564-5D1A-B187-3B03E5B0****</RequestId>
    <Success>true</Success>
</GetAsyncErrorRequestStatResultResponse>

JSON format

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

{
  "Code" : 200,
  "Message" : "Successful",
  "Data" : {
    "fail" : false,
    "isFinish" : true,
    "resultId" : "async__61f45ee381b2fa4e8a6545e3bee9****",
    "state" : "SUCCESS",
    "timestamp" : 1644558576717,
    "complete" : true,
    "result" : [ {
      "key" : {
        "sqlId" : "ad78a4e7d3ce81590c9dc2d5f4bc****",
        "instanceId" : "rm-2ze8g2am97624****",
        "count" : 1
      }
    } ]
  },
  "RequestId" : "3FC3F8EB-3564-5D1A-B187-3B03E5B0****",
  "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.