All Products
Search
Document Center

ApsaraDB RDS:DescribeDBInstances

Last Updated:Apr 17, 2024

Queries instances.

Operation description

Supported database engines

  • MySQL
  • PostgreSQL
  • SQL Server
  • MariaDB

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
rds:DescribeDBInstancesREAD
  • DBInstance
    acs:rds:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId}
  • rds:ResourceTag
none

Request parameters

ParameterTypeRequiredDescriptionExample
ClientTokenstringNo

The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

ETnLKlblzczshOTUbOCzxxxxxxx
proxyIdstringNo

A deprecated parameter. You do not need to configure this parameter.

API
EnginestringNo

The database engine of the instance. Valid values:

  • MySQL
  • SQLServer
  • PostgreSQL
  • MariaDB

By default, this operation returns the instances that run any of the supported database engines.

MySQL
ZoneIdstringNo

The zone ID of the instance.

cn-hangzhou-a
ResourceGroupIdstringNo

The ID of the resource group.

rg-acfmyxxxxx
DBInstanceStatusstringNo

The status of the instance. For more information, see Instance states.

Running
ExpiredstringNo

Specifies whether to query instances that have expired. Valid values:

  • True: queries instances that have expired.
  • False: does not query instances that have expired.
True
SearchKeystringNo

The keyword that is used for fuzzy search. The keyword can be part of an instance ID or an instance description.

rm-uf6w
DBInstanceIdstringNo

The instance ID.

rm-uf6wjk5xxxxxxx
DBInstanceTypestringNo

The role of the instance. Valid values:

  • Primary: primary instance
  • Readonly: read-only instance
  • Guard: disaster recovery instance
  • Temp: temporary instance

By default, this operation returns the instances that assume any of the supported roles.

Primary
RegionIdstringYes

The region ID. You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou
PageSizeintegerNo

The number of entries to return on each page. Valid values: 1 to 100.

Default value: 30.

30
PageNumberintegerNo

The page number. Valid values: any non-zero positive integer.

Default value: 1.

1
InstanceNetworkTypestringNo

The network type of the instance. Valid values:

  • VPC
  • Classic

By default, this operation returns the instances that reside in any of the supported network types.

Classic
VpcIdstringNo

The VPC ID.

vpc-uf6f7l4fg90xxxxxxxxxx
VSwitchIdstringNo

The vSwitch ID.

vsw-uf6adz52c2pxxxxxxxxxx
DBInstanceClassstringNo

The instance type of the instance. For information, see Primary ApsaraDB RDS instance types.

rds.mys2.small
EngineVersionstringNo

The database engine version.

5.7
PayTypestringNo

The billing method of the instance. Valid values:

  • Postpaid: pay-as-you-go
  • Prepaid: subscription
Postpaid
ConnectionModestringNo

The connection mode of the instance. Valid values:

  • Standard: standard mode
  • Safe: database proxy mode

By default, this operation queries the instances that use any of the supported connection modes.

Standard
TagsstringNo

The tag that is added to the instance. Each tag is a key-value pair that consists of two fields: TagKey and TagValue. You can specify a maximum of five tags in the following format for each request: {"key1":"value1","key2":"value2"...}.

{"key1":"value1"}
DedicatedHostGroupIdstringNo

The dedicated cluster ID.

dhg-7a9xxxxxxxx
DedicatedHostIdstringNo

The host ID of the instance in the dedicated cluster.

i-bpxxxxxxx
InstanceLevelintegerNo

Specifies whether to return the RDS edition of the instance by using the Category parameter. Valid values:

  • 0: returns the RDS edition of the instance.
  • 1: does not return the RDS edition of the instance.
0
ConnectionStringstringNo

The endpoint of the instance. You must specify this parameter only when you want to query a single instance.

rm-uf6wjk5xxxxxxx.mysql.rds.aliyuncs.com
NextTokenstringNo

The token that is used to display the next page. You must set this parameter to the value that is returned from the most recent call of the DescribeDBInstances operation for NextToken. If the returned entries are displayed on multiple pages, the next page can be displayed when you call this operation again with this parameter specified.

o7PORW5o2TJg**********
MaxResultsintegerNo

The number of entries to return per page. Valid values: 1 to 100.

Default value: 30.

Note If you specify this parameter, PageSize and PageNumber are unavailable.
30
FilterstringNo

The JSON string that consists of filter condition parameters and their values.

{"babelfishEnabled":"true"}
CategorystringNo

The RDS edition of the instance. Valid values:

  • Basic: RDS Basic Edition
  • HighAvailability: RDS High-availability Edition
  • cluster: RDS Cluster Edition
  • serverless_basic: RDS Serverless Basic Edition
cluster

You can use one of the following methods to check the response:

  • Method 1: Use MaxResults to specify the number of entries per page. Then, use NextToken to specify the token that is used to display the next page. NextToken is set to the value that is returned from the most recent call of the DescribeDBInstances operation for NextToken.
Note The first time you call the DescribeDBInstances operation to perform a paged query, you need only to specify MaxResults. In this case, the operation returns the data of the first page and the value of NextToken.
  • Method 2: Use PageSize to specify the number of entries per page. Then, use PageNumber to display the next page.
Note You can use only one of the preceding methods. If a large number of entries are returned, we recommend that you use Method 1 to increase the query speed.

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The ID of the request.

1AD222E9-E606-4A42-BF6D-8A4442913CEF
PageNumberinteger

The page number of the returned page.

Note If you specify MaxResults or NextToken, only the value 1 is returned. You can ignore the value 1.
1
PageRecordCountinteger

The number of entries returned on the current page.

10
TotalRecordCountinteger

The total number of entries returned.

Note If you specify MaxResults or NextToken, only the number of entries on the current page is returned. You can ignore the number.
100
Itemsobject []

The details of the instance.

VpcIdstring

The virtual private cloud (VPC) ID.

vpc-uf6f7l4fg90xxxxxxx
DedicatedHostIdForLogstring

The ID of the host on which the logger instance resides.

dh-bpxxxx
CreateTimestring

The creation time of the instance. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

2018-11-05T11:26:02Z
PayTypestring

The billing method of the instance. Valid values:

  • Postpaid: pay-as-you-go
  • Prepaid: subscription
Postpaid
DedicatedHostNameForLogstring

The name of the host on which the logger instance resides.

testlog
MutriORsignleboolean

Indicates whether the multi-zone deployment method is used for the instance. Valid values:

  • true
  • false
Note If the multi-zone deployment method is used for the instance, the zone ID of the instance contains MAZ. Example: cn-hangzhou-MAZ10(h,i).
true
DedicatedHostGroupNamestring

The name of the dedicated cluster to which the instance belongs.

testhostgroup
EngineVersionstring

The database engine version.

5.7
DedicatedHostGroupIdstring

The ID of the dedicated cluster to which the instances belong.

dhg-7a9xxxxxxxx
VpcNamestring

The VPC name.

test-huadong
DedicatedHostZoneIdForMasterstring

The zone ID of the host on which the primary instance resides.

cn-hangzhou-c
ConnectionStringstring

The endpoint of the instance.

rm-uf6wjk5xxxxxxx.mysql.rds.aliyuncs.com
InstanceNetworkTypestring

The network type of the instance. Valid values:

  • Classic
  • VPC
Classic
MasterInstanceIdstring

The ID of the primary instance. If this parameter is null, the instance is a primary instance.

rm-uf6wjk5xxxxxxxxxx
ExpireTimestring

The expiration time of the instance. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

Note Pay-as-you-go instances never expire.
2019-02-27T16:00:00Z
DestroyTimestring

The time when the instance was destroyed. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

2018-11-05T11:26:02Z
GuardDBInstanceIdstring

The ID of the disaster recovery instance. This parameter is returned only when the instance is a primary instance and has a disaster recovery instance attached.

rm-uf64zsuxxxxxxxxxx
DedicatedHostNameForMasterstring

The name of the host on which the primary instance resides.

testmaster
ZoneIdstring

The zone ID.

cn-hangzhou-a
TipsLevelinteger

The severity of the exception that is detected on the instance. This parameter is returned only when the instance is created in an ApsaraDB MyBase cluster that runs MySQL on Standard Edition. Valid values:

  • 1: The instance is normal.
  • 2: The specifications of the read-only instances do not match the specifications of the primary instance, and instance performance may be affected. You must adjust the specifications of these instances based on your business requirements.
1
DBInstanceIdstring

The instance ID.

rm-uf6wjk5xxxxxxxxxx
DedicatedHostIdForMasterstring

The ID of the host on which the primary instance resides.

dh-bpxxxx
TempDBInstanceIdstring

The ID of the temporary instance. This parameter is returned only when the instance is a primary instance and has a temporary instance attached.

rm-uf64zsuxxxxxxxxxx
DBInstanceStorageTypestring

The storage type of the instance.

ModuleList.4.ModuleCode
ConnectionModestring

The connection mode of the instance. Valid values:

  • Standard: standard mode
  • Safe: database proxy mode
Standard
LockModestring

The lock mode of the instance. Valid values:

  • Unlock: The instance is not locked.
  • ManualLock: The instance is manually locked.
  • LockByExpiration: The instance is automatically locked due to instance expiration.
  • LockByRestoration: The instance is automatically locked before the instance is rolled back.
  • LockByDiskQuota: The instance is automatically locked due to exhausted storage capacity.
  • Released: The instance is released. After an instance is released, the instance cannot be unlocked. You can only restore the backup data of the instance to a new instance. This process requires a long period of time.
Unlock
GeneralGroupNamestring

The name of the dedicated cluster to which the instance belongs. This parameter is returned only when the instance is created in an ApsaraDB MyBase cluster that runs MySQL on Standard Edition.

TestGroup
VpcCloudInstanceIdstring

The ID of the instance. This parameter is returned only when the instance resides in a VPC.

rm-uf6wjk5xxxxxxx
DedicatedHostZoneIdForSlavestring

The zone ID of the host on which the secondary instance resides.

cn-hangzhou-d
Tipsstring

The information about the exception that is detected on the instance. This parameter is returned only when the instance is created in an ApsaraDB MyBase cluster that runs MySQL on Standard Edition.

Run as expected.
DedicatedHostZoneIdForLogstring

The zone ID of the host on which the logger instance resides.

cn-hangzhou-b
DedicatedHostNameForSlavestring

The name of the host on which the secondary instance resides.

testslave
DBInstanceDescriptionstring

The instance description.

Test database
DBInstanceNetTypestring

The type of the network connection to the instance. Valid values:

  • Internet
  • Intranet
Internet
DBInstanceTypestring

The role of the instance. Valid values:

  • Primary: primary instance
  • Readonly: read-only instance
  • Guard: disaster recovery instance
  • Temp: temporary instance
Primary
LockReasonstring

The reason why the instance was locked.

instance_expired
DBInstanceStatusstring

The instance status. For more information, see Instance statuses.

Running
RegionIdstring

The region ID.

cn-hangzhou
VSwitchIdstring

The vSwitch ID.

vsw-uf6adz52c2pxxxxxxx
DedicatedHostIdForSlavestring

The ID of the host on which the secondary instance resides.

dh-bpxxxx
ResourceGroupIdstring

The resource group ID.

rg-acfmyxxxxxxx
Categorystring

The RDS edition of the instance. Valid values:

  • Basic: RDS Basic Edition
  • HighAvailability: RDS High-availability Edition
  • Finance: RDS Enterprise Edition
Note This parameter is returned only when the InstanceLevel parameter is set to 1.
Basic
Enginestring

The database engine of the instance.

MySQL
DBInstanceClassstring

The instance type of the instance. For information, see Primary ApsaraDB RDS instance types.

rds.mys2.small
SwitchWeightinteger

Indicates whether the instance supports weight-based switchovers for high availability. This parameter is returned only when the instance is created in an ApsaraDB MyBase cluster that runs MySQL on Standard Edition. Valid values:

  • 100: The instance supports weight-based switchovers for high availability.
  • 0: The instance does not support weight-based switchovers for high availability.
100
ReadOnlyDBInstanceIdsobject []

The IDs of the read-only instances that are attached to the primary instance. This parameter is returned only when the instance is a primary instance.

DBInstanceIdstring

The read-only instance ID.

rr-uf6wjk5xxxxxxx
DeletionProtectionboolean

Indicates whether the release protection feature is enabled for the instance. Valid values:

  • true
  • false
false
BurstingEnabledboolean

Indicates whether the I/O burst feature is enabled. Valid values:

  • true
  • false
false
BpeEnabledstring

Indicates whether the buffer pool extension (BPE) feature is enabled. Valid values:

  • 1
  • 0
0
IoAccelerationEnabledstring

Whether IO acceleration is enabled. The value has the following meanings:

  • 1: enabled
  • 0: not enabled
0
ColdDataEnabledboolean

A reserved parameter.

false
NextTokenstring

The token that is used to display the next page. If the returned entries are displayed on multiple pages, the next page can be displayed when you call this operation again with NextToken specified.

o7PORW5o2TJg**********

Examples

Sample success responses

JSONformat

{
  "RequestId": "1AD222E9-E606-4A42-BF6D-8A4442913CEF",
  "PageNumber": 1,
  "PageRecordCount": 10,
  "TotalRecordCount": 100,
  "Items": {
    "DBInstance": [
      {
        "VpcId": "vpc-uf6f7l4fg90xxxxxxx",
        "DedicatedHostIdForLog": "dh-bpxxxx",
        "CreateTime": "2018-11-05T11:26:02Z",
        "PayType": "Postpaid",
        "DedicatedHostNameForLog": "testlog",
        "MutriORsignle": true,
        "DedicatedHostGroupName": "testhostgroup",
        "EngineVersion": "5.7",
        "DedicatedHostGroupId": "dhg-7a9xxxxxxxx",
        "VpcName": "test-huadong",
        "DedicatedHostZoneIdForMaster": "cn-hangzhou-c",
        "ConnectionString": "rm-uf6wjk5xxxxxxx.mysql.rds.aliyuncs.com",
        "InstanceNetworkType": "Classic",
        "MasterInstanceId": "rm-uf6wjk5xxxxxxxxxx",
        "ExpireTime": "2019-02-27T16:00:00Z",
        "DestroyTime": "2018-11-05T11:26:02Z",
        "GuardDBInstanceId": "rm-uf64zsuxxxxxxxxxx",
        "DedicatedHostNameForMaster": "testmaster",
        "ZoneId": "cn-hangzhou-a",
        "TipsLevel": 1,
        "DBInstanceId": "rm-uf6wjk5xxxxxxxxxx",
        "DedicatedHostIdForMaster": "dh-bpxxxx",
        "TempDBInstanceId": "rm-uf64zsuxxxxxxxxxx",
        "DBInstanceStorageType": "ModuleList.4.ModuleCode",
        "ConnectionMode": "Standard",
        "LockMode": "Unlock",
        "GeneralGroupName": "TestGroup",
        "VpcCloudInstanceId": "rm-uf6wjk5xxxxxxx",
        "DedicatedHostZoneIdForSlave": "cn-hangzhou-d",
        "Tips": "Run as expected.\n",
        "DedicatedHostZoneIdForLog": "cn-hangzhou-b",
        "DedicatedHostNameForSlave": "testslave",
        "DBInstanceDescription": "Test database\n",
        "DBInstanceNetType": "Internet",
        "DBInstanceType": "Primary",
        "LockReason": "instance_expired",
        "DBInstanceStatus": "Running",
        "RegionId": "cn-hangzhou",
        "VSwitchId": "vsw-uf6adz52c2pxxxxxxx",
        "DedicatedHostIdForSlave": "dh-bpxxxx",
        "ResourceGroupId": "rg-acfmyxxxxxxx",
        "Category": "Basic",
        "Engine": "MySQL",
        "DBInstanceClass": "rds.mys2.small",
        "SwitchWeight": 100,
        "ReadOnlyDBInstanceIds": {
          "ReadOnlyDBInstanceId": [
            {
              "DBInstanceId": "rr-uf6wjk5xxxxxxx"
            }
          ]
        },
        "DeletionProtection": false,
        "BurstingEnabled": false,
        "BpeEnabled": "0",
        "IoAccelerationEnabled": "0",
        "ColdDataEnabled": false
      }
    ]
  },
  "NextToken": "o7PORW5o2TJg**********"
}

Error codes

HTTP status codeError codeError messageDescription
400Invalid.NextTokenThe parameter NextToken is invalid.The specified NextToken is invalid.
400InvalidDBInstanceType.ValueNotSupportThe specified parameter DBInstanceType is not valid.-
400InvalidParameter.OwnerAccountThe specified parameter OwnerAccount is not valid.The operation failed. The value of the OwnerAccount parameter is invalid. Check the value of this parameter.
400TimeoutRetryLaterTimeout, Please retry later.-
400InvalidExpired.FormatThe instance expiration status parameter is incorrect.The parameter that specifies the instance expiration status is invalid.
400Order.ComboInstanceNotAllowOperateA package instance is not allowed to operate independently.A package instance is not allowed to operate independently.
400Price.PricingPlanResultNotFoundPricing plan price result not found.Pricing plan price result not found.
400Order.NoRealNameAuthenticationYou have not passed the real-name authentication and do not meet the purchase conditions. Please log in to the user center for real-name authentication.You have not passed the real-name authentication and do not meet the purchase conditions. Please log in to the user center for real-name authentication.
400InsufficientAvailableQuotaYour account quota limit is less than 0, please recharge before trying to purchase.Your account available limit is less than 0, please recharge before trying to purchase.
400CommodityServiceCalling.ExceptionFailed to call commodity service.Failed to call commodity service return.

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

Change history

Change timeSummary of changesOperation
2024-04-02The Error code has changed. The response structure of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
Output ParametersThe response structure of the API has changed.
2024-04-01The Error code has changed. The response structure of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
Output ParametersThe response structure of the API has changed.
2024-01-04The Error code has changed. The response structure of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
Output ParametersThe response structure of the API has changed.
2023-05-26The Error code has changed. The request parameters of the API has changed. The response structure of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: Category
Output ParametersThe response structure of the API has changed.
2023-05-15The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 400 change
2023-05-11The Error code has changed. The request parameters of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: Filter
2022-09-01The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 400 change
2022-06-24API Description Update. The Error code has changedsee changesets
Change itemChange content
API DescriptionAPI Description Update.
Error CodesThe Error code has changed.
    delete Error Codes: 400
2021-10-11The Error code has changed. The response structure of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
Output ParametersThe response structure of the API has changed.