文档首页/ 数据管理服务 DAS/ API参考/ API(公测中)/ 云DBA/ 获取数据库健康日报内容 - GetInstanceHealthReport
更新时间:2026-07-07 GMT+08:00
分享

获取数据库健康日报内容 - GetInstanceHealthReport

功能介绍

获取数据库健康日报内容。

授权信息

账号具备所有API的调用权限,如果使用账号下的IAM用户调用当前API,该IAM用户需具备调用API所需的权限。

  • 如果使用角色与策略授权,具体权限要求请参见权限和授权项
  • 如果使用身份策略授权,需具备如下身份策略权限。

    授权项

    访问级别

    资源类型(*为必须)

    条件键

    别名

    依赖的授权项

    das:clouddba:dailyReportsList

    read

    instance

    -

    -

    -

URI

GET /v3/{project_id}/health-report/{instance_id}/get-instance-health-report

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

参数解释

租户在某一Region下的项目ID。

获取方法请参见获取项目ID

约束限制:

不涉及。

取值范围:

只能由英文字母、数字组成,且长度为32个字符。

默认取值:

不涉及。

instance_id

String

参数解释:

实例ID。标识实例的唯一标识。

约束限制:

不涉及。

取值范围:

只能由英文字母、数字组成,且长度为32个字符。

默认取值:

不涉及。

请求参数

表2 Query参数

参数

是否必选

参数类型

描述

task_id

String

参数解释:

日报任务ID。

约束限制:

不涉及。

取值范围:

不涉及。

默认取值:

不涉及。

响应参数

状态码: 200

表3 响应Body参数

参数

参数类型

描述

success

Boolean

参数解释:

日报诊断是否成功。

取值范围:

不涉及。

start_at

Long

参数解释:

日报诊断区间的起始时间(Unix timestamp),单位:毫秒。

取值范围:

不涉及。

end_at

Long

参数解释:

日报诊断区间的结束时间(Unix timestamp),单位:毫秒。

取值范围:

不涉及。

task_id

String

参数解释:

报告ID。

取值范围:

不涉及。

summary_info

表4 object

参数解释:

日报内容摘要信息。

取值范围:

不涉及。

instance_info

表8 object

参数解释:

实例信息列表。

取值范围:

不涉及。

performance_stat

表9 object

参数解释:

性能统计分析列表。

取值范围:

不涉及。

disk_stat

表10 object

参数解释:

磁盘统计分析列表。

取值范围:

不涉及。

table_space_stat

表13 object

参数解释:

表空间统计分析列表。

取值范围:

不涉及。

slow_log_stat

表16 object

参数解释:

慢SQL统计分析列表。

取值范围:

不涉及。

full_sql_stat

表17 object

参数解释:

全量SQL统计分析列表。

取值范围:

不涉及。

inspection_stat

表19 object

参数解释:

巡检评分统计分析列表。

取值范围:

不涉及。

error_message

String

参数解释:

错误信息。

取值范围:

不涉及。

表4 HealthReportSummaryInfo

参数

参数类型

描述

analysis_results

表5 objects

参数解释:

分析结果列表。

取值范围:

不涉及。

表5 HealthReportAnalysisResult

参数

参数类型

描述

risk_code

String

参数解释:

风险点编码。

取值范围:

不涉及。

risk_level

String

参数解释:

风险点级别。

取值范围:

不涉及。

risk_content

String

参数解释:

风险点内容。

取值范围:

不涉及。

reasons

表6 objects

参数解释:

可能原因列表。

取值范围:

不涉及。

表6 HealthReportRiskReason

参数

参数类型

描述

reason_code

String

参数解释:

可能原因编码。

取值范围:

不涉及。

reason_content

String

参数解释:

可能原因内容。

取值范围:

不涉及。

suggestions

Array of 表7 objects

参数解释:

建议优化措施列表。

取值范围:

不涉及。

表7 HealthReportRiskSuggestion

参数

参数类型

描述

suggestion_code

String

参数解释:

建议优化措施编码。

取值范围:

不涉及。

suggestion_content

String

参数解释:

建议优化措施。

取值范围:

不涉及。

表8 HealthReportInstanceInfo

参数

参数类型

描述

tenant_id

String

参数解释:

账号ID。

取值范围:

不涉及。

project_id

String

参数解释:

项目ID。

取值范围:

不涉及。

instance_id

String

参数解释:

实例ID。

取值范围:

不涉及。

master_node_id

String

参数解释:

主节点ID。

取值范围:

不涉及。

instance_name

String

参数解释:

实例名称。

取值范围:

不涉及。

cpu

Integer

参数解释:

实例CPU核数。

取值范围:

不涉及。

mem

Integer

参数解释:

实例内存大小。

取值范围:

不涉及。

disk_size

Integer

参数解释:

磁盘大小。

取值范围:

不涉及。

disk_type

String

参数解释:

磁盘类型。

取值范围:

不涉及。

engine

String

参数解释:

实例引擎类型。

取值范围:

不涉及。

engine_version

String

参数解释:

引擎内核版本。

取值范围:

不涉及。

表9 HealthReportPerformanceStat

参数

参数类型

描述

peak_stats

Array of 表11 objects

参数解释:

峰值统计信息列表。

取值范围:

不涉及。

ratio_stats

Array of 表12 objects

参数解释:

比率值数据列表。

取值范围:

不涉及。

analyze_success

Boolean

参数解释:

统计分析是否成功。

取值范围:

不涉及。

error_message

String

参数解释:

错误信息。

取值范围:

不涉及。

表10 HealthReportDiskStat

参数

参数类型

描述

peak_stats

Array of 表11 objects

参数解释:

峰值统计信息列表。

取值范围:

不涉及。

ratio_stats

Array of 表12 objects

参数解释:

比率值数据列表。

取值范围:

不涉及。

analyze_success

Boolean

参数解释:

统计分析是否成功。

取值范围:

不涉及。

error_message

String

参数解释:

错误信息。

取值范围:

不涉及。

表11 HealthReportSingleValueStat

参数

参数类型

描述

metric

String

参数解释:

指标名。

取值范围:

不涉及。

value

Double

参数解释:

数值。

取值范围:

不涉及。

max_value

Double

参数解释:

最大值。

取值范围:

不涉及。

normalized

Double

参数解释:

归一化值。

取值范围:

不涉及。

stage

String

参数解释:

当前状态。

取值范围:

不涉及。

timestamp

Long

参数解释:

指标采集时间。

取值范围:

不涉及。

表12 HealthReportRatioStat

参数

参数类型

描述

metric

String

参数解释:

指标名。

取值范围:

不涉及。

max_value

Double

参数解释:

最大值。

取值范围:

不涉及。

critical_ratio

Double

参数解释:

高水位占比。

取值范围:

不涉及。

medium_ratio

Double

参数解释:

中水位占比。

取值范围:

不涉及。

light_ratio

Double

参数解释:

低水位占比。

取值范围:

不涉及。

表13 HealthReportTableSpaceStat

参数

参数类型

描述

size_top

Array of 表14 objects

参数解释:

表大小Top列表。

取值范围:

不涉及。

rows_top

Array of 表14 objects

参数解释:

表行数量Top列表。

取值范围:

不涉及。

size_incr_top

Array of 表15 objects

参数解释:

表大小增长Top列表。

取值范围:

不涉及。

rows_incr_top

Array of 表15 objects

参数解释:

表行数量增长Top列表。

取值范围:

不涉及。

analyze_success

Boolean

参数解释:

统计分析是否成功。

取值范围:

不涉及。

error_message

String

参数解释:

错误信息。

取值范围:

不涉及。

表14 HealthReportTableSpaceInfo

参数

参数类型

描述

database

String

参数解释:

数据库名。

取值范围:

不涉及。

table

String

参数解释:

表名。

取值范围:

不涉及。

db_engine

String

参数解释:

数据库引擎。

取值范围:

不涉及。

table_size

Long

参数解释:

表大小。

取值范围:

不涉及。

data_size

Long

参数解释:

数据大小。

取值范围:

不涉及。

index_size

Long

参数解释:

索引大小。

取值范围:

不涉及。

rows

Long

参数解释:

行数量。

取值范围:

不涉及。

表15 HealthReportTableSpaceIncrInfo

参数

参数类型

描述

database

String

参数解释:

数据库名。

取值范围:

不涉及。

table

String

参数解释:

表名。

取值范围:

不涉及。

increment

Long

参数解释:

增长量。

取值范围:

不涉及。

analyze_success

Boolean

参数解释:

统计分析是否成功。

取值范围:

不涉及。

error_message

String

参数解释:

错误信息。

取值范围:

不涉及。

表16 HealthReportSlowLogStat

参数

参数类型

描述

collect_slow_log

Boolean

参数解释:

是否收集慢SQL。

取值范围:

不涉及。

top_execute_slow_logs

Array of 表18 objects

参数解释:

慢SQL Top执行次数列表。

取值范围:

不涉及。

top_avg_query_time_slow_logs

Array of 表18 objects

参数解释:

慢SQL Top平均执行时间列表。

取值范围:

不涉及。

top_max_query_time_slow_logs

Array of 表18 objects

参数解释:

慢SQL Top最大执行时间列表。

取值范围:

不涉及。

rows_examined_exceeding

Array of 表18 objects

参数解释:

慢SQL Top扫描返回比列表。

取值范围:

不涉及。

analyze_success

Boolean

参数解释:

统计分析是否成功。

取值范围:

不涉及。

error_message

String

参数解释:

错误信息。

取值范围:

不涉及。

表17 HealthReportFullSqlStat

参数

参数类型

描述

collect_full_sql

Boolean

参数解释:

是否收集全量SQL。

取值范围:

不涉及。

execute_top_templates

Array of 表18 objects

参数解释:

全量SQL Top总执行次数列表。

取值范围:

不涉及。

sum_rows_examined_top_templates

Array of 表18 objects

参数解释:

全量SQL Top总扫描行数列表。

取值范围:

不涉及。

avg_cost_top_templates

Array of 表18 objects

参数解释:

全量SQL Top平均执行耗时列表。

取值范围:

不涉及。

analyze_success

Boolean

参数解释:

统计分析是否成功。

取值范围:

不涉及。

error_message

String

参数解释:

错误信息。

取值范围:

不涉及。

表18 HealthReportSqlTemplate

参数

参数类型

描述

template_id

String

参数解释:

模板ID。

取值范围:

不涉及。

template

String

参数解释:

模板内容。

取值范围:

不涉及。

databases

Array of strings

参数解释:

数据库列表。

取值范围:

不涉及。

times

Long

参数解释:

执行次数。

取值范围:

不涉及。

avg_query_time

Double

参数解释:

平均执行时间。

取值范围:

不涉及。

max_query_time

Double

参数解释:

最大执行时间。

取值范围:

不涉及。

avg_rows_examined

Double

参数解释:

平均扫描行数。

取值范围:

不涉及。

max_rows_examined

Double

参数解释:

最大扫描行数。

取值范围:

不涉及。

sum_rows_examined

Double

参数解释:

总扫描行数。

取值范围:

不涉及。

avg_rows_sent

Double

参数解释:

平均返回行数。

取值范围:

不涉及。

max_rows_sent

Double

参数解释:

最大返回行数。

取值范围:

不涉及。

表19 HealthReportInspectionStat

参数

参数类型

描述

inspection_score

Array of 表20 objects

参数解释:

巡检评分。

取值范围:

不涉及。

analyze_success

Boolean

参数解释:

统计分析是否成功。

取值范围:

不涉及。

error_message

String

参数解释:

错误信息。

取值范围:

不涉及。

表20 HealthReportInspectionScore

参数

参数类型

描述

score

Double

参数解释:

得分。

取值范围:

不涉及。

critical

Integer

参数解释:

严重事件。

取值范围:

不涉及。

medium

Integer

参数解释:

警告事件。

取值范围:

不涉及。

light

Integer

参数解释:

优化事件。

取值范围:

不涉及。

cpu_usage

Double

参数解释:

CPU使用率。

取值范围:

不涉及。

mem_usage

Double

参数解释:

内存使用率。

取值范围:

不涉及。

space_usage

Double

参数解释:

空间使用率。

取值范围:

不涉及。

connection_rate

Double

参数解释:

连接使用率。

取值范围:

不涉及。

iops_usage

Double

参数解释:

IOPS使用率。

取值范围:

不涉及。

thread_running

Double

参数解释:

活跃会话。

取值范围:

不涉及。

slow_sql_total

Long

参数解释:

慢SQL数量。

取值范围:

不涉及。

lost_points_detail_list

Array of 表21 objects

参数解释:

扣分详情。

取值范围:

不涉及。

表21 HealthReportLostPointsDetail

参数

参数类型

描述

metric

String

参数解释:

扣分项。

取值范围:

不涉及。

lost_points

Double

参数解释:

所扣分数。

取值范围:

不涉及。

risk_level

String

参数解释:

事件等级。

取值范围:

不涉及。

请求示例

GET https://das.cn-north-1.myhuaweicloud.com/v3/054e292c9880d4992f02c0196d3ea468/health-report/bcfa975193f1402fa11a6d4fd6baf5fbin01/get-instance-health-report?task_id=f407d4c9-8915-4e08-86c1-ca569912ad20 

响应示例

状态码: 200

Success.

{
 "success": true,
 "start_at": 1782792000000,
 "end_at": 1782878400000,
 "summary_info": {
  "health_rank": "sub_healthy",
  "analysis_results": [
   {
    "risk_code": "SLOW_LOG_ISSUE",
    "risk_level": "WARNING",
    "risk_content": "慢SQL问题",
    "reasons": [
     {
      "reason_code": "SLOW_LOG_EXIST",
      "reason_content": "存在慢SQL",
      "suggestions": [
       {
        "suggestion_code": "SCALE_UP_INSTANCE",
        "suggestion_content": "升级实例规格"
       },
       {
        "suggestion_code": "ANALYZE_SLOW_LOG",
        "suggestion_content": "分析慢SQL查找问题根源"
       }
      ]
     }
    ]
   }
  ]
 },
 "instance_info": {
  "tenant_id": "05204146e600d48f0f02c002850ec340",
  "project_id": "052041494800d57c2f02c00275b4c247",
  "instance_id": "bcfa975193f1402fa11a6d4fd6baf5fbin01",
  "instance_name": "rds-sql-勿删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": "mem_usage",
    "max_value": 100,
    "critical_ratio": 0,
    "medium_ratio": 0,
    "light_ratio": 1
   }
  ]
 },
 "disk_stat": {
  "analyze_success": true,
  "peak_stats": [
   {
    "metric": "disk_read_throughput",
    "max_value": 367001600,
    "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": "AAD913807ECE9C66",
    "template": "SELECT sleep(?)",
    "databases": [
     "czh_test",
     "----------"
    ],
    "times": 290,
    "avg_query_time": 10,
    "max_query_time": 10,
    "avg_rows_examined": 0,
    "sum_rows_examined": 0,
    "avg_rows_sent": 1
   }
  ],
  "top_avg_query_time_slow_logs": [
   {
    "template_id": "AAD913807ECE9C66",
    "template": "SELECT sleep(?)",
    "databases": [
     "czh_test",
     "----------"
    ],
    "times": 290,
    "avg_query_time": 10,
    "max_query_time": 10,
    "avg_rows_examined": 0,
    "sum_rows_examined": 0,
    "avg_rows_sent": 1
   }
  ],
  "top_max_query_time_slow_logs": [
   {
    "template_id": "AAD913807ECE9C66",
    "template": "SELECT sleep(?)",
    "databases": [
     "czh_test",
     "----------"
    ],
    "times": 290,
    "avg_query_time": 10,
    "max_query_time": 10,
    "avg_rows_examined": 0,
    "sum_rows_examined": 0,
    "avg_rows_sent": 1
   }
  ],
  "rows_examined_exceeding": []
 },
 "full_sql_stat": {
  "analyze_success": true,
  "collect_full_sql": true,
  "execute_top_templates": [
   {
    "template_id": "F045E61DB57E83A3",
    "template": "SHOW GLOBAL STATUS LIKE ?",
    "databases": [
     "cpu_high_test",
     "db_f6c3_0003",
     "drop",
     "test_yrb_test0911",
     "testlocal",
     "aaaaa",
     "czh_test",
     "d_big_data",
     "db",
     "db_f6c3_0001"
    ],
    "times": 3618,
    "avg_query_time": 0.58,
    "avg_rows_examined": 854,
    "sum_rows_examined": 3089772
   }
  ]
 },
 "inspection_stat": {
  "analyze_success": true,
  "inspection_score": [
   {
    "score": 89.6667,
    "critical": 0,
    "medium": 1,
    "light": 0,
    "cpu_usage": 4.56,
    "mem_usage": 30.73,
    "space_usage": 30.26,
    "connection_rate": 0.73,
    "iops_usage": 0.09,
    "thread_running": 5,
    "slow_sql_total": 290,
    "lost_points_detail_list": [
     {
      "metric": "cpuUsage",
      "lost_points": 0,
      "risk_level": "NORMAL"
     }
    ]
   }
  ]
 },
 "suffix_uri": "#/das/dba/manageIns/bcfa975193f1402fa11a6d4fd6baf5fbin01/reports?engineType=mysql&taskId=bb6387f5-42da-4f24-bcf8-13417362d75a&startAt=1782792000000&endAt=1782878400000"
}

状态码

状态码

描述

200

Success.

400

Client error.

500

Server error.

错误码

请参见错误码

相关文档