Updated on 2022-08-17 GMT+08:00

Querying Details of a Schema

Function

This API is used to query details about a schema.

Constraints

None

URI

GET /v1/{project_id}/instances/{instance_id}/databases/{ddm_dbname}

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID

instance_id

Yes

String

DDM instance ID

ddm_dbname

Yes

String

Name of the schema to be queried, which is case-insensitive

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

database

GetDDMDatabaseResponseBean object

Schema information

Table 4 Parameters for querying details of a schema

Parameter

Type

Description

name

String

Schema name

created

String

Time when the schema is created

status

String

Schema status

updated

String

Time when the DDM instance is last updated

databases

Array of GetDDMDatabases objects

Sharding information of the schema

shard_mode

String

Working mode of the schema

  • cluster: indicates that the schema is in sharded mode.
  • single: indicates that the schema is in unsharded mode.

shard_number

Integer

Number of shards in the same working mode

shard_unit

Integer

Number of shards per RDS DB instance

dataVips

Array of strings

IP address and port number for connecting to the schema

used_rds

Array of GetDDMDatabaseUsedrds objects

Associated RDS DB instances

Table 5 Parameters for querying schemas

Parameter

Type

Description

dbslot

Integer

Number of shards

name

String

Shard name

status

String

Schema status

created

String

Time when the schema is created

updated

String

Time when the schema is last updated

id

String

ID of the RDS DB instance where the shard is located

idName

String

Name of the RDS DB instance

Table 6 Parameters for querying RDS DB instances associated with the schema

Parameter

Type

Description

id

String

Node ID of the associated RDS DB instance

name

String

Name of the associated RDS DB instance

status

String

Status of the associated RDS DB instance

error_msg

String

Response message. This parameter is not returned if no error occurs.

Status code: 400

Table 7 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}/databases/{ddm_dbname}

Example Response

Status code: 200

OK

{
  "database" : {
    "databases" : [ "id:ea81976b12e84d57822209169caddc11in01", "name:db_2305", "idName:db_2305", "status:RUNNING", "dbSlot:0", "created:1603861296004", "updated:1603861296004" ],
    "dataVips" : [ "92.168.0.175:5066" ],
    "status" : "RUNNING",
    "created" : "0f58c8dc-4a78-42e6-9811-565679de8e9e",
    "name" : "db_2305",
    "updated" : "1604282063035",
    "shard_mod" : "single",
    "shard_number" : "1",
    "shard_unit" : "1",
    "used_rds" : [ "id:ea81976b12e84d57822209169caddc11in01", "status:RUNNING", "nam:rds-94c3-wuli" ]
  }
}

Status code: 400

bad request

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

Status Codes

For details, see Status Codes.

Error Codes

For details, see Error Codes.