DescribeDatabaseInstances

更新时间:
复制 MD 格式

This topic describes lightweight database instances.

Operation description

This operation retrieves details for one or more lightweight database instances in a specified region, including the instance ID, name, plan, database version, public IP address, private IP address, creation time, and expiration time.

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

swas-open:DescribeDatabaseInstances

get

*Instance

acs:swas-open:{#regionId}:{#accountId}:{#InstanceId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The ID of the region where the lightweight database instances are located.

cn-hangzhou

DatabaseInstanceIds

string

No

The IDs of the lightweight database instances. The value is a JSON array that can contain up to 100 instance IDs.

["swasdb-xxx******","swasdb-yyy******"]

PageNumber

integer

No

The page number.

Pages start from page 1.

Default value: 1.

1

PageSize

integer

No

The number of entries per page.

Maximum value: 100.

Default value: 10.

10

Response elements

Element

Type

Description

Example

object

The data returned.

RequestId

string

The request ID.

20758A-585D-4A41-A9B2-28DA8F4****

DatabaseInstances

array<object>

The information about the Simple Application Server database instances.

object

The details of a Simple Application Server database instance.

RegionId

string

The region ID of the Simple Application Server database instance.

cn-hangzhou

DatabaseInstanceId

string

The ID of the Simple Application Server database instance.

db-38263fa955774501a2ae1bdaed6f****

DatabaseInstanceName

string

The name of the Simple Application Server database instance.

我的数据库

DatabaseInstanceEdition

string

The edition of the Simple Application Server database instance. Valid values:

  • swas.db.c1m1s25: 35 CNY/month.

  • swas.db.c1m2s80: 100 CNY/month.

  • swas.db.c2m4s120: 200 CNY/month.

  • swas.db.c2m8s240: 300 CNY/month.

swas.db.c1m1s25

DatabaseVersion

string

The database version. Valid values:

  • 5.7: MySQL 5.7.

  • 8.0: MySQL 8.0.

5.7

Cpu

string

The number of vCPUs.

1

Memory

string

The memory size. Unit: GB.

1

Storage

integer

The disk space of the ESSD. Unit: GB.

25

PrivateConnection

string

The private connection endpoint.

rm-bp1d39opj7906****.mysql.rds.aliyuncs.com

PublicConnection

string

The public connection endpoint.

Note

This parameter is returned only if a public endpoint is enabled for the instance. You can call the AllocatePublicConnection operation to enable a public endpoint.

db-38263fa955774501a2ae1bdaed6f****.mysql.rds.aliyuncs.com

DatabaseInstanceStatus

string

The status of the Simple Application Server database instance. Valid values:

  • Pending: The instance is being created.

  • Restarting: The instance is being restarted.

  • Running: The instance is running.

  • Stopping: The instance is being stopped.

  • Stopped: The instance is stopped.

  • UPGRADING: The instance is being upgraded.

  • DISABLED: The instance is disabled.

Running

BusinessStatus

string

The business status of the instance. Valid values:

  • normal: The instance is normal.

  • expired: The instance has expired.

  • overdue: The payment for the instance is overdue.

normal

CreationTime

string

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

2022-09-01T02:39:46Z

ExpiredTime

string

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

Note

The expiration time displayed in the console is eight hours later than the UTC time.

2022-10-01T16:00:00Z

ChargeType

string

The billing method of the instance. Only the subscription billing method is supported. The value is fixed as PrePaid.

Default value: PrePaid.

PrePaid

SuperAccountName

string

The name of the privileged account of the Simple Application Server database instance.

administrator

PageSize

integer

The page number of the returned page.

1

PageNumber

integer

The number of entries per page.

10

TotalCount

integer

The total number of entries returned.

5

Examples

Success response

JSON format

{
  "RequestId": "20758A-585D-4A41-A9B2-28DA8F4****",
  "DatabaseInstances": [
    {
      "RegionId": "cn-hangzhou",
      "DatabaseInstanceId": "db-38263fa955774501a2ae1bdaed6f****",
      "DatabaseInstanceName": "我的数据库",
      "DatabaseInstanceEdition": "swas.db.c1m1s25",
      "DatabaseVersion": "5.7",
      "Cpu": "1",
      "Memory": "1",
      "Storage": 25,
      "PrivateConnection": "rm-bp1d39opj7906****.mysql.rds.aliyuncs.com",
      "PublicConnection": "db-38263fa955774501a2ae1bdaed6f****.mysql.rds.aliyuncs.com",
      "DatabaseInstanceStatus": "Running",
      "BusinessStatus": "normal",
      "CreationTime": "2022-09-01T02:39:46Z",
      "ExpiredTime": "2022-10-01T16:00:00Z",
      "ChargeType": "PrePaid",
      "SuperAccountName": "administrator"
    }
  ],
  "PageSize": 1,
  "PageNumber": 10,
  "TotalCount": 5
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.