All Products
Search
Document Center

Bastionhost:GetDatabase

Last Updated:Oct 25, 2024

Queries the detailed information about a database.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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
yundun-bastionhost:GetDatabase
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The ID of the bastion host that manages the database to query.

Note You can call the DescribeInstances operation to query the ID of the bastion host.
bastionhost-cn-wwo36qbv601
RegionIdstringNo

The region ID of the bastion host that manages the database to query.

Note For more information about the mapping between region IDs and region names, see Regions and zones.
cn-hangzhou
DatabaseIdstringYes

The ID of the database to query.

Note You can call the ListDatabases operation to query the database ID.
21

Response parameters

ParameterTypeDescriptionExample
object
Databaseobject

The returned detailed information about the database.

ActiveAddressTypestring

The address type of the database. Valid values:

  • Public
  • Private
Public
Commentstring

The remarks of the database.

comment
DatabaseIdstring

The database ID.

22
DatabaseNamestring

The name of the database.

test
DatabasePortlong

The port of the database.

3306
DatabasePrivateAddressstring

The internal endpoint of the database.

rm-bp1zq******
DatabasePublicAddressstring

The public endpoint of the database.

rm-uf65******
DatabaseTypestring

The database engine. Valid values:

  • mysql
  • sqlserver
  • postgresql
  • oracle
MySQL
NetworkDomainIdstring

The ID of the network domain to which the database belongs.

45
Sourcestring

The database type. Valid values:

  • Local: on-premises database.
  • Rds: ApsaraDB RDS instance.
  • PolarDB: PolarDB cluster.
Local
SourceInstanceIdstring

The ID of the ApsaraDB RDS instance or PolarDB cluster.

Note If Source is set to Local, this parameter is empty.
i-wz9527ob0e0nftcsffke
SourceInstanceRegionIdstring

The region ID of the ApsaraDB RDS instance or PolarDB cluster.

cn-hangzhou
SourceInstanceStatestring

The status of the database. Valid values:

  • Normal
  • Release
Normal
RequestIdstring

The request ID.

4D72B883-9D15-5B05-B987-DFD10EB1FFB4

Examples

Sample success responses

JSONformat

{
  "Database": {
    "ActiveAddressType": "Public",
    "Comment": "comment",
    "DatabaseId": "22",
    "DatabaseName": "test",
    "DatabasePort": 3306,
    "DatabasePrivateAddress": "rm-bp1zq******",
    "DatabasePublicAddress": "rm-uf65******",
    "DatabaseType": "MySQL",
    "NetworkDomainId": "45",
    "Source": "Local",
    "SourceInstanceId": "i-wz9527ob0e0nftcsffke",
    "SourceInstanceRegionId": "cn-hangzhou",
    "SourceInstanceState": "Normal"
  },
  "RequestId": "4D72B883-9D15-5B05-B987-DFD10EB1FFB4"
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidParameterThe argument is invalid.The argument is invalid.
404DatabaseNotFoundThe database is not found.The database is not found.
500InternalErrorAn unknown error occurred.An unknown error occurred.

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