Obtaining the Latest Daily Database Health Report
Function
This API is used to obtain the latest daily database health report.
Authorization Information
Each account has permissions to call all APIs, but IAM users must have the required permissions specifically assigned.
- If you are using role/policy-based authorization, see the required permissions in Permissions Policies and Supported Actions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
das:clouddba:dailyReportsList
Read
Instance
-
-
-
URI
GET /v3/{project_id}/health-report/{instance_id}/get-latest-instance-health-report
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition Project ID of a tenant in a region. To obtain this value, see Obtaining a Project ID. Constraints N/A Range The value can contain 32 characters. Only letters and digits are supported. Default Value N/A |
| instance_id | Yes | String | Definition Unique ID of an instance Constraints N/A Range The value can contain 32 characters. Only letters and digits are supported. Default Value N/A |
Request Parameters
None
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| success | Boolean | Definition Whether the diagnosis in a daily report is successful Range N/A |
| start_at | Long | Definition Diagnosis start time (in Unix timestamp format) in a daily report, in milliseconds Range N/A |
| end_at | Long | Definition Diagnosis end time (in Unix timestamp format) in a daily report, in milliseconds Range N/A |
| task_id | String | Definition Report ID Range N/A |
| summary_info | Table 4 object | Definition Daily report abstract Range N/A |
| instance_info | Table 8 object | Definition Instance information list Range N/A |
| performance_stat | Table 9 object | Definition Performance statistics and analysis list Range N/A |
| disk_stat | Table 10 object | Definition Disk statistics and analysis list Range N/A |
| table_space_stat | Table 13 object | Definition Tablespace statistics and analysis list Range N/A |
| slow_log_stat | Table 16 object | Definition Statistics and analysis list of slow query logs Range N/A |
| full_sql_stat | Table 17 object | Definition Statistics and analysis list of all query logs Range N/A |
| inspection_stat | Table 19 object | Definition Statistics and analysis list of preventive maintenance inspection scores Range N/A |
| error_message | String | Definition Error message Range N/A |
| Parameter | Type | Description |
|---|---|---|
| analysis_results | Array of Table 5 objects | Definition Analysis results Range N/A |
| Parameter | Type | Description |
|---|---|---|
| risk_code | String | Definition Risk code Range N/A |
| risk_level | String | Definition Risk level Range N/A |
| risk_content | String | Definition Risk content Range N/A |
| reasons | Array of Table 6 objects | Definition Possible causes Range N/A |
| Parameter | Type | Description |
|---|---|---|
| reason_code | String | Definition Possible cause code Range N/A |
| reason_content | String | Definition Possible cause Range N/A |
| suggestions | Array of Table 7 objects | Definition Suggestion list Range N/A |
| Parameter | Type | Description |
|---|---|---|
| suggestion_code | String | Definition Suggestion code Range N/A |
| suggestion_content | String | Definition Suggestion Range N/A |
| Parameter | Type | Description |
|---|---|---|
| tenant_id | String | Definition Account ID Range N/A |
| project_id | String | Definition Project ID Range N/A |
| instance_id | String | Definition Instance ID Range N/A |
| master_node_id | String | Definition Primary node ID Range N/A |
| instance_name | String | Definition Instance name Range N/A |
| cpu | Integer | Definition Number of CPU cores of an instance Range N/A |
| mem | Integer | Definition Instance memory size Range N/A |
| disk_size | Integer | Definition Disk size Range N/A |
| disk_type | String | Definition Disk type Range N/A |
| engine | String | Definition DB engine Range N/A |
| engine_version | String | Definition DB engine kernel version Range N/A |
| Parameter | Type | Description |
|---|---|---|
| peak_stats | Array of Table 11 objects | Definition Peak statistics Range N/A |
| ratio_stats | Array of Table 12 objects | Definition Ratio data Range N/A |
| analyze_success | Boolean | Definition Whether analytical and statistical data is collected Range N/A |
| error_message | String | Definition Error message Range N/A |
| Parameter | Type | Description |
|---|---|---|
| peak_stats | Array of Table 11 objects | Definition Peak statistics Range N/A |
| ratio_stats | Array of Table 12 objects | Definition Ratio data Range N/A |
| analyze_success | Boolean | Definition Whether analytical and statistical data is collected Range N/A |
| error_message | String | Definition Error message Range N/A |
| Parameter | Type | Description |
|---|---|---|
| metric | String | Definition Metric name Range N/A |
| value | Double | Definition Value Range N/A |
| max_value | Double | Definition Maximum value Range N/A |
| normalized | Double | Definition Normalized value Range N/A |
| stage | String | Definition Current status Range N/A |
| timestamp | Long | Definition Metric collection time Range N/A |
| Parameter | Type | Description |
|---|---|---|
| metric | String | Definition Metric name Range N/A |
| max_value | Double | Definition Maximum value Range N/A |
| critical_ratio | Double | Definition High ratio Range N/A |
| medium_ratio | Double | Definition Medium ratio Range N/A |
| light_ratio | Double | Definition Low ratio Range N/A |
| Parameter | Type | Description |
|---|---|---|
| size_top | Array of Table 14 objects | Definition Top tables in size Range N/A |
| rows_top | Array of Table 14 objects | Definition Top table rows Range N/A |
| size_incr_top | Array of Table 15 objects | Definition Top tables in size with the highest growth rate Range N/A |
| rows_incr_top | Array of Table 15 objects | Definition Top rows with the highest growth rate Range N/A |
| analyze_success | Boolean | Definition Whether analytical and statistical data is collected Range N/A |
| error_message | String | Definition Error message Range N/A |
| Parameter | Type | Description |
|---|---|---|
| database | String | Definition Database name Range N/A |
| table | String | Definition Table name Range N/A |
| db_engine | String | Definition DB engine Range N/A |
| table_size | Long | Definition Table size Range N/A |
| data_size | Long | Definition Data volume Range N/A |
| index_size | Long | Definition Index size Range N/A |
| rows | Long | Definition Number of rows Range N/A |
| Parameter | Type | Description |
|---|---|---|
| database | String | Definition Database name Range N/A |
| table | String | Definition Table name Range N/A |
| increment | Long | Definition Increment Range N/A |
| analyze_success | Boolean | Definition Whether analytical and statistical data is collected Range N/A |
| error_message | String | Definition Error message Range N/A |
| Parameter | Type | Description |
|---|---|---|
| collect_slow_log | Boolean | Definition Whether slow query logs are collected Range N/A |
| top_execute_slow_logs | Array of Table 18 objects | Definition Top slow SQL queries ranked by execution count Range N/A |
| top_avg_query_time_slow_logs | Array of Table 18 objects | Definition Top slow SQL queries ranked by average execution duration Range N/A |
| top_max_query_time_slow_logs | Array of Table 18 objects | Definition Top slow SQL queries ranked by maximum execution duration Range N/A |
| rows_examined_exceeding | Array of Table 18 objects | Definition Top slow SQL queries ranked by scan-to-return ratio Range N/A |
| analyze_success | Boolean | Definition Whether analytical and statistical data is collected Range N/A |
| error_message | String | Definition Error message Range N/A |
| Parameter | Type | Description |
|---|---|---|
| collect_full_sql | Boolean | Definition Whether all query logs are collected Range N/A |
| execute_top_templates | Array of Table 18 objects | Definition Top SQL queries ranked by execution times Range N/A |
| sum_rows_examined_top_templates | Array of Table 18 objects | Definition Top SQL queries ranked by scanned rows Range N/A |
| avg_cost_top_templates | Array of Table 18 objects | Definition Top SQL queries ranked by average execution duration Range N/A |
| analyze_success | Boolean | Definition Whether analytical and statistical data is collected Range N/A |
| error_message | String | Definition Error message Range N/A |
| Parameter | Type | Description |
|---|---|---|
| template_id | String | Definition Template ID Range N/A |
| template | String | Definition Template content Range N/A |
| databases | Array of strings | Definition Database list Range N/A |
| times | Long | Definition Execution times Range N/A |
| avg_query_time | Double | Definition Average execution duration Range N/A |
| max_query_time | Double | Definition Maximum execution duration Range N/A |
| avg_rows_examined | Double | Definition Average rows scanned Range N/A |
| max_rows_examined | Double | Definition Maximum rows scanned Range N/A |
| sum_rows_examined | Double | Definition Total rows scanned Range N/A |
| avg_rows_sent | Double | Definition Average rows returned Range N/A |
| max_rows_sent | Double | Definition Maximum rows returned Range N/A |
| Parameter | Type | Description |
|---|---|---|
| inspection_score | Array of Table 20 objects | Definition Inspection score Range N/A |
| analyze_success | Boolean | Definition Whether analytical and statistical data is collected Range N/A |
| error_message | String | Definition Error message Range N/A |
| Parameter | Type | Description |
|---|---|---|
| score | Double | Definition Score Range N/A |
| critical | Integer | Definition Major event Range N/A |
| medium | Integer | Definition Warning Range N/A |
| light | Integer | Definition Optimization event Range N/A |
| cpu_usage | Double | Definition CPU usage Range N/A |
| mem_usage | Double | Definition Memory usage Range N/A |
| space_usage | Double | Definition Space usage Range N/A |
| connection_rate | Double | Definition Connection usage Range N/A |
| iops_usage | Double | Definition IOPS usage Range N/A |
| thread_running | Double | Definition Active session Range N/A |
| slow_sql_total | Long | Definition Number of slow query logs Range N/A |
| lost_points_detail_list | Array of Table 21 objects | Definition Score deduction details Range N/A |
| Parameter | Type | Description |
|---|---|---|
| metric | String | Definition Score deduction item Range N/A |
| lost_points | Double | Definition Deducted score Range N/A |
| risk_level | String | Definition Event level Range N/A |
Example Requests
GET https://das.cn-north-1.myhuaweicloud.com/v3/054e292c9880d4992f02c0196d3ea468/health-report/17a73a23badb4c40b6ea48e7bfa5e83fin01/get-latest-instance-health-report
Example Responses
Status code: 200
Success.
{
"success" : true,
"summary_info" : {
"analysis_results" : [ {
"risk_code" : "SLOW_LOG_ISSUE",
"risk_level" : "WARNING",
"risk_content": "Slow SQL queries",
"reasons" : [ {
"reason_code" : "SLOW_LOG_EXIST",
reason_content": "There are slow SQL queries.",
"suggestions" : [ {
"suggestion_code" : "ANALYZE_SLOW_LOG",
"suggestion_content": "Analyze slow SQL queries to find the root cause."
} ]
} ]
} ]
},
"instance_info" : {
"tenant_id" : "05204146e600d48f0f02c002850ec340",
"project_id" : "052041494800d57c2f02c00275b4c247",
"instance_id" : "bcfa975193f1402fa11a6d4fd6baf5fbin01",
"instance_name" : "rds-sql-Do not delete 1.",
"cpu" : 2,
"mem" : 8,
"disk_size" : 60,
"disk_type" : "CLOUDSSD",
"engine" : "mysql",
"engine_version" : "5.7"
},
"performance_stat" : {
"analyze_success" : true,
"peak_stats" : [ {
"metric" : "qps",
"value" : 64.88,
"max_value" : 11178,
"normalized" : 0.005804258364644837,
"stage" : "LIGHT",
"timestamp" : 1728756000
} ],
"ratio_stats" : [ {
"metric" : "qps",
"max_value" : 11178,
"critical_ratio" : 0,
"medium_ratio" : 0,
"light_ratio" : 1
} ]
},
"disk_stat" : {
"analyze_success" : true,
"peak_stats" : [ {
"metric" : "iops",
"value" : 91.9,
"max_value" : 4500,
"normalized" : 0.020422222222222224,
"stage" : "LIGHT",
"timestamp" : 1728750600
} ],
"ratio_stats" : [ {
"metric" : "iops",
"max_value" : 4500,
"critical_ratio" : 0,
"medium_ratio" : 0,
"light_ratio" : 1
} ]
},
"table_space_stat" : {
"analyze_success" : true
},
"slow_log_stat" : {
"analyze_success" : true,
"collect_slow_log" : true,
"top_execute_slow_logs" : [ {
"template_id" : "5B20B6BF446F926F",
"template" : "INSERT INTO test123 VALUES (?);",
"databases" : [ "test_db" ],
"times" : 83,
"avg_query_time" : 0.9021538595657752,
"max_query_time" : 45.08398997783661,
"avg_rows_examined" : 0,
"sum_rows_examined" : 0,
"avg_rows_sent" : 0
} ],
"rows_examined_exceeding" : [ ]
},
"full_sql_stat" : {
"analyze_success" : true,
"collect_full_sql" : true,
"execute_top_templates" : [ {
"template_id" : "B38F825636B24B7",
"template" : "CREATE TABLE IF NOT EXISTS table_001 (id int)",
"databases" : [ "test_db" ],
"times" : 1,
"avg_query_time" : 5,
"avg_rows_examined" : 0,
"sum_rows_examined" : 0
} ]
},
"inspection_stat" : {
"analyze_success" : true,
"inspection_score" : [ {
"score" : 100,
"critical" : 0,
"medium" : 0,
"light" : 0,
"cpu_usage" : 3.93,
"mem_usage" : 22.91,
"space_usage" : 8.66,
"connection_rate" : 0.54,
"iops_usage" : 0.28,
"thread_running" : 4,
"slow_sql_total" : 0,
"lost_points_detail_list" : [ {
"metric" : "memUsage",
"lost_points" : 0,
"risk_level" : "NORMAL"
}, {
"metric" : "cpuUsage",
"lost_points" : 0,
"risk_level" : "NORMAL"
}, {
"metric" : "spaceUsage",
"lost_points" : 0,
"risk_level" : "NORMAL"
}, {
"metric" : "iopsUsage",
"lost_points" : 0,
"risk_level" : "NORMAL"
}, {
"metric" : "connectionRate",
"lost_points" : 0,
"risk_level" : "NORMAL"
}, {
"metric" : "threadRunning",
"lost_points" : 0,
"risk_level" : "NORMAL"
}, {
"metric" : "slowSqlTotal",
"lost_points" : 0,
"risk_level" : "NORMAL"
} ]
} ]
}
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Success. |
| 400 | Client error. |
| 500 | Server error. |
Error Codes
See Error Codes.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot