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
Test
RAM authorization
|
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 |
| 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:
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:
|
{"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:
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 |
| 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 |
| 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 |
| AutoIndex |
integer |
Indicates whether the feature of automatically creating and deleting indexes is enabled. Valid values:
|
2 |
| AutoLimitedSql |
integer |
Indicates whether the automatic throttling feature is enabled. Valid values:
|
2 |
| AutoResourceOptimize |
integer |
Indicates whether the automatic fragment recycling feature is enabled. Valid values:
|
0 |
| AutoScale |
integer |
Indicates whether the auto scaling feature is enabled. Valid values:
|
0 |
| EnableDasPro |
integer |
Indicates whether DAS Enterprise Edition is enabled. Valid values:
|
0 |
| State |
integer |
The state of the inspection and scoring task. Valid values:
|
2 |
| TaskType |
integer |
The mode in which the inspection and scoring task was initiated. Valid values:
|
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 |
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.