Notice
This API is deprecated. For more information, see DescribeMetricsData - Query monitoring metrics.
Overview
You can call this API to query the metrics of an OceanBase tenant.
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
POST /api/v2/instances/{instanceId}/tenants/{tenantId}/metrics
Request parameters
Path
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| instanceId | string | Yes | The ID of the OceanBase instance. | obcluster-***** |
| tenantId | string | Yes | The ID of the tenant. | t4louaeei**** |
Query
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| requestId | string | No | The ID of the request. This parameter is used for tracing. | dc302d76-66b5-48d8-ab53-a035******** |
Body
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| startTime | string | Yes | The start time of the monitoring data. The value must be in the UTC time format of YYYY-MM-DDThh:mm:ssZ. | 2021-06-13T15:40:43Z |
| endTime | string | Yes | The end time of the monitoring data. The value must be in the UTC time format of YYYY-MM-DDThh:mm:ssZ. | 2021-09-13T15:40:43Z |
| metrics | array[string] | Yes | The list of metric names. | ["total_sessions_tenant"] |
| tenantIdList | array[string] | No | The list of tenant IDs. | ["t4tx6u5tc****"] |
| nodeIdList | array[string] | No | The list of node IDs. | ["i-0104c6fb57e6e****"] |
| UID | string | No | The user identifier. | - |
| User_ID | string | No | The user ID. | - |
| requestId | string | No | The ID of the request. | dc302d76-66b5-48d8-ab53-a035******** |
| callerType | string | No | The type of the caller. | - |
| accessKeyId | string | No | The ID of the AccessKey. | - |
| securityToken | string | No | The security token. | - |
| callerUid | string | No | The UID of the caller. | - |
| callerBid | string | No | The BID of the caller. | - |
| stsTokenCallerUid | string | No | The UID of the caller of the STS token. | - |
| stsTokenCallerBid | string | No | The BID of the caller of the STS token. | - |
| acceptLanguage | string | No | The language to be accepted. | - |
| pageNumber | integer | No | The page number. | 1 |
| pageSize | integer | No | The number of items on each page. | 10 |
| mergedCallerBid | string | No | The merged BID of the caller. | - |
Response parameters
| Name | Type | Description | Example value |
|---|---|---|---|
| data | object | The return result of the request. | - |
| RequestId | string | The ID of the request. | EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C |
data example
"data":[
{
"nodeId":"ins-122dhae",
"ip":"xx.xxx.xxx.xx",
"metrics":[
{
"total_sessions_tenant":0,
"timestamp":1687640160
},
{
"total_sessions_tenant":1,
"timestamp":1687661700
},
{
"total_sessions_tenant":1,
"timestamp":1687661760
}
]
}
]
Examples
Request example
curl --digest -u '<Your AccessKey ID:AccessKey secret>' \
--request POST \
--url 'https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/tenants/{tenantId}/metrics?requestId={requestId}' \
-H 'Content-Type: application/json' \
-H 'X-Ob-Project-Id: <Project ID>' \
--data '{"startTime":"2023-06-19T05:32:56Z","endTime":"2023-06-19T06:32:56Z","metrics":["total_sessions_tenant"]}'
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
{
"RequestId": "EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C",
"data": [
{
"tenantName": "obmt4tpqx195803k",
"tenantId": "obmt4tpqx195803k",
"obTenantId": "obmt4tpqx195803k",
"metrics": [
{
"total_sessions_tenant": 0,
"timestamp": 1687640160
},
{
"total_sessions_tenant": 1,
"timestamp": 1687661700
},
{
"total_sessions_tenant": 1,
"timestamp": 1687661760
}
]
}
]
}
