ListInstances

更新时间:
复制 MD 格式

Call the ListInstances API to retrieve instances.

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

dms:ListInstances

list

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Tid

integer

No

The ID of the tenant. You can call the GetUserActiveTenant operation to obtain this ID.

3***

SearchKey

string

No

The search keyword.

test

DbType

string

No

The database type. For more information about valid values, see DbType parameter.

MySQL

EnvType

string

No

The environment type of the instance. Valid values:

  • product: production environment

  • dev: development environment

  • pre: pre-release environment

  • test: test environment

  • sit: system integration testing (SIT) environment

  • uat: user acceptance testing (UAT) environment

  • pet: performance testing environment

  • stag: staging environment

product

InstanceSource

string

No

The source of the instance. Valid values:

  • PUBLIC_OWN: a self-managed instance that is exposed to the Internet

  • RDS: an ApsaraDB RDS instance

  • ECS_OWN: a self-managed instance that is hosted on an Elastic Compute Service (ECS) instance

  • VPC_IDC: a self-managed instance in a data center that is connected to a Virtual Private Cloud (VPC)

RDS

NetType

string

No

The network type of the instance. Valid values:

  • CLASSIC: classic network

  • VPC: VPC

VPC

InstanceState

string

No

The state of the instance. Valid values:

  • NORMAL: The instance is running as normal.

  • DISABLE: The instance is disabled.

NORMAL

PageNumber

integer

No

The number of the page to return.

1

PageSize

integer

No

The number of entries to return on each page. Maximum value: 100.

50

Region

string

No

The ID of the region in which the instance resides.

cn-hangzhou

RealLoginUserUid

string

No

实际调用 API 的用户的阿里云账号 UID

21400447956867****

Response elements

Element

Type

Description

Example

object

The data returned.

TotalCount

integer

The total number of entries that match the query.

1

RequestId

string

The ID of the request.

B4B07137-F6AE-4756-8474-7F92BB6C4E04

ErrorCode

string

The error code.

UnknownError

ErrorMessage

string

The error message.

UnknownError

InstanceList

object

The list of instances.

Instance

array<object>

The instances.

array<object>

The information about the instance.

VpcId

string

The ID of the virtual private cloud (VPC) to which the instance belongs.

vpc-o6wrloqsdqc9io3mg****

DatabaseUser

string

The username of the database account.

dbUser

DbaId

string

The ID of the database administrator (DBA) of the instance.

31****

UseDsql

integer

Indicates whether cross-database query is enabled for the instance. Valid values:

  • 0: Disabled.

  • 1: Enabled.

1

Port

integer

The connection port of the instance.

3306

EcsInstanceId

string

The ID of the Elastic Compute Service (ECS) instance.

150****

EnvType

string

The environment type of the instance. Valid values:

  • product: production environment

  • dev: development environment

  • pre: pre-release environment

  • test: test environment

  • sit: system integration testing (SIT) environment

  • uat: user acceptance testing (UAT) environment

  • pet: performance testing environment

  • stag: staging environment

product

Sid

string

The system ID (SID) of the instance.

test

OwnerIdList

object

The IDs of the instance owners.

OwnerIds

array

The user IDs of the instance owners.

string

The user ID of an instance owner.

12****

SafeRuleId

string

The ID of the security rule for the instance.

1

OwnerNameList

object

The nicknames of the instance owners.

OwnerNames

array

The nicknames of the instance owners.

string

The nickname of an instance owner.

yuyang_test

DbaNickName

string

The nickname of the DBA.

dbaName

QueryTimeout

integer

The timeout period for a query. Unit: seconds.

60

InstanceSource

string

The source of the instance.

RDS

Host

string

The endpoint of the instance.

****.mysql.rds.aliyuncs.com

State

string

The status of the instance.

NORMAL

DataLinkName

string

The name of the database link.

dblink_test

ExportTimeout

integer

The timeout period for an export. Unit: seconds.

86400

InstanceId

string

The ID of the instance.

150***

InstanceType

string

The database type of the instance.

mysql

DatabasePassword

string

The password of the database account.

******

InstanceAlias

string

The alias of the instance.

test

DdlOnline

integer

The Data Definition Language (DDL) online configuration.

1

EcsRegion

string

The region in which the instance resides.

cn-hangzhou

StandardGroup

object

The control mode of the instance.

GroupName

string

The name of the security rule for the control mode.

test

GroupMode

string

The control mode of the instance. Valid values:

  • COMMON: Security Collaboration

  • NONE_CONTROL: Flexible Management

  • STABLE: Stable Change

COMMON

SellSitd

boolean

Indicates whether sensitive data protection is enabled. Valid values:

  • true

  • false

true

SellTrust

string

Indicates whether managed security is enabled. Valid values:

  • true

  • false

true

Success

boolean

Indicates whether the request was successful. Valid values:

  • true: The request was successful.

  • false: The request failed.

true

Examples

Success response

JSON format

{
  "TotalCount": 1,
  "RequestId": "B4B07137-F6AE-4756-8474-7F92BB6C4E04",
  "ErrorCode": "UnknownError",
  "ErrorMessage": "UnknownError",
  "InstanceList": {
    "Instance": [
      {
        "VpcId": "vpc-o6wrloqsdqc9io3mg****",
        "DatabaseUser": "dbUser",
        "DbaId": "31****",
        "UseDsql": 1,
        "Port": 3306,
        "EcsInstanceId": "150****",
        "EnvType": "product",
        "Sid": "test",
        "OwnerIdList": {
          "OwnerIds": [
            "12****"
          ]
        },
        "SafeRuleId": "1",
        "OwnerNameList": {
          "OwnerNames": [
            "yuyang_test"
          ]
        },
        "DbaNickName": "dbaName",
        "QueryTimeout": 60,
        "InstanceSource": "RDS",
        "Host": "****.mysql.rds.aliyuncs.com",
        "State": "NORMAL",
        "DataLinkName": "dblink_test",
        "ExportTimeout": 86400,
        "InstanceId": "150***",
        "InstanceType": "mysql",
        "DatabasePassword": "******",
        "InstanceAlias": "test",
        "DdlOnline": 1,
        "EcsRegion": "cn-hangzhou",
        "StandardGroup": {
          "GroupName": "test",
          "GroupMode": "COMMON"
        },
        "SellSitd": true,
        "SellTrust": "true"
      }
    ]
  },
  "Success": true
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.