Queries the details of an offline task in Database Autonomy Service (DAS) Enterprise Edition.
Operation description
Before you call this operation, take note of the following items:
- If you use an Alibaba Cloud SDK or a DAS SDK to call this operation, we recommend that you use the latest version of the SDK.
- If you use an SDK to call the API operations of DAS, you must set the region ID to cn-shanghai.
Debugging
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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
hdm:DescribeSqlLogTask | get |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
InstanceId | string | No | The ID of the database instance. | r-bp1nti25tc7bq5**** |
TaskId | string | No | The task ID. | a4f5c4494dbd6713185d87a97aa53e8 |
PageNo | integer | No | The page number. Pages start from page 1. Default value: 1. | 1 |
PageSize | integer | No | The number of entries per page. Default value: 10. | 10 |
Response parameters
Valid values of Key:
- KeyWords: the keywords. Separate multiple keywords with spaces.
- LogicalOperator: the logical operator between keywords. Valid values: and and or.
- AccountName: the database account.
- DBName: the database name.
- HostAddress: the IP address of the client.
- MaxConsume: the maximum execution duration. Unit: millisecond.
- MinConsume: the minimum execution duration. Unit: millisecond.
- MaxScanRows: the maximum number of rows scanned.
- MinScanRows: the minimum number of rows scanned.
- SqlType: the type of the SQL statement. Valid values: select, update, insert, and delete.
- State: the execution result. Valid values: 0 and 1. A value of 0 indicates that the execution was successful. A value of 1 indicates that the execution failed.
- ThreadId: The thread ID.
- SortKey: the name of the column for sorting. Valid values: ScanRows, UpdateRows, Consume, ExecuteTime, ReturnRows, LockTime, Frows, Scnt, CpuTime, and PhysicalRead.
- SortMethod: The sorting order. Valid values: DESC and ASC. A value of DESC indicates the descending order. A value of ASC indicates the ascending order. Default value: DESC.
- TraceId: the trace ID of the PolarDB-X 2.0 instance.
- MinRows: the minimum number of rows updated.
- MaxRows: the maximum number of rows updated.
- MinScnt: the minimum number of requests from the CNs to the DNs in the PolarDB-X 2.0 instance.
- MaxScnt: the maximum number of requests from the CNs to the DNs in the PolarDB-X 2.0 instance.
- TrxId: the transaction ID.
- Fail: the error code.
- sqlId: the ID of the SQL statement.
- JobId: the task ID. For a database instance for which DAS Enterprise Edition V0 or V1 is enabled, you must use the asynchronous task ID to query the returned results.
Examples
Sample success responses
JSON
format
{
"Code": "200",
"Message": "Successful",
"RequestId": "B6D17591-B48B-4D31-9CD6-9B9796B2****",
"Success": "true",
"Data": {
"Name": "",
"TaskId": "9a4f5c4494dbd6713185d87a97aa53e8\n",
"TaskType": "Query",
"CreateTime": 1681363254423,
"Status": "COMPLETED",
"Expire": true,
"Start": 1596177993000,
"End": 1608888296000,
"Filters": [
{
"Key": "keyWords\n",
"Value": "select"
}
],
"Total": 1,
"Queries": [
{
"Vip": "10.146.XX.XX",
"NodeId": "pi-bp1o58x3ib7e6****\n",
"SqlText": "SELECT @@session.transaction_read_only",
"SqlType": "SELECT",
"State": "0",
"DBName": "testdb01",
"SqlId": "a4111670e80596c5bf42cf5154438a91",
"ExecuteTime": "2023-12-07T02:15:32Z",
"OriginTime": 1701886532000,
"AccountName": "testname\n",
"HostAddress": "11.197.XX.XX\n",
"Consume": 58,
"LockTime": 0,
"UpdateRows": 0,
"ScanRows": 0,
"ReturnRows": 0,
"LogicRead": 0,
"PhysicSyncRead": 0,
"PhysicAsyncRead": 0,
"ThreadId": 0,
"TrxId": 200000,
"Ext": "None",
"Scnt": 10,
"Rows": 10,
"Frows": 10,
"TraceId": "14c93b7c7bf00000 ",
"UseImciEngine": "true\n",
"ParallelDegree": "10\n",
"ParallelQueueTime": "2",
"PhysicRead": 0,
"CpuTime": 100,
"Writes": 10
}
],
"Export": "\"https://das-sqllog-download-cn-hongkong.oss-cn-hongkong.aliyuncs.com/****\""
}
}
Error codes
HTTP status code | Error code | Error message |
---|---|---|
400 | InvalidParams | The request parameters are invalid. |
403 | NoPermission | You are not authorized to do this action. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-07-03 | The Error code has changed. The response structure of the API has changed | View Change Details |
2024-05-22 | The Error code has changed. The response structure of the API has changed | View Change Details |