Help Center/ Distributed Database Middleware/ API Reference (Kuala Lumpur Region)/ Schema Management/ Querying DB Instances Available for Creating a Schema
Updated on 2022-08-17 GMT+08:00

Querying DB Instances Available for Creating a Schema

Function

This API is used to query DB instances that can be used for creating a schema.

Constraints

None

URI

GET /v1/{project_id}/instances/{instance_id}/rds
Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID of a tenant in a region

instance_id

Yes

String

DDM instance ID

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token

It can be obtained by calling the IAM API (value of X-Subject-Token in the response header).

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

instances

Array of instances objects

Information about DB instances available for creating a schema

Table 4 instances

Parameter

Type

Description

id

String

DB instance ID

projectId

String

Project ID of a tenant in a region

status

String

DB instance status

name

String

DB instance name

engineName

String

DB instance engine

engineSoftwareVersion

String

DB instance engine

privateIp

String

Private IP address of the DB instance

mode

String

Deployment model of the DB instance, which can be clustered or single

port

Integer

DB instance port number

azCode

String

AZ code

timeZone

String

Time zone

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

errCode

String

Service error code

externalMessage

String

Error message

Status code: 500

Table 6 Response body parameters

Parameter

Type

Description

errCode

String

Service error code

externalMessage

String

Error message

Example Request

GET https://{endpoint}/v1/{project_id}/instances/{instance_id}/rds

Example Response

Status code: 200

OK

{
    "instances": [
        {
            "id": "a44a103e64634a2e872d1ab2523bb838in01",
            "projectId": "070c071d8e80d58c2f42c0121b10cf9f",
            "status": "normal",
            "name": "rds-ab04-test",
            "engineName": "mysql",
            "engineSoftwareVersion": "8.0",
            "privateIp": "192.168.0.72",
            "mode": "Single",
            "port": 3306,
            "azCode": "az1xahz",
            "timeZone": "UTC+08:00"
        }
    ]
}

Status code: 400

bad request

{
  "externalMessage" : "Parameter error.",
  "errCode" : "DBS.280001"
}

Status code: 500

server error

{
  "externalMessage" : "Parameter error.",
  "errCode" : "DBS.280001"
}

Status Codes

Status Code

Description

200

OK

400

bad request

500

server error

Error Codes

For details, see Error Codes.