Queries the result of an inspection that is performed on a database instance by using the inspection and scoring feature.
Database Autonomy Service (DAS) provides the inspection and scoring feature. This feature allows you to inspect and score the health status of your instances 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, make sure that the following requirements are met:
- This operation is applicable only to ApsaraDB RDS for MySQL databases, self-managed MySQL databases on Elastic Compute Service (ECS) instances, self-managed MySQL databases in your data center, 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 4.3.3. We recommend that you use the latest version.
- The version of DAS SDK must be 1.0.3 or later.
- If you use an SDK to call DAS, you must set the region to cn-shanghai.
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | GetInstanceInspections | The operation that you want to perform. Set the value to GetInstanceInspections. |
Engine | String | Yes | MySQL | The database engine. Valid values:
|
StartTime | String | Yes | 1655416825000 | The start time of the inspection and scoring task. Specify the time in the UNIX timestamp format. Unit: milliseconds. |
EndTime | String | Yes | 1655427625000 | The end time of the inspection and scoring task. Specify the time in the UNIX timestamp format. Unit: milliseconds. Note The end time must be later than the start time. |
PageNo | String | Yes | 1 | The number of the page to return. Pages start from page 1. Default value: 1. |
PageSize | String | Yes | 10 | The maximum number of entries to return on each page. Default value: 10. |
InstanceArea | String | Yes | RDS | 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. |
SearchMap | String | No | {"InstanceId":"rm-bp10usoc1erj7****"} | The filter condition, which can be specified in one of the following formats:
|
ResourceGroupId | String | No | rg-aek2eil6npi**** | The ID of the resource group. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
Message | String | Successful | The message that is returned for the request. Note If the request is successful, Successful is returned. If the request fails, an error message that contains information such as an error code is returned. |
RequestId | String | B6D17591-B48B-4D31-9CD6-9B9796B2**** | The ID of the request. |
Data | Object | The details of the inspection and scoring result. |
|
List | Array of BaseInspection | The details of the inspection and scoring results. |
|
EndTime | Long | 1608888296001 | The end time of the inspection and scoring task. The time is a UNIX timestamp. Unit: milliseconds. Note The end time must be later than the start time. |
StartTime | Long | 1608888296000 | The start time of the inspection and scoring task. The time is a UNIX timestamp. Unit: milliseconds. |
Data | Map | The returned data. |
|
Instance | Object | The details of the instance. |
|
VpcId | String | vpc-bp1knt7m55z9exoo7**** | The ID of the virtual private cloud (VPC) in which the instance is deployed. |
Uuid | String | hdm_3063db6792965c080a4bcb6e6304**** | The unique identifier of the instance. |
InstanceArea | String | RDS | The type of the instance on which the database is deployed. Valid values:
|
InstanceClass | String | rds.mysql.s2.xlarge | The type of the instance. |
Region | String | cn-hangzhou | The region ID of the instance. |
AccountId | String | 108398049688**** | The ID of the account. You can obtain the ID of the logon account on the Security Settings page in the Alibaba Cloud account management center. |
NetworkType | String | VPC | The network type of the instance. |
Engine | String | MySQL | The database engine. Valid values:
|
InstanceId | String | rm-bp10usoc1erj7**** | The ID of the instance. |
NodeId | String | rm-bp10usoc1erj7**** | The ID of the node on the instance. |
EngineVersion | String | 8.0 | The version number of the database engine. |
InstanceAlias | String | test-01 | The name of the instance. |
Cpu | String | 8 | The CPU specification of the instance. For example, if the value 8 is returned, the instance has 8 CPU cores. |
Memory | Integer | 32768 | The memory capacity of the database that is deployed on the instance. Unit: MB. |
Storage | Integer | 150 | The storage space of the instance. Unit: GB. |
Category | String | standard | The connection mode of the instance. Valid values:
|
ScoreMap | Map | The details of the score deducted for the instance. |
|
GmtCreate | Long | 1603247192000 | The time when the task was created. The time is a UNIX timestamp. Unit: milliseconds. |
Score | Integer | 100 | The inspection score of the instance. |
AutoFunction | Object | Indicates whether the autonomy service is enabled. |
|
EventSubscription | Integer | 0 | Indicates whether the event subscription feature is enabled. Valid values:
|
AutoIndex | Integer | 2 | Indicates whether the automatic index creation and deletion feature is enabled. Valid values:
|
AutoLimitedSql | Integer | 2 | Indicates whether the automatic throttling feature is enabled. Valid values:
|
AutoResourceOptimize | Integer | 0 | Indicates whether automatic reclamation of fragments is enabled. Valid values:
|
AutoScale | Integer | 0 | Indicates whether the auto scaling feature is enabled. Valid values:
|
EnableDasPro | Integer | 0 | Indicates whether DAS Professional Edition is enabled. Valid values:
|
State | Integer | 2 | The state of the inspection and scoring task. Valid values:
|
TaskType | Integer | 0 | The mode in which the inspection and scoring task is initiated. Valid values:
|
PageNo | Long | 1 | The number of the returned page. Pages start from page 1. Default value: 1. |
PageSize | Long | 10 | The maximum number of entries returned per page. Default value: 10. |
Total | Long | 4 | The total number of entries returned. |
Code | String | 200 | The returned HTTP status code. |
Success | String | true | Indicates whether the request was successful. Valid values:
|
Examples
Sample requests
http(s)://das.cn-shanghai.aliyuncs.com/?Action=GetInstanceInspections
&Engine=MySQL
&StartTime=1655416825000
&EndTime=1655427625000
&PageNo=1
&PageSize=10
&InstanceArea=RDS
&SearchMap={"InstanceId":"rm-bp10usoc1erj7****"}
&ResourceGroupId=rg-aek2eil6npi****
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<GetInstanceInspectionsResponse>
<Message>Successful</Message>
<RequestId>B6D17591-B48B-4D31-9CD6-9B9796B2****</RequestId>
<Data>
<List>
<EndTime>1608888296001</EndTime>
<StartTime>1608888296000</StartTime>
<Instance>
<VpcId>vpc-bp1knt7m55z9exoo7****</VpcId>
<Uuid>hdm_3063db6792965c080a4bcb6e6304****</Uuid>
<InstanceArea>RDS</InstanceArea>
<InstanceClass>rds.mysql.s2.xlarge</InstanceClass>
<Region>cn-hangzhou</Region>
<AccountId>108398049688****</AccountId>
<NetworkType>VPC</NetworkType>
<Engine>MySQL</Engine>
<InstanceId>rm-bp10usoc1erj7****</InstanceId>
<NodeId>rm-bp10usoc1erj7****</NodeId>
<EngineVersion>8.0</EngineVersion>
<InstanceAlias>test-01</InstanceAlias>
<Cpu>8</Cpu>
<Memory>32768</Memory>
<Storage>150</Storage>
<Category>standard</Category>
</Instance>
<GmtCreate>1603247192000</GmtCreate>
<Score>100</Score>
<AutoFunction>
<EventSubscription>0</EventSubscription>
<AutoIndex>2</AutoIndex>
<AutoLimitedSql>2</AutoLimitedSql>
<AutoResourceOptimize>0</AutoResourceOptimize>
<AutoScale>0</AutoScale>
</AutoFunction>
<EnableDasPro>0</EnableDasPro>
<State>2</State>
<TaskType>0</TaskType>
</List>
<PageNo>1</PageNo>
<PageSize>10</PageSize>
<Total>4</Total>
</Data>
<Code>200</Code>
<Success>true</Success>
</GetInstanceInspectionsResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"Message" : "Successful",
"RequestId" : "B6D17591-B48B-4D31-9CD6-9B9796B2****",
"Data" : {
"List" : [ {
"EndTime" : 1608888296001,
"StartTime" : 1608888296000,
"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"
},
"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. | The error message returned because the specified request parameters are invalid. |
For a list of error codes, see Service error codes.