This topic describes how to query the inspection history by using an API. You can use the pagination, filtering, and sorting features.
API call
If you set a password, you must pass the authentication. For more information, see API hybrid encryption.
Request path
GET /api/v1/obcluster/inspection/reports
Request parameters
Parameter |
Type |
Required |
Example value |
Description |
|---|---|---|---|---|
| page | int | No | 1 | The page number. Default value: 1. This parameter is specified by using the query param. |
| size | int | No | 10 | The number of records on each page. Default value: 10. This parameter is specified by using the query param. |
| scenario | string | Yes | basic | The scenario for filtering. Valid values: "basic" or "performance". This parameter is specified by using the query param. |
| sort | string | No | start_time,desc | The sorting parameter. The value is in the "field name,sort order" format. Default value: "start_time,desc". This parameter is specified by using the query param. |
Response
Parameter |
Type |
Description |
|---|---|---|
| successful | bool | Indicates whether the request was successful. |
| timestamp | time.Time | The timestamp when the server completed the request. |
| duration | int | The time taken by the server to process the request, in milliseconds. |
| status | int | The HTTP status code. |
| traceId | string | The trace ID of the request. |
| data | PaginatedInspectionHistoryResponse | The paginated inspection history. The response contains the following information:
|
| error | ApiError | The error information. The response contains the following information:
|
InspectionReportBriefInfo
Parameter |
Type |
Description |
|---|---|---|
| id | int | The ID of the inspection report. |
| scenario | string | The inspection scenario. Valid values: "basic" or "performance". |
| critical_count | int | The number of critical issues. |
| failed_count | int | The number of failed items. |
| warning_count | int | The number of warning items. |
| pass_count | int | The number of passed items. |
| start_time | time.Time | The start time. |
| finish_time | time.Time | The end time. |
| local_task_id | string | The ID of the local task. |
| status | string | The status. |
| error_message | string | The error message. |
CustomPage
Parameter |
Type |
Description |
|---|---|---|
| total_elements | uint64 | The total number of records. |
| total_pages | uint64 | The total number of pages. |
| size | uint64 | The number of records on each page. |
| number | uint64 | The current page number. |
Examples
Request example
GET 10.10.10.1:2886/api/v1/obcluster/inspection/reports?page=1&size=10&scenario=basic&sort=start_time,desc
Response example
{
"successful": true,
"timestamp": "2025-10-14T15:15:01.277047628+08:00",
"duration": 25,
"status": 200,
"traceId": "e6f64ba7f54e7a48",
"data": {
"contents": [
{
"id": 1,
"scenario": "basic",
"critical_count": 0,
"failed_count": 0,
"warning_count": 2,
"pass_count": 15,
"start_time": "2025-10-14T15:14:01.277047628+08:00",
"finish_time": "2025-10-14T15:14:30.277047628+08:00",
"local_task_id": "1001",
"status": "SUCCEED",
}
],
"page": {
"total_elements": 1,
"total_pages": 1,
"size": 10,
"number": 1
}
}
}
