Overview
You can call this API to query the tenants in an OceanBase cluster.
API details
Constraints
The caller must have an AccessKey for accessing APIs of OceanBase Cloud. 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
| Parameter | Type | Required | Description | Example value |
|---|---|---|---|---|
| instanceId | String | Yes | The ID of the OceanBase cluster. | ob317v4uif**** |
| tenantName | String | No | The name of the tenant. Fuzzy match is supported when you 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
| Parameter | Type | Description | Example value |
|---|---|---|---|
| data | Object | The information about the tenant, including the dataList parameter. | |
| dataList | Object[] | The list of information about the tenant, including the following parameters. | |
| tenantId | String | The ID of the tenant. | t33h8y08k**** |
| tenantName | String | The name of the tenant. Fuzzy match is supported when you search for tenants by name. |
pay_**** |
| tenantMode | String | The mode of the tenant. Valid values:
|
Oracle |
| status | String | The status of the tenant. Valid values:
|
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 resource unit of the tenant. | 5 |
| unitMem | Integer | The size of memory for each unit of the tenant, in GiB. | 10 |
| unitNum | Integer | The number of resource units for 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 deployed for the cluster. | 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"
}