All Products
Search
Document Center

Database Autonomy Service:GetInstanceInspections

更新時間:Sep 25, 2024

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

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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.
OperationAccess levelResource typeCondition keyAssociated operation
hdm:GetInstanceInspectionsget
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
EnginestringYes

The database engine. Valid values:

  • MySQL
  • Redis
  • PolarDBMySQL
MySQL
StartTimestringYes

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
EndTimestringYes

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
PageNostringYes

The page number. The value must be a positive integer. Default value: 1.

1
PageSizestringYes

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

10
InstanceAreastringYes

The type of the instance on which the database is deployed. Valid values:

  • RDS: an Alibaba Cloud database instance.
  • ECS: an ECS instance on which a self-managed database is deployed.
  • IDC: a self-managed database instance that is not deployed on Alibaba Cloud.
Note The value IDC specifies that the instance is deployed in a data center.
RDS
SearchMapstringNo

The filter condition, which can be specified in one of the following formats:

  • Specify the ID of a single instance in the {"InstanceId":"Instance ID"} format.
  • Specify the IDs of multiple instances in the {"InstanceIds":["Instance ID1","Instance ID2"]} format. Separate the instance IDs with commas (,).
  • Specify the region in which the instance resides in the {"region":"Region of the instance"} format.
{"InstanceId":"rm-bp10usoc1erj7****"}
ResourceGroupIdstringNo

The resource group ID.

rg-aek2eil6npi****

Response parameters

ParameterTypeDescriptionExample
object
Messagestring

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
RequestIdstring

The request ID.

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

The details.

Listarray<object>

The detailed information.

BaseInspectionobject
EndTimelong

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
StartTimelong

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
Dataobject

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": "" },
Instanceobject

The information about the instance.

VpcIdstring

The ID of the virtual private cloud (VPC) in which the instance is deployed.

vpc-bp1knt7m55z9exoo7****
Uuidstring

The unique identifier of the instance.

hdm_3063db6792965c080a4bcb6e6304****
InstanceAreastring

The type of the instance on which the database is deployed. Valid values:

  • RDS: an Alibaba Cloud database instance.
  • ECS: an Elastic Compute Service (ECS) instance on which a self-managed database is deployed.
  • IDC: a self-managed database instance that is not deployed on Alibaba Cloud.
Note The value IDC indicates that the instance is deployed in a data center.
RDS
InstanceClassstring

The instance type.

rds.mysql.s2.xlarge
Regionstring

The region ID of the instance.

cn-hangzhou
AccountIdstring

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****
NetworkTypestring

The network type of the instance.

VPC
Enginestring

The database engine. Valid values:

  • MySQL
  • Redis
  • PolarDBMySQL
MySQL
InstanceIdstring

The instance ID.

rm-bp10usoc1erj7****
NodeIdstring

The ID of the node on the instance.

rm-bp10usoc1erj7****
EngineVersionstring

The version number of the database engine.

8.0
InstanceAliasstring

The instance name.

test-01
Cpustring

The CPU specification of the instance. For example, if a value of 8 is returned, the instance has eight CPU cores.

8
Memoryinteger

The memory capacity of the database that is deployed on the instance. Unit: MB.

32768
Storageinteger

The storage space of the instance. Unit: GB.

150
Categorystring

The connection mode of the instance. Valid values:

  • standard: standard mode.
  • safe: database proxy mode.
standard
ScoreMapobject

The scores that are deducted for the instance.

GmtCreatelong

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
Scoreinteger

The inspection score of the instance.

100
AutoFunctionobject

Indicates whether the autonomy service is enabled.

EventSubscriptioninteger

Indicates whether the event subscription feature is enabled. Valid values:

  • 0: disabled.
  • 1: enabled.
  • 2: not supported.
0
AutoIndexinteger

Indicates whether the feature of automatically creating and deleting indexes is enabled. Valid values:

  • 0: disabled.
  • 1: enabled.
  • 2: not supported.
2
AutoLimitedSqlinteger

Indicates whether the automatic throttling feature is enabled. Valid values:

  • 0: disabled.
  • 1: enabled.
  • 2: not supported.
2
AutoResourceOptimizeinteger

Indicates whether the automatic fragment recycling feature is enabled. Valid values:

  • 0: disabled.
  • 1: enabled.
  • 2: not supported.
0
AutoScaleinteger

Indicates whether the auto scaling feature is enabled. Valid values:

  • 0: disabled.
  • 1: enabled.
  • 2: not supported.
0
EnableDasProinteger

Indicates whether DAS Enterprise Edition is enabled. Valid values:

  • 0: disabled.
  • 1: enabled.
  • 2: not supported.
0
Stateinteger

The state of the inspection and scoring task. Valid values:

  • 0: The task is waiting for execution.
  • 1: The task is in progress.
  • 2: The task is complete.
2
TaskTypeinteger

The mode in which the inspection and scoring task was initiated. Valid values:

  • 0: automatic mode.
  • 1: manual mode.
0
PageNolong

The page number. The value returned is a positive integer. Default value: 1.

1
PageSizelong

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

10
Totallong

The total number of entries returned.

4
Codestring

The HTTP status code returned.

200
Successstring

Indicates whether the request was successful. Valid values:

  • true
  • false
true

Examples

Sample success responses

JSONformat

{
  "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 codeError codeError message
400InvalidParamsThe request parameters are invalid.
403NoPermissionYou are not authorized to do this action.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2022-11-07The response structure of the API has changedView Change Details
2022-10-28The response structure of the API has changedView Change Details