Consulta o resultado de uma inspeção realizada em uma instância de banco de dados usando o recurso de inspeção e pontuação.
Descrição da operação
O Database Autonomy Service (DAS) fornece o recurso de inspeção e pontuação. Esse recurso permite inspecionar e pontuar o status de integridade da sua instância regularmente. Isso ajuda a obter informações sobre o status dos seus bancos de dados. Para mais informações, consulte Inspeção e pontuação.
Antes de chamar esta operação, observe os seguintes itens:
-
Esta operação é aplicável apenas a bancos de dados ApsaraDB RDS for MySQL, bancos de dados MySQL autogerenciados hospedados em instâncias do Elastic Compute Service (ECS), bancos de dados MySQL autogerenciados em data centers, bancos de dados ApsaraDB for Redis e bancos de dados PolarDB for MySQL.
-
Se você usar um SDK do Alibaba Cloud, certifique-se de que a versão do aliyun-sdk-core seja posterior à V4.3.3. Recomendamos o uso da versão mais recente.
-
A versão do SDK do DAS deve ser V1.0.3 ou posterior.
-
Se você usar um SDK para chamar operações do DAS, deverá definir o ID da região como cn-shanghai.
Experimente agora
Testar
Autorização RAM
|
Ação |
Nível de acesso |
Tipo de recurso |
Chave de condição |
Ação dependente |
|
hdm:GetInstanceInspections |
get |
*All Resource
|
Nenhuma | Nenhuma |
Parâmetros da solicitação
|
Parâmetro |
Tipo |
Obrigatório |
Descrição |
Exemplo |
| Engine |
string |
Sim |
O mecanismo do banco de dados. Valores válidos:
|
MySQL |
| StartTime |
string |
Sim |
O início do intervalo de tempo a ser consultado. Defina este parâmetro como um carimbo de data/hora UNIX que representa o número de milissegundos decorridos desde 1 de janeiro de 1970, 00:00:00 UTC. |
1655416825000 |
| EndTime |
string |
Sim |
O fim do intervalo de tempo a ser consultado. Defina este parâmetro como um carimbo de data/hora UNIX que representa o número de milissegundos decorridos desde 1 de janeiro de 1970, 00:00:00 UTC. Nota
O horário de término deve ser posterior ao horário de início. |
1655427625000 |
| PageNo |
string |
Sim |
O número da página. O valor deve ser um número inteiro positivo. Valor padrão: 1. |
1 |
| PageSize |
string |
Sim |
O número de entradas por página. Valor padrão: 10. |
10 |
| InstanceArea |
string |
Sim |
O tipo da instância na qual o banco de dados está implantado. Valores válidos:
Nota
O valor IDC especifica que a instância está implantada em um data center. |
RDS |
| SearchMap |
string |
Não |
A condição de filtro, que pode ser especificada em um dos seguintes formatos:
|
{"InstanceId":"rm-bp10usoc1erj7****"} |
| ResourceGroupId |
string |
Não |
O ID do grupo de recursos. |
rg-aek2eil6npi**** |
Elementos de resposta
|
Elemento |
Tipo |
Descrição |
Exemplo |
|
object |
Os parâmetros de resposta. |
||
| Message |
string |
A mensagem retornada. Nota
Se a solicitação for bem-sucedida, Successful será retornado. Se a solicitação falhar, uma mensagem de erro, como um código de erro, será retornada. |
Successful |
| RequestId |
string |
O ID da solicitação. |
B6D17591-B48B-4D31-9CD6-9B9796B2**** |
| Data |
object |
Os detalhes. |
|
| List |
array<object> |
As informações detalhadas. |
|
|
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. Nota
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:
Nota
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 |
O número da página. O valor retornado é um número inteiro positivo. Valor padrão: 1. |
1 |
| PageSize |
integer |
O número de entradas por página. Valor padrão: 10. |
10 |
| Total |
integer |
O número total de entradas retornadas. |
4 |
| Code |
string |
O código de status HTTP retornado. |
200 |
| Success |
string |
Indica se a solicitação foi bem-sucedida. Valores válidos:
|
true |
Exemplos
Resposta de sucesso
JSON formato
{
"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"
}
Códigos de erro
|
Código de status HTTP |
Código de erro |
Mensagem de erro |
Descrição |
|---|---|---|---|
| 400 | InvalidParams | The request parameters are invalid. | |
| 403 | NoPermission | You are not authorized to do this action. |
Consulte Códigos de Erro para uma lista completa.
Notas de versão
Consulte Notas de Versão para uma lista completa.