Feature description
Describes the interface used to obtain a list of databases.
Call instructions
Interface constraints
The caller needs to be authenticated through the OCP application service.
The caller must have the read privilege on the specified tenant.
Request path
GET /api/v2/ob/clusters/{id}/tenants/{tenantId}/databases
Request parameters
path:
Parameter |
Type |
Required |
Example value |
Description |
|---|---|---|---|---|
| id | Integer | Yes | 1 | The cluster ID. |
| tenantId | Integer | Yes | 1000001 | The tenant ID. |
Return result
Basic data structure
Parameter |
Type |
Description |
|---|---|---|
| data | Object | The business data requested. |
| ├─ contents | Array | The database list. For more information, see Database data structure. |
| successful | Boolean | Indicates whether the request is successful. |
| timestamp | Datetime | The timestamp when the server completes the request. |
| duration | Integer | The time taken by the server to process the request, in milliseconds. |
| status | Integer | The HTTP status code that conforms to the HTTP status specification. |
| traceId | String | The Trace ID of the request, which is used to troubleshoot issues. |
| server | String | The address of the server that responded to the request. |
Database data structure
Parameter |
Type |
Description |
|---|---|---|
| dbName | String | The database name. |
| charset | String | The character set. |
| collation | String | The collation. |
| primaryZone | String | The zone priority. |
| readonly | Boolean | Indicates whether the database is read-only. |
| createTime | Datetime | The creation time. |
| connectionUrls | Array | The list of connection strings for OBProxy. |
| ├─ connectionStringType | String | The connection string type. Valid values: |
| ├─ obProxyAddress | String | The OBProxy address, which is valid only when the connection string type is OBPROXY. |
| ├─ obProxyPort | Integer | The OBProxy port, which is valid only when the connection string type is OBPROXY. |
| ├─ connectionString | String | The connection string. |
| ├─ forBinlogService | Boolean | Indicates whether the database serves the Binlog service. |
| requiredSize | Integer | The required size of the database. |
| id | Integer | The database ID. |
Example
Request example
Obtain the database list of cluster 1 and tenant 1000001.
GET /api/v2/ob/clusters/1/tenants/1000001/databases?id=1&tenantId=1000001
Response example
{
"data": {
"contents": [
{
"charset": "utf8mb4",
"collation": "utf8mb4_general_ci",
"connectionUrls": [
{
"connectionString": "jdbc:mysql://xxx.xxx.xxx.xxx:2881/oceanbase",
"type": "DIRECT"
}
],
"createTime": "2021-09-06T11:38:44.51598+08:00",
"dbName": "oceanbase",
"id": 1100611139403777,
"readonly": false
},
{
"charset": "utf8mb4",
"collation": "utf8mb4_general_ci",
"connectionUrls": [
{
"connectionString": "jdbc:mysql://xxx.xxx.xxx.xxx:2881/information_schema",
"type": "DIRECT"
}
],
"createTime": "2021-09-06T11:38:44.559335+08:00",
"dbName": "information_schema",
"id": 1100611139403778,
"readonly": false
},
{
"charset": "utf8mb4",
"collation": "utf8mb4_general_ci",
"connectionUrls": [
{
"connectionString": "jdbc:mysql://xxx.xxx.xxx.xxx:2881/mysql",
"type": "DIRECT"
}
],
"createTime": "2021-09-06T11:38:44.550886+08:00",
"dbName": "mysql",
"id": 1100611139403779,
"readonly": false
},
{
"charset": "utf8mb4",
"collation": "utf8mb4_general_ci",
"connectionUrls": [
{
"connectionString": "jdbc:mysql://xxx.xxx.xxx.xxx:2881/test",
"type": "DIRECT"
}
],
"createTime": "2021-09-06T11:38:44.567822+08:00",
"dbName": "test",
"id": 1100611139404776,
"readonly": false
}
]
},
"duration": 429,
"server": "a83ad33525",
"status": 200,
"successful": true,
"timestamp": "2021-09-06T20:22:14.85+08:00",
"traceId": "58294ce0e07243a4"
}
