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.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
hdm:GetInstanceInspections | get |
|
| 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 parameters
Examples
Sample success responses
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 |
---|---|---|
400 | InvalidParams | The request parameters are invalid. |
403 | NoPermission | You are not authorized to do this action. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2022-11-07 | The response structure of the API has changed | View Change Details |
2022-10-28 | The response structure of the API has changed | View Change Details |