Notice
This API is deprecated. For more information, see DescribeMetricsData - Query metric data.
Overview
You can call this API to query the metric data of an OceanBase tenant.
API details
Constraints
You 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
Query
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| InstanceId | string | Yes | The ID of the OceanBase cluster. | ob317v4uif**** |
| tenantId | string | Yes | The ID of the tenant. | tfafd34fs**** |
Body
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| startTime | string | Yes | The start time for the metric data. The value must be in the UTC format of YYYY-MM-DDThh:mm:ssZ. | 2021-06-13T15:40:43Z |
| endTime | string | Yes | The end time for the metric data. The value must be in the UTC format of YYYY-MM-DDThh:mm:ssZ. | 2021-09-13T15:40:43Z |
| metrics | List |
Yes | The name of the metric. | otal_sessions_tenant |
| tenantIdList | List |
No | The IDs of the tenants. | t4tx6u5tc**** |
| nodeIdList | List |
No | The IDs of the nodes. | i-0104c6fb57e6e**** |
Response parameters
| Name | Type | Description | Example value |
|---|---|---|---|
| data | object | The return result of the request. | |
| RequestId | string | The ID of the request. | EE205C00-30E4-****-****-87E3A8A2AA0C |
| data | List | The metric data of the tenants. | Details are shown in the following example. |
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 'AccessKeyID:AccessKeySecret' \
--request POST \
--url https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/tenants/{tenantId}/metrics \
-H 'X-Ob-Project-Id: <Project ID>'
--data \
'{"refreshId":0,"metricKeys":["tps_tenant"],"drillDown":false,"startTime":"2023-06-19T05:32:56Z","endTime":"2023-06-19T06:32:56Z","metrics":["tps_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
}
]
}
]
}