Notice
This API is deprecated. For more information, see DescribeMetricsData - Query metrics.
Overview
You can call this API to query the metrics of an OceanBase node.
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}/nodes/{nodeId}/metrics
Request parameters
Path parameters
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| instanceId | string | Yes | The ID of the OceanBase instance. | ob317v4uif**** |
| nodeId | string | Yes | The ID of the node. | i-bp16niirq4zdmgvm** |
Query parameters
| 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******** |
Body parameters
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| startTime | string | Yes | The start time of the metrics. The time must be in UTC and in the format of: YYYY-MM-DDThh:mm:ssZ. | 2021-06-13T15:40:43Z |
| endTime | string | Yes | The end time of the metrics. The time must be in UTC and in the 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 ID. | N/A |
| User_ID | string | No | The user ID. | N/A |
| requestId | string | No | The ID of the request. | N/A |
| callerType | string | No | The type of the caller. | N/A |
| accessKeyId | string | No | The ID of the AccessKey. | N/A |
| securityToken | string | No | The security token. | N/A |
| callerUid | string | No | The UID of the caller. | N/A |
| callerBid | string | No | The BID of the caller. | N/A |
| stsTokenCallerUid | string | No | The UID of the caller of the STS token. | N/A |
| stsTokenCallerBid | string | No | The BID of the caller of the STS token. | N/A |
| acceptLanguage | string | No | The language accepted. | N/A |
| pageNumber | integer | No | The page number. | 1 |
| pageSize | integer | No | The number of items per page. | 10 |
| mergedCallerBid | string | No | The merged BID of the caller. | N/A |
Response parameters
| Name | Type | Description | Example value |
|---|---|---|---|
| RequestId | string | The ID of the request. | EE205C00-30E4-xxxx-xxxx-87E3A8A2AA0C |
| data | List | The metrics of the node. | For more information, see the following code example. |
data example:
"data":[
{
"nodeId":"ins-122dhae",
"ip":"xx.xxx.xxx.xx",
"obInstanceId":"xx.xx.xxx.xxx",
"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 ak:sk>' \
--request POST \
--url 'https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/nodes/{nodeId}/metrics?requestId={requestId}' \
-H 'Content-Type: application/json' \
-H 'X-Ob-Project-Id: <Project ID>' \
--data '{
"startTime": "2021-06-13T15:40:43Z",
"endTime": "2021-09-13T15:40:43Z",
"metrics": ["total_sessions_tenant"],
"tenantIdList": ["t4tx6u5tc****"],
"nodeIdList": ["i-0104c6fb57e6e****"]
}'
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":[
{
"nodeId":"ins-122dhae",
"ip":"xx.xxx.xxx.xx",
"obInstanceId":"xx.xx.xxx.xxx",
"metrics":[
{
"total_sessions_tenant":0,
"timestamp":1687640160
},
{
"total_sessions_tenant":1,
"timestamp":1687661700
},
{
"total_sessions_tenant":1,
"timestamp":1687661760
}
]
}
]
}
