Querying Schemas

Function

This API is used to query schemas.

URI

GET /v1/{project_id}/instances/{instance_id}/databases?offset={offset}&limit={limit}

If a compiler (such as Xshell) is used to invoke this API by running commands or scripts, special character ampersands (&) should be escaped.

Example:

GET /v1/{project_id}/instances/{instance_id}/databases?offset={offset}\&limit={limit}

Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Project ID of a tenant in a region

instance_id

Yes

DDM instance ID

offset

No

Offset for pagination query. The start value cannot be less than 0.

limit

No

Number of records returned on each page. The value is greater than 0 and less than or equal to 128.

Request

Request parameters

None

Response

Response parameters

Table 2 Parameter description

Parameter

Type

Mandatory

Description

databases

Array

true

Schema information

total

Integer

true

Total number of data records

Table 3 Description of parameter databases

Parameter

Type

Mandatory

Description

name

String

true

Schema name

shard_mode

String

true

Sharding 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

true

Number of shards in the same sharding mode

status

String

true

Schema status

created

String

true

Time when the schema is created

used_rds

Array

true

Details of the RDS DB instance associated with the schema

shard_unit

Integer

true

Number of shards per RDS DB instance

Table 4 Description of parameter used_rds

Parameter

Type

Mandatory

Description

id

String

true

Node ID of the associated RDS DB instance

name

String

true

Name of the associated RDS DB instance

status

String

true

Status of the associated RDS DB instance

Example

  • Example request

    None

  • Example response
    {
        "databases": [
            {
                "status": "RUNNING",
                "created": 1589249400162,
                "name": "db_cff8",
                "shard_mode": "cluster",
                "shard_number": 8,
                "shard_unit": 8,
                "used_rds": [
                    {
                        "id": "3858d17737cc4a9a93f0e022ef1251ffin01",
                        "status": "NORMAL",
                        "name": "rds-mcs-arm"
                    }
                ]
            },
            {
                "status": "RUNNING",
                "created": 1589248598693,
                "name": "db_5683",
                "shard_mode": "cluster",
                "shard_number": 8,
                "shard_unit": 8,
                "used_rds": [
                    {
                        "id": "3858d17737cc4a9a93f0e022ef1251ffin01",
                        "status": "NORMAL",
                        "name": "rds-mcs-arm"
                    }
                ]
            },
            {
                "status": "RUNNING",
                "created": 1588746562989,
                "name": "db_29f3",
                "shard_mode": "cluster",
                "shard_number": 8,
                "shard_unit": 8,
                "used_rds": [
                    {
                        "id": "3858d17737cc4a9a93f0e022ef1251ffin01",
                        "status": "NORMAL",
                        "name": "rds-mcs-arm"
                    }
                ]
            }
        ],
        "total": 3
    }

For failure responses, see Abnormal Request Results.

Status Code

For details, see Status Codes.