機能説明
データベースリストを取得するために使用するインターフェースです。
呼び出し説明
インターフェース制約
呼び出し元はOCPアプリケーションサービスの認証を通過している必要があります。
呼び出し元は指定されたテナントに対する読み取り権限を持っている必要があります。
リクエストパス
GET /api/v2/ob/clusters/{id}/tenants/{tenantId}/databases
リクエストパラメータ
path:
パラメータ |
型 |
必須 |
サンプル値 |
説明 |
|---|---|---|---|---|
| id | Integer | はい | 1 | OCP側のクラスタID。 |
| tenantId | Integer | はい | 1000001 | OCP側のテナントID。 |
戻り値
パラメータ |
型 |
説明 |
|---|---|---|
| data | Object | リクエストされた業務データ。 |
| ├─ contents | Array | データベースのリスト。詳細はデータベースデータ構造を参照。 |
| successful | Boolean | リクエストが成功したかどうか。 |
| timestamp | Datetime | サーバーがリクエストを完了したタイムスタンプ。 |
| duration | Integer | サーバーがリクエストを処理した時間(ミリ秒)。 |
| status | Integer | HTTP Status仕様に準拠したコード。 |
| traceId | String | リクエストのTrace ID。問題のトラブルシューティングに使用されます。 |
| server | String | リクエストに応答したサーバーのアドレス。 |
データベースデータ構造
パラメータ |
型 |
説明 |
|---|---|---|
| dbName | String | データベース名 |
| charset | String | 文字セット |
| collation | String | 照合順序 |
| primaryZone | String | ゾーンの優先順位 |
| readonly | Boolean | 読み取り専用かどうか |
| createTime | Datetime | 作成時間 |
| connectionUrls | Array | OBProxyと接続文字列のリスト |
| ├─ connectionStringType | String | 接続文字列タイプ。取り得る範囲: |
| ├─ obProxyAddress | String | OBProxyアドレス。接続文字列タイプがOBPROXYの場合に有効です。 |
| ├─ obProxyPort | Integer | OBProxyポート。接続文字列タイプがOBPROXYの場合に有効です。 |
| ├─ connectionString | String | 接続文字列。 |
| ├─ forBinlogService | Boolean | Binlogサービスに対応するかどうか。 |
| requiredSize | Integer | データベースのrequired_size。 |
| id | Integer | データベースのID。 |
例
リクエスト例
クラスタ1、テナント1000001配下のデータベースリストを取得します。
GET /api/v2/ob/clusters/1/tenants/1000001/databases?id=1&tenantId=1000001
レスポンス例
{
"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"
}