Help Center/ Data Admin Service/ API Reference/ APIs (in OBT)/ Intelligent O&M/ Obtaining an Instance Diagnosis Report
Updated on 2026-01-20 GMT+08:00

Obtaining an Instance Diagnosis Report

Function

This API is used to obtain an instance diagnosis 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:listDailyReports

    List

    Instance

    -

    das:clouddba:dailyReportsList

    -

URI

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

Table 1 URI parameters

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, including only letters and digits.

Default Value

N/A

instance_id

Yes

String

Definition

Unique ID of an instance

Constraints

N/A

Range

The value can contain 32 characters, including only letters and digits.

Default Value

N/A

Table 2 Query parameters

Parameter

Mandatory

Type

Description

task_id

Yes

String

Definition

Task ID

Constraints

N/A

Range

N/A

Default Value

N/A

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

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

Table 4 HealthReportSummaryInfo

Parameter

Type

Description

analysis_results

Array of Table 5 objects

Definition

Analysis results

Range

N/A

Table 5 HealthReportAnalysisResult

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

Table 6 HealthReportRiskReason

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

Suggestions

Range

N/A

Table 7 HealthReportRiskSuggestion

Parameter

Type

Description

suggestion_code

String

Definition

Suggestion codes

Range

N/A

suggestion_content

String

Definition

Suggestions

Range

N/A

Table 8 HealthReportInstanceInfo

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

  • SATA: common I/O disk
  • SAS: high I/O disk
  • SSD: ultra-high I/O disk

engine

String

Definition

DB engine

Range

N/A

engine_version

String

Definition

DB engine kernel version

Range

N/A

Table 9 HealthReportPerformanceStat

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

Table 10 HealthReportDiskStat

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

Table 11 HealthReportSingleValueStat

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

Table 12 HealthReportRatioStat

Parameter

Type

Description

metric

String

Definition

Metric name

Range

N/A

max_value

Double

Definition

Maximum value

Range

N/A

critical_ratio

Double

Definition

Critical ratio

Range

N/A

medium_ratio

Double

Definition

Medium ratio

Range

N/A

light_ratio

Double

Definition

Light ratio

Range

N/A

Table 13 HealthReportTableSpaceStat

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

Table 14 HealthReportTableSpaceInfo

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 size

Range

N/A

index_size

Long

Definition

Index size

Range

N/A

rows

Long

Definition

Number of rows

Range

N/A

Table 15 HealthReportTableSpaceIncrInfo

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

Table 16 HealthReportSlowLogStat

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 executed

Range

N/A

top_avg_query_time_slow_logs

Array of Table 18 objects

Definition

Top slow SQL queries taking average time

Range

N/A

top_max_query_time_slow_logs

Array of Table 18 objects

Definition

Top slow SQL queries taking longest

Range

N/A

rows_examined_exceeding

Array of Table 18 objects

Definition

Top slow SQL queries which return rows

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

Table 17 HealthReportFullSqlStat

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 executed

Range

N/A

sum_rows_examined_top_templates

Array of Table 18 objects

Definition

Top rows scanned for all SQL queries

Range

N/A

avg_cost_top_templates

Array of Table 18 objects

Definition

Top average execution durations of all SQL queries

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

Table 18 HealthReportSqlTemplate

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

Table 19 HealthReportInspectionStat

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

Table 20 HealthReportInspectionScore

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

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

Table 21 HealthReportLostPointsDetail

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

Obtaining an instance diagnosis report

GET https://das.cn-north-7.myhuaweicloud.com/v3/052041494800d57c2f02c00275b4c247/instances/bcfa975193f1402fa11a6d4fd6baf5fbin01/get-instance-health-report?task_id=bb252ed0-3d06-489a-a662-6609e054e91c

Example Responses

Status code: 200

Successful response

{ 
  "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": "Slow SQL queries",
        "suggestions" : [ { 
          "suggestion_code" : "ANALYZE_SLOW_LOG", 
           "suggestion_content":"Analyzes slow SQL statements to locate 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

Successful response

400

Client error

500

Server error

Error Codes

See Error Codes.