Initiates an SQL statement diagnostics request on an instance connected to DAS.

Before you call this operation, make sure that the following requirements are met:

  • If you use an SDK to call DAS, you must set the region to cn-shanghai.
  • This operation can be used in the following database services:
    • RDS MySQL
    • RDS PostgreSQL
    • RDS SQL Server
    • PolarDB for MySQL
    • PolarDB for PostgreSQL(Compatible with Oracle)
    • ApsaraDB for MongoDB
Note The minor engine version of an RDS for PostgreSQL instance is 20220130 or later. For more information, see Update the minor engine version of an RDS for PostgreSQL instance.

Request parameters

ParameterTypeRequiredExampleDescription
ActionStringYesCreateRequestDiagnosis

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

InstanceIdStringYesrm-0iwhhl8gx0ld6****

The ID of the instance.

NodeIdStringNo202****

The ID of the node.

Note This parameter must be specified for cluster instances such as PolarDB for MySQL, PolarDB for PostgreSQL(Compatible with Oracle), and ApsaraDB for MongoDB.
DatabaseStringYesdas

The name of the database.

SqlStringYesselect * from test where name = 'mockUser'

The SQL statement to be diagnosed.

Response parameters

ParameterTypeExampleDescription
CodeString200

The returned HTTP status code.

MessageStringSuccessful

The returned message.

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.
DataString61820b594664275c4429****

The unique ID of the diagnostic task. It is used to query the diagnosis result later.

RequestIdString800FBAF5-A539-5B97-A09E-C63AB2F7****

The ID of the request.

SuccessStringtrue

Indicates whether the request is successful. Valid values:

  • true: The request is successful.
  • false: The request fails.

Examples

Sample requests

http(s)://das.cn-shanghai.aliyuncs.com/?Action=CreateRequestDiagnosis
&InstanceId=rm-0iwhhl8gx0ld6****
&NodeId=202****
&Database=das
&Sql=select * from test where name = 'mockUser'
&Common request parameters

Sample success responses

XML format

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

<CreateRequestDiagnosisResponse>
    <Code>200</Code>
    <Message>Successful</Message>
    <Data>61820b594664275c4429****</Data>
    <RequestId>800FBAF5-A539-5B97-A09E-C63AB2F7****</RequestId>
    <Success>true</Success>
</CreateRequestDiagnosisResponse>

JSON format

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

{
  "Code" : "200",
  "Message" : "Successful",
  "Data" : "61820b594664275c4429****",
  "RequestId" : "800FBAF5-A539-5B97-A09E-C63AB2F7****",
  "Success" : "true"
}

Error codes

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