Overview
You can call this API to query SQL tuning advices.
API details
Constraints
The caller must have an AccessKey for accessing APIs. For information about how to obtain the AccessKey ID and AccessKey secret, see Manage AccessKeys.
Request path
GET api/v2/instances/{instanceId}/tenants/{tenantId}/sqls/{sqlId}/tuningAdvices
Request parameters
Path
| Parameter | Type | Required | Description |
|---|---|---|---|
| instanceId | String | Yes | The ID of the instance. |
| tenantId | String | Yes | The ID of the tenant. |
| sqlId | String | Yes | The ID of the SQL statement. |
Query
| Parameter | Type | Required | Description |
|---|---|---|---|
| dbName | String | No | The name of the database. |
| startTime | String | No | The start time. |
| endTime | String | No | The end time. |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| data | Object | The SQL tuning advice data. |
| requestId | String | The ID of the request. |
| success | Boolean | Indicates whether the request was successful. |
Examples
Request example
curl --digest -u 'ak:sk' \
-X GET \
'https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/tenants/{tenantId}/sqls/{sqlId}/tuningAdvices' \
-G -d 'dbName=testdb' \
-d 'startTime=2025-01-01T00:00:00Z' \
-d 'endTime=2025-01-02T00:00:00Z'
Response example
JSON format
{
"data": {},
"requestId": "xxxxxx",
"success": true
}