Queries the status and results of a storage analysis task.
Operation description
Note
The physical file size indicates the actual size of an obtained file. Only specific deployment modes of database instances support the display of physical file sizes. The statistics on tables are obtained from
information_schema.tables
. Statistics in MySQL are not updated in real time. Therefore, the statistics may be different from the physical file sizes. If you want to obtain the latest data, you can execute the ANALYZE TABLE
statement on the relevant tables during off-peak hours.
- This operation is applicable only to ApsaraDB RDS for MySQL instances, PolarDB for MySQL clusters, and ApsaraDB for MongoDB instances.
- For ApsaraDB RDS for MySQL instances and PolarDB for MySQL clusters, this operation works the same as the storage analysis feature of the previous version. Tasks generated by this operation cannot be viewed on the Storage Analysis page of the new version in the Database Autonomy Service (DAS) console. If you want to view the tasks and results, call the related API operation to obtain data and save data to your computer.
- If you use an Alibaba Cloud SDK or DAS SDK to call this operation, we recommend that you use the latest version of the SDK.
- If you use an SDK to call 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:GetStorageAnalysisResult | none |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
InstanceId | string | Yes | The instance ID. | rm-bp10xxxxxxxxx |
NodeId | string | No | The node ID. Note
This parameter is reserved.
| 202**** |
TaskId | string | Yes | The task ID. You can obtain the task ID from the response of the CreateStorageAnalysisTask operation. | 910f83f4b96df0524ddc5749f615**** |
Response parameters
Examples
Sample success responses
JSON
format
{
"Code": 200,
"Message": "Successful",
"Data": {
"TaskId": "910f83f4b96df0524ddc5749f615****",
"TaskFinish": true,
"TaskSuccess": true,
"TaskState": "RUNNING",
"TaskProgress": 50,
"TotalDbCount": 32,
"AnalyzedDbCount": 2,
"StorageAnalysisResult": {
"TotalStorageSize": 214748364800,
"TotalUsedStorageSize": 68345135104,
"TotalFreeStorageSize": 146403229696,
"DailyIncrement": 0,
"EstimateAvailableDays": 99,
"AnalysisSuccess": true,
"AnalysisErrorType": "DB_NOT_EXIST",
"NeedOptimizeItemList": [
{
"DbName": "testdb01",
"TableName": "test_table",
"OptimizeItemName": "NEED_OPTIMIZE_TABLE",
"OptimizeAdvice": "NEED_OPTIMIZE_TABLE",
"AssociatedData": "{\n \"autoIncrementCurrentValue\": 2147483647,\n \"autoIncrementRatio\": 1,\n \"dbName\": \"testdb01\",\n \"maximumValue\": 2147483647,\n \"columnName\": \"id\",\n \"tableName\": \"test_table\"\n}"
}
],
"TableStats": [
{
"DbName": "testdb01",
"TableName": "test_table",
"TableType": "BASE TABLE",
"Engine": "InnoDB",
"PhysicalFileSize": 3057655808,
"PhyTotalSize": 3012493312,
"TotalSize": 3005153280,
"IndexSize": 1022296064,
"DataSize": 1982857216,
"DataFree": 7340032,
"TableRows": 12794732,
"AvgRowLength": 154,
"FragmentSize": 362221568
}
]
}
},
"RequestId": "B6D17591-B48B-4D31-9CD6-9B9796B2****",
"Success": true
}
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-05-14 | The Error code has changed. The response structure of the API has changed | View Change Details |