Overview
You can call this API to query the list of tenants in a specified OceanBase cluster.
API details
Constraints
The caller must have an AccessKey for accessing APIs of multiple clouds. For information about how to obtain the AccessKey ID and AccessKey secret, see Manage AccessKeys.
Request path
GET /api/v2/instances/{instanceId}/tenants
Request parameters
Query
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| instanceId | String | Yes | The ID of the OceanBase cluster. | ob317v4uif**** |
| tenantName | String | No | The name of the tenant. You can specify a wildcard character in the value of this parameter to search for tenants by name. |
pay_**** |
| pageSize | Integer | No | The number of rows to return on each page.
|
10 |
| pageNumber | Integer | No | The number of the page to return.
|
1 |
Response parameters
| Name | Type | Description | Example value |
|---|---|---|---|
| data | object | The information about the tenants, including the dataList field. | |
| dataList | object[] | The information about the tenants, including the following fields. | |
| tenantId | String | The ID of the tenant. | t33h8y08k**** |
| tenantName | String | The name of the tenant. You can specify a wildcard character in the value of this parameter to search for tenants by name. |
pay_**** |
| tenantMode | String | The mode of the tenant. Valid values:
|
Oracle |
| status | String | The status of the tenant.
|
ONLINE |
| cpu | Integer | The total number of CPU cores of the tenant. | 10 |
| mem | Integer | The total size of memory of the tenant, in GiB. | 20 |
| unitCpu | Integer | The number of CPU cores in each unit of the tenant, in cores. | 5 |
| unitMem | Integer | The size of memory in each unit of the tenant, in GiB. | 10 |
| unitNum | Integer | The number of units of the tenant. | 2 |
| gmtCreate | string | The time when the tenant was created. | 2021-09-20 12:00:00 |
| primaryZone | string | The primary zone of the tenant. It is one of the zones in the cluster deployment. | Zone H |
Examples
Request example
curl --digest -u 'ak:sk' \
--request GET \
--url https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/tenants
-H 'X-Ob-Project-Id: <Project ID>'
-G -d 'pageNumber=1' -d 'pageSize=2' -d 'tenantName=name'
Note
- A project ID uniquely identifies a project. For information about how to obtain the project ID of an instance, see Manage projects.
- Make sure that the project ID corresponding to the specified instanceId is consistent with the specified project ID.
Response example
JSON format
{
"success": true,
"data": {
"dataList": [
{
"cpu": 4,
"gmtCreate": "2021-09-20 12:00:00",
"mem": 8,
"primaryZone": "Zone H",
"status": "ONLINE",
"tenantId": "abcd123",
"tenantMode": "MySql",
"tenantName": "my_test_tenant",
"unitCpu": 4,
"unitNum": 2,
"unitMem": 8
},
{
"cpu": 4,
"gmtCreate": "2021-09-20 12:00:00",
"mem": 8,
"primaryZone": "Zone H",
"status": "PENDING_CREATE",
"tenantId": "dfje0123",
"tenantMode": "Oracle",
"tenantName": "my_test_tenant2",
"unitCpu": 4,
"unitNum": 2,
"unitMem": 8
}
],
"hasMore": true,
"total": 2
},
"requestId": "request-id-uuid"
}