Queries the details of a database instance.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes GetInstance

The operation that you want to perform. Set the value to GetInstance.

Tid Long Yes 2***

The ID of the tenant. For more information about how to obtain a tenant ID, see Manage DMS tenants.

Host String Yes 192.168.XXX.XXX

The endpoint of the database instance. You can call the ListInstances operation to obtain the value of this parameter.

Port Integer Yes 3306

The number of the port that is used to connect to the database instance. You can call the ListInstances operation to obtain the value of this parameter.

Sid String No test

The system ID (SID) of the database instance. You can call the ListInstances operation to obtain the value of this parameter.

RegionId String No cn-hangzhou

The ID of the region in which Data Management (DMS) is deployed. For more information about the valid values of this parameter, see RegionID parameter.

Response parameters

Parameter Type Example Description
RequestId String E495CF94-818F-5FFE-ADD7-863ACBECBCA0

The ID of the request.

Instance Object

The details of the database instance.

VpcId String vpc-o6wrloqsdqc9io3mg****

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

DatabaseUser String dbuser

The username that is used to log on to the database instance.

DbaId String 29****

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

UseDsql Integer 0

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

  • 0: disabled
  • 1: enabled
Port Integer 3306

The number of the port that is used to connect to the database instance.

EcsInstanceId String i-bp124ldpklqz59y3****

The ID of the Elastic Compute Service (ECS) instance on which the database instance is deployed.

EnvType String product

The type of the environment to which the database instance belongs. Valid values:

  • product: production environment
  • dev: development environment
  • pre: staging environment
  • test: test environment
  • sit: system integration testing (SIT) environment
  • uat: user acceptance testing (UAT) environment
  • pet: stress testing environment
  • stag: STAG environment
Sid String test

The SID of the database instance.

OwnerIdList Array of String 10****

The ID of the owner for the database instance.

SafeRuleId String 3****

The ID of the security rule for the database instance.

OwnerNameList Array of String yuyang_test

The nickname of the owner for the database instance.

DbaNickName String dbaname

The nickname of the DBA for the database instance.

QueryTimeout Integer 7200

The timeout period for querying the database instance.

InstanceSource String ECS_OWN

The source of the database instance.

Host String 192.168.XXX.XXX

The endpoint of the database instance.

State String NORMAL

The status of the database instance. Valid values:

  • NORMAL: normal
  • DISABLE: disabled
DataLinkName String test

The name of the database link for the database instance.

ExportTimeout Integer 86400

The timeout period for exporting data from the database instance.

InstanceId String 168****

The ID of the database instance.

InstanceType String mysql

The type of the database instance.

DatabasePassword String ******

The password that is used to log on to the database instance.

InstanceAlias String test

The alias of the database instance.

DdlOnline Integer 0

Indicates whether the online DDL features are enabled for the database instance.

EcsRegion String cn-hangzhou

The ID of the region in which the database instance resides.

StandardGroup Object

The control mode of the database instance.

GroupName String test group name

The name of the security rule corresponding to the control mode.

GroupMode String COMMON

The type of the control mode. Valid values:

  • COMMON: Security Collaboration
  • NONE_CONTROL: Flexible Management
  • STABLE: Stable Change
ErrorCode String UnknownError

The error code that is returned.

ErrorMessage String UnknownError

The error message that is returned.

Success Boolean true

Indicates whether the request was successful. Valid values:

  • true: The request was successful.
  • false: The request failed.

Examples

Sample requests

http(s)://dms-enterprise.aliyuncs.com/?Action=GetInstance
&Tid=1
&Host=192.168.XXX.XXX
&Port=3306
&Sid=test
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<GetInstanceResponse>
    <RequestId>E495CF94-818F-5FFE-ADD7-863ACBECBCA0</RequestId>
    <Instance>
        <VpcId>vpc-o6wrloqsdqc9io3mg****</VpcId>
        <DatabaseUser>dbuser</DatabaseUser>
        <DbaId>29****</DbaId>
        <UseDsql>0</UseDsql>
        <Port>3306</Port>
        <EcsInstanceId>i-bp124ldpklqz59y3****</EcsInstanceId>
        <EnvType>product</EnvType>
        <Sid>test</Sid>
        <OwnerIdList>10****</OwnerIdList>
        <SafeRuleId>3****</SafeRuleId>
        <OwnerNameList>yuyang_test</OwnerNameList>
        <DbaNickName>dbaname</DbaNickName>
        <QueryTimeout>7200</QueryTimeout>
        <InstanceSource>ECS_OWN</InstanceSource>
        <Host>192.168.XXX.XXX</Host>
        <State>NORMAL</State>
        <DataLinkName>test</DataLinkName>
        <ExportTimeout>86400</ExportTimeout>
        <InstanceId>168****</InstanceId>
        <InstanceType>mysql</InstanceType>
        <DatabasePassword>******</DatabasePassword>
        <InstanceAlias>test</InstanceAlias>
        <DdlOnline>0</DdlOnline>
        <EcsRegion>cn-hangzhou</EcsRegion>
        <StandardGroup>
            <GroupName>test group name</GroupName>
            <GroupMode>COMMON</GroupMode>
        </StandardGroup>
    </Instance>
    <ErrorCode>UnknownError</ErrorCode>
    <ErrorMessage>UnknownError</ErrorMessage>
    <Success>true</Success>
</GetInstanceResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "E495CF94-818F-5FFE-ADD7-863ACBECBCA0",
  "Instance" : {
    "VpcId" : "vpc-o6wrloqsdqc9io3mg****",
    "DatabaseUser" : "dbuser",
    "DbaId" : "29****",
    "UseDsql" : 0,
    "Port" : 3306,
    "EcsInstanceId" : "i-bp124ldpklqz59y3****",
    "EnvType" : "product",
    "Sid" : "test",
    "OwnerIdList" : [ "10****" ],
    "SafeRuleId" : "3****",
    "OwnerNameList" : [ "yuyang_test" ],
    "DbaNickName" : "dbaname",
    "QueryTimeout" : 7200,
    "InstanceSource" : "ECS_OWN",
    "Host" : "192.168.XXX.XXX",
    "State" : "NORMAL",
    "DataLinkName" : "test",
    "ExportTimeout" : 86400,
    "InstanceId" : "168****",
    "InstanceType" : "mysql",
    "DatabasePassword" : "******",
    "InstanceAlias" : "test",
    "DdlOnline" : 0,
    "EcsRegion" : "cn-hangzhou",
    "StandardGroup" : {
      "GroupName" : "test group name",
      "GroupMode" : "COMMON"
    }
  },
  "ErrorCode" : "UnknownError",
  "ErrorMessage" : "UnknownError",
  "Success" : true
}

Error codes

For a list of error codes, visit the API Error Center.