Querying Schemas
Function
This API is used to query schemas of a DDM instance.
Constraints
None
URI
GET /v1/{project_id}/instances/{instance_id}/databases?offset={offset}&limit={limit}
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID of a tenant in a region To obtain this value, see Obtaining a Project ID. |
| instance_id | Yes | String | DDM instance ID |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| offset | No | Integer | Index offset. The query starts from the next piece of data indexed by this parameter. The value is 0 by default. The value must be a non-negative number. |
| limit | No | Integer | Maximum schemas to be queried. Value range: 1 to 128. If the parameter value is not specified, 128 nodes are queried by default. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | User token You can obtain the token by calling the IAM API used to obtain a user token. |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| databases | Array of GetDatabaseInfo objects | Schema information |
| total | Integer | Total records |
| Parameter | Type | Description |
|---|---|---|
| name | String | Schema name |
| shard_mode | String | Sharding mode of the schema
|
| shard_number | Integer | Number of shards in the same working mode |
| status | String | Schema status |
| created | Long | Time when the schema was created |
| used_rds | Array of GetDatabaseUsedRds objects | RDS instances associated with the schema |
| shard_unit | Integer | Number of shards per RDS instance |
| Parameter | Type | Description |
|---|---|---|
| id | String | Node ID of the associated RDS instance |
| name | String | Name of the associated RDS instance |
| status | String | Status of the associated RDS instance |
| error_msg | String | Response message. This parameter is not returned if no abnormality occurs. |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| errCode | String | Service error code |
| externalMessage | String | Error message |
Status code: 500
| Parameter | Type | Description |
|---|---|---|
| errCode | String | Service error code |
| externalMessage | String | Error message |
Example Request
Querying schemas
GET https://{endpoint}/v1/{project_id}/instances/{instance_id}/databases?offset={offset}&limit={limit} Example Response
Status code: 200
OK
{
"databases" : [ {
"status" : "RUNNING",
"created" : 1642063713625,
"name" : "mytestdb170",
"shard_mode" : "cluster",
"shard_number" : 8,
"shard_unit" : 8,
"used_rds" : [ {
"id" : "c6f68fed9e74478c8679479a07d7d568in01",
"status" : "normal",
"name" : "rds-test"
} ]
} ],
"total" : 172
} Status code: 400
Bad request
{
"externalMessage" : "Parameter error.",
"errCode" : "DBS.280001"
} Status code: 500
Server error
{
"externalMessage" : "Server failure.",
"errCode" : "DBS.200412"
} Status Codes
| Status Code | Description |
|---|---|
| 200 | OK |
| 400 | Bad request |
| 500 | Server error |
Error Codes
For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.