GetInstanceInspections

Updated at:

Queries the inspection and scoring results of database instances.

Operation description

Database Autonomy Service (DAS) supports the inspection and scoring feature. This feature performs regular inspections on target instances and provides health scores to help you understand the database running status. For more information, see Inspection and scoring.

Before you call this operation, ensure that the following prerequisites are met:

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

  • If you use the Alibaba Cloud SDK, ensure that the version of aliyun-sdk-core is later than 4.3.3. Use the latest version.

  • The version of the DAS SDK is 1.0.3 or later.

  • When you use the SDK to call DAS, set the region 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

  • PolarDB MySQL

MySQL

StartTime

string

Yes

The start time of the task. The value is a UNIX timestamp in milliseconds.

1655416825000

EndTime

string

Yes

The end time of the task. The value is a UNIX timestamp in milliseconds.

Note

The end time must be later than the start time.

1655427625000

PageNo

string

Yes

The page number. The value must be an integer greater than 0 and less than or equal to the maximum value of the Integer data type. Default value: 1.

1

PageSize

string

Yes

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

10

InstanceArea

string

Yes

The database service to which the instance belongs. Valid values:

  • RDS: cloud instances.

  • ECS: self-managed instances on ECS instances.

  • IDC: self-managed instances in data centers.

Note

IDC refers to a user data center.

RDS

SearchMap

string

No

The filter conditions. You can filter data based on the following conditions:

  • To filter by a single instance ID, use the following format: {"InstanceId":"Instance ID"}.

  • To filter by multiple instance IDs, use the following format: {"InstanceIds":["Instance ID 1","Instance ID 2"]}. Separate multiple instance IDs with commas (,).

  • To filter by the region where the instance is located, use the following format: {"region":"Region ID"}.

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

ResourceGroupId

string

No

The ID of the resource group.

rg-aek2eil6npi****

Response elements

Element

Type

Description

Example

object

Message

string

The returned message.

Note

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

Successful

RequestId

string

The ID of the request.

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

Data

object

The details.

List

array<object>

The list of details.

array<object>

EndTime

integer

The end time of the task. The value is a UNIX timestamp in milliseconds.

Note

The end time must be later than the start time.

1608888296001

StartTime

integer

The start time of the task. The value is a UNIX timestamp in milliseconds.

1608888296000

Data

object

The returned data.

{}

Instance

object

The instance information.

VpcId

string

The VPC ID of the instance.

vpc-bp1knt7m55z9exoo7****

Uuid

string

The UUID of the instance.

hdm_3063db6792965c080a4bcb6e6304****

InstanceArea

string

The database service to which the instance belongs. Valid values:

  • RDS: cloud instances.

  • ECS: self-managed instances on ECS instances.

  • IDC: self-managed instances in data centers.

Note

IDC refers to a user 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 obtain the logon account ID on the Security Settings page of Account Management 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 node ID of the instance.

rm-bp10usoc1erj7****

EngineVersion

string

The database engine version.

8.0

InstanceAlias

string

The instance name.

test-01

Cpu

string

The CPU specifications. For example, a value of 8 indicates 8 CPU cores.

8

Memory

integer

The memory size of the database. Unit: MB.

32768

Storage

integer

The storage capacity. Unit: GB.

150

Category

string

The access mode of the instance. Valid values:

  • standard: standard access mode.

  • safe: database proxy mode.

standard

ScoreMap

object

The details of score deductions.

{ "BigTable": { "score": -8, "metric": "BigTable", "module": "InstanceStorage" }, "SlowLogDanger": { "score": -30, "metric": "SlowLogDanger", "module": "InstanceSql" }, "ThreadRunningWarning": { "score": -3, "metric": "ThreadRunningWarning", "module": "ThreadRunning" } }

GmtCreate

integer

The creation time of the task. The value is a UNIX timestamp in milliseconds.

1603247192000

Score

integer

The inspection score.

100

AutoFunction

object

The enabling status of autonomy features.

EventSubscription

integer

The event subscription status. Valid values:

  • 0: Disabled.

  • 1: Enabled.

  • 2: Not supported.

0

AutoIndex

integer

The auto index creation and deletion status. Valid values:

  • 0: Disabled.

  • 1: Enabled.

  • 2: Not supported.

2

AutoLimitedSql

integer

The automatic SQL throttling status. Valid values:

  • 0: Disabled.

  • 1: Enabled.

  • 2: Not supported.

2

AutoResourceOptimize

integer

The automatic fragment reclamation status. Valid values:

  • 0: Disabled.

  • 1: Enabled.

  • 2: Not supported.

0

AutoScale

integer

The automatic elastic scaling status. Valid values:

  • 0: Disabled.

  • 1: Enabled.

  • 2: Not supported.

0

EnableDasPro

integer

The DAS Enterprise Edition status. Valid values:

  • 0: Disabled.

  • 1: Enabled.

  • 2: Not supported.

0

State

integer

The inspection task status. Valid values:

  • 0: Pending execution.

  • 1: Executing.

  • 2: Inspection completed.

2

TaskType

integer

The initiation type of the inspection task. Valid values:

  • 0: Automatic.

  • 1: Manual.

0

PageNo

integer

The page number. The value must be an integer greater than 0 and less than or equal to the maximum value of the Integer data type. Default value: 1.

1

PageSize

integer

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

10

Total

integer

The total number of entries.

4

Code

string

The returned status code.

200

Success

string

Specifies whether the request was successful. Valid values:

  • true: Successful.

  • false: Failed.

true

Examples

Success response

JSON format

{
  "Message": "Successful",
  "RequestId": "B6D17591-B48B-4D31-9CD6-9B9796B2****",
  "Data": {
    "List": [
      {
        "EndTime": 1608888296001,
        "StartTime": 1608888296000,
        "Data": {},
        "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": {
          "BigTable": {
            "score": -8,
            "metric": "BigTable",
            "module": "InstanceStorage"
          },
          "SlowLogDanger": {
            "score": -30,
            "metric": "SlowLogDanger",
            "module": "InstanceSql"
          },
          "ThreadRunningWarning": {
            "score": -3,
            "metric": "ThreadRunningWarning",
            "module": "ThreadRunning"
          }
        },
        "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 request parameters are invalid.
403 NoPermission You are not authorized to do this action. You do not have the permission to perform this operation.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.