All Products
Search
Document Center

Database Autonomy Service:GetInstanceInspections

Last Updated:Mar 13, 2026

Queries the result of an inspection that is performed on a database instance by using the inspection and scoring feature.

Operation description

Database Autonomy Service (DAS) provides the inspection and scoring feature. This feature allows you to inspect and score the health status of your instance on a regular basis. This helps you obtain information about the status of your databases. For more information, see Inspection and scoring.

Before you call this operation, take note of the following items:

  • This operation is applicable only to ApsaraDB RDS for MySQL databases, self-managed MySQL databases hosted on Elastic Compute Service (ECS) instances, self-managed MySQL databases in data centers, ApsaraDB for Redis databases, and PolarDB for MySQL databases.

  • If you use an Alibaba Cloud SDK, make sure that the aliyun-sdk-core version is later than V4.3.3. We recommend that you use the latest version.

  • The version of DAS SDK must be V1.0.3 or later.

  • If you use an SDK to call operations of DAS, you must set the region ID to cn-shanghai.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

hdm:GetInstanceInspections

get

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Engine

string

Yes

The database engine. Valid values:

  • MySQL

  • Redis

  • PolarDBMySQL

MySQL

StartTime

string

Yes

The beginning of the time range to query. Set this parameter to a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

1655416825000

EndTime

string

Yes

The end of the time range to query. Set this parameter to a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

Note

The end time must be later than the start time.

1655427625000

PageNo

string

Yes

The page number. The value must be a positive integer. Default value: 1.

1

PageSize

string

Yes

The number of entries per page. Default value: 10.

10

InstanceArea

string

Yes

The type of the instance on which the database is deployed. Valid values:

  • RDS: an Alibaba Cloud database instance.

  • ECS: an ECS instance on which a self-managed database is deployed.

  • IDC: a self-managed database instance that is not deployed on Alibaba Cloud.

Note

The value IDC specifies that the instance is deployed in a data center.

RDS

SearchMap

string

No

The filter condition, which can be specified in one of the following formats:

  • Specify the ID of a single instance in the {"InstanceId":"Instance ID"} format.

  • Specify the IDs of multiple instances in the {"InstanceIds":["Instance ID1","Instance ID2"]} format. Separate the instance IDs with commas (,).

  • Specify the region in which the instance resides in the {"region":"Region of the instance"} format.

{"InstanceId":"rm-bp10usoc1erj7****"}

ResourceGroupId

string

No

The resource group ID.

rg-aek2eil6npi****

Response elements

Element

Type

Description

Example

object

Message

string

The returned message.

Note

If the request was successful, Successful is returned. If the request failed, an error message such as an error code is returned.

Successful

RequestId

string

The request ID.

B6D17591-B48B-4D31-9CD6-9B9796B2****

Data

object

The details.

List

array<object>

The detailed information.

array<object>

EndTime

integer

The end time of the inspection and scoring task. The value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

Note

The end time must be later than the start time.

1608888296001

StartTime

integer

The start time of the inspection and scoring task. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

1608888296000

Data

object

The data returned.

"data": { "hasDeadLock": false, "exceptionTableMap": {}, "bigTransactionCount": 0, "cpu": 4, "isRds": true, "rdsEnable": true, "enable": false, "activeSessions": [], "bigTransactionList": [], "bigSessionList": [ { "blockDuration": 0, "active": false, "Time": 0, "db": "" },

Instance

object

The information about the instance.

VpcId

string

The ID of the virtual private cloud (VPC) in which the instance is deployed.

vpc-bp1knt7m55z9exoo7****

Uuid

string

The unique identifier of the instance.

hdm_3063db6792965c080a4bcb6e6304****

InstanceArea

string

The type of the instance on which the database is deployed. Valid values:

  • RDS: an Alibaba Cloud database instance.

  • ECS: an Elastic Compute Service (ECS) instance on which a self-managed database is deployed.

  • IDC: a self-managed database instance that is not deployed on Alibaba Cloud.

Note

The value IDC indicates that the instance is deployed in a data center.

RDS

InstanceClass

string

The instance type.

rds.mysql.s2.xlarge

Region

string

The region ID of the instance.

cn-hangzhou

AccountId

string

The account ID. You can view the ID of the logon account by moving the pointer over the profile in the Alibaba Cloud management console.

108398049688****

NetworkType

string

The network type of the instance.

VPC

Engine

string

The database engine. Valid values:

  • MySQL

  • Redis

  • PolarDBMySQL

MySQL

InstanceId

string

The instance ID.

rm-bp10usoc1erj7****

NodeId

string

The ID of the node on the instance.

rm-bp10usoc1erj7****

EngineVersion

string

The version number of the database engine.

8.0

InstanceAlias

string

The instance name.

test-01

Cpu

string

The CPU specification of the instance. For example, if a value of 8 is returned, the instance has eight CPU cores.

8

Memory

integer

The memory capacity of the database that is deployed on the instance. Unit: MB.

32768

Storage

integer

The storage space of the instance. Unit: GB.

150

Category

string

The connection mode of the instance. Valid values:

  • standard: standard mode.

  • safe: database proxy mode.

standard

ScoreMap

object

The scores that are deducted for the instance.

GmtCreate

integer

The time when the task was created. The value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

1603247192000

Score

integer

The inspection score of the instance.

100

AutoFunction

object

Indicates whether the autonomy service is enabled.

EventSubscription

integer

Indicates whether the event subscription feature is enabled. Valid values:

  • 0: disabled.

  • 1: enabled.

  • 2: not supported.

0

AutoIndex

integer

Indicates whether the feature of automatically creating and deleting indexes is enabled. Valid values:

  • 0: disabled.

  • 1: enabled.

  • 2: not supported.

2

AutoLimitedSql

integer

Indicates whether the automatic throttling feature is enabled. Valid values:

  • 0: disabled.

  • 1: enabled.

  • 2: not supported.

2

AutoResourceOptimize

integer

Indicates whether the automatic fragment recycling feature is enabled. Valid values:

  • 0: disabled.

  • 1: enabled.

  • 2: not supported.

0

AutoScale

integer

Indicates whether the auto scaling feature is enabled. Valid values:

  • 0: disabled.

  • 1: enabled.

  • 2: not supported.

0

EnableDasPro

integer

Indicates whether DAS Enterprise Edition is enabled. Valid values:

  • 0: disabled.

  • 1: enabled.

  • 2: not supported.

0

State

integer

The state of the inspection and scoring task. Valid values:

  • 0: The task is waiting for execution.

  • 1: The task is in progress.

  • 2: The task is complete.

2

TaskType

integer

The mode in which the inspection and scoring task was initiated. Valid values:

  • 0: automatic mode.

  • 1: manual mode.

0

PageNo

integer

The page number. The value returned is a positive integer. Default value: 1.

1

PageSize

integer

The number of entries per page. Default value: 10.

10

Total

integer

The total number of entries returned.

4

Code

string

The HTTP status code returned.

200

Success

string

Indicates whether the request was successful. Valid values:

  • true

  • false

true

Examples

Success response

JSON format

{
  "Message": "Successful",
  "RequestId": "B6D17591-B48B-4D31-9CD6-9B9796B2****",
  "Data": {
    "List": [
      {
        "EndTime": 1608888296001,
        "StartTime": 1608888296000,
        "Data": {
          "test": "test",
          "test2": 1
        },
        "Instance": {
          "VpcId": "vpc-bp1knt7m55z9exoo7****",
          "Uuid": "hdm_3063db6792965c080a4bcb6e6304****",
          "InstanceArea": "RDS",
          "InstanceClass": "rds.mysql.s2.xlarge",
          "Region": "cn-hangzhou",
          "AccountId": "108398049688****",
          "NetworkType": "VPC",
          "Engine": "MySQL",
          "InstanceId": "rm-bp10usoc1erj7****",
          "NodeId": "rm-bp10usoc1erj7****",
          "EngineVersion": "8.0",
          "InstanceAlias": "test-01",
          "Cpu": "8",
          "Memory": 32768,
          "Storage": 150,
          "Category": "standard"
        },
        "ScoreMap": {
          "test": "test",
          "test2": 1
        },
        "GmtCreate": 1603247192000,
        "Score": 100,
        "AutoFunction": {
          "EventSubscription": 0,
          "AutoIndex": 2,
          "AutoLimitedSql": 2,
          "AutoResourceOptimize": 0,
          "AutoScale": 0
        },
        "EnableDasPro": 0,
        "State": 2,
        "TaskType": 0
      }
    ],
    "PageNo": 1,
    "PageSize": 10,
    "Total": 4
  },
  "Code": "200",
  "Success": "true"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParams The request parameters are invalid.
403 NoPermission You are not authorized to do this action.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.