All Products
Search
Document Center

Database Autonomy Service:CreateRequestDiagnosis

Last Updated:Dec 23, 2024

Initiates an SQL statement diagnostics request.

Operation description

Before you call this operation, take note of the following items:

  • If you use an SDK to call Database Autonomy Service (DAS), you must set the region to cn-shanghai.

  • This operation supports the following database engines:

    • ApsaraDB RDS for MySQL
    • ApsaraDB RDS for PostgreSQL
    • ApsaraDB RDS for SQL Server
    • PolarDB for MySQL
    • PolarDB for PostgreSQL (compatible with Oracle)
    • ApsaraDB for MongoDB
Note The minor engine version of ApsaraDB RDS for PostgreSQL instances must be 20221230 or later. For more information about how to check and update the minor engine version of an ApsaraDB RDS for PostgreSQL instance, see Update the minor engine version of an ApsaraDB RDS for PostgreSQL instance.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
hdm:CreateRequestDiagnosiscreate
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The instance ID.

rm-0iwhhl8gx0ld6****
NodeIdstringNo

The node ID.

Note This parameter must be specified for PolarDB for MySQL, PolarDB for PostgreSQL (Compatible with Oracle), and ApsaraDB for MongoDB instances.
202****
DatabasestringYes

The name of the database.

das
SqlstringYes

The SQL statement that you want to diagnose.

select * from test where name = 'mockUser'

Response parameters

ParameterTypeDescriptionExample
object
Codestring

The HTTP status code returned.

200
Messagestring

The returned message.

Note If the request was successful, Successful is returned. If the request failed, an error message such as an error code is returned.
Successful
Datastring

The diagnostics ID, which is the unique identifier of the diagnosis. This parameter can be used to query the result of the diagnosis.

61820b594664275c4429****
RequestIdstring

The request ID.

800FBAF5-A539-5B97-A09E-C63AB2F7****
Successstring

Indicates whether the request was successful. Valid values:

  • true: The request was successful.
  • false: The request failed.
true

Examples

Sample success responses

JSONformat

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

Error codes

HTTP status codeError codeError message
400InvalidParamsThe request parameters are invalid.
403NoPermissionYou are not authorized to do this action.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history