Overview
You can call this API to query the list of tenants in an OceanBase cluster based on specified conditions. You can perform fuzzy matching on the tenant name and filter tenants by tags. You can also perform pagination queries.
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
Path
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| instanceId | String | Yes | The ID of the OceanBase Cloud instance. | ob317v4uif**** |
Query
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| requestId | String | Yes | The ID of the request. This parameter is used for tracing. | dc302d76-66b5-48d8-ab53-a035******** |
| pageNumber | Integer | No | The number of the page to return.
|
1 |
| pageSize | Integer | No | The number of entries to return on a page.
|
10 |
| tenantName | String | No | The name of the tenant. You can perform fuzzy matching on the tenant name. |
pay_**** |
| tagList | String | No | The list of tags. | N/A |
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 perform fuzzy matching on the tenant 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. | 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 '<Your ak:sk>' \
--request GET \
--url 'https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/tenants?requestId={requestId}&pageNumber={pageNumber}&pageSize={pageSize}&tenantName={tenantName}&tagList={tagList}' \
-H 'X-Ob-Project-Id: <Project ID>'
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",
"server": "xxx.xxx.x.xxx:xxxx"
}
