Description
You can call this operation to query all inspection tasks.
Call description
Prerequisites
You have passed the authentication for the OceanBase Cloud Platform (OCP) application service.
Request path
GET /api/v2/inspection/task
Request parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| inspectionObjectTypes | Array | No | OB_CLUSTER | The type of the inspection object. Valid values: OB_CLUSTER: indicates an OceanBase cluster.OB_TENANT: indicates an OceanBase Database tenant.HOST: indicates a host.OB_PROXY: indicates an OBProxy. |
| tags | Array | No | 1 | The tag of the inspection scenario. The tag IDs are listed as follows: 1: indicates basic inspection.2: indicates performance inspection.3: indicates in-depth inspection.4: indicates installation inspection. |
| taskStates | String | No | SUCCESSFUL | The status of the inspection task. Valid values: RUNNING: indicates that the inspection task is running.FAILED: indicates that the inspection task failed.SUCCESSFUL: indicates that the inspection task has been completed. |
| name | String | No | cluster_test | The name of the inspection object. |
Response parameters
Basic data structure
| Parameter | Type | Description |
|---|---|---|
| data | Object | The information of InspectionReportOverview. For more information, see Data structure of InspectionReportOverview. |
| successful | Boolean | Indicates whether the request was successful. |
| timestamp | Datetime | The timestamp when the server completed the request. |
| duration | Integer | The amount of time taken by the server to process the request, in milliseconds. |
| status | Integer | The HTTP status code. |
| traceId | String | The trace ID of the request. This trace ID is used for troubleshooting. |
| server | String | The address of the application server that responded to the request. |
Data structure of InspectionReportOverview
| Parameter | Type | Description |
|---|---|---|
| id | Integer | The ID of the inspection report. |
| tag | InspectionTag | The information of InspectionTag. For more information, see Data structure of InspectionTag. |
| inspectionObject | InspectionObject | The information of InspectionObject. For more information, see Data structure of InspectionObject. |
| startTime | String | The inspection start time. |
| endTime | String | The inspection end time. This parameter is absent when the inspection task is running. |
| taskId | Integer | The ID of the inspection task. |
| itemTotalCount | Integer | The total number of inspection items. |
| itemFinishedCount | Integer | The number of completed inspection items. |
| highRiskCount | Integer | The number of high-risk inspection items. |
| mediumRiskCount | Integer | The number of medium-risk inspection items. |
| lowRiskCount | Integer | The number of low-risk inspection items. |
| taskState | String | The status of the inspection task. |
Data structure of InspectionTag
| Parameter | Type | Description |
|---|---|---|
| id | Integer | The ID of the tag of the inspection scenario. |
| name | String | The name of the tag. |
| description | String | The description of the tag. |
| configType | String | The configuration type. |
Data structure of InspectionObject
| Parameter | Type | Description |
|---|---|---|
| objectId | Integer | The ID of the inspection object. |
| inspectionObjectType | String | The type of the inspection object. |
| name | String | The name of the inspection object. |
Examples
Sample request
GET /api/v2/inspection/task
Sample response
{
"data": {
"contents": [
{
"endTime": "2024-07-30T14:31:10+08:00",
"highRiskCount": 4,
"id": 1000025,
"inspectionObject": {
"info": {
"obClusterId": "12",
"type": "PRIMARY"
},
"inspectionObjectType": "OB_CLUSTER",
"name": "OB_TEST_1",
"objectId": 1
},
"itemFinishedCount": 64,
"itemTotalCount": 64,
"lowRiskCount": 17,
"mediumRiskCount": 4,
"startTime": "2024-07-30T14:31:06+08:00",
"tag": {
"configType": "BUILTIN",
"description": "Checks resources managed by OCP for hidden risks. You can perform this in-depth check before peak hours." ,
"id": 3,
"name": "In-depth Inspection"
},
"taskId": 6058477,
"taskState": "SUCCESSFUL"
}
],
"page": {
"number": 1,
"size": 1,
"totalElements": 25,
"totalPages": 25
}
},
"duration": 11,
"server": "124075fe52",
"status": 200,
"successful": true,
"timestamp": "2024-07-30T16:29:45.995+08:00",
"traceId": "8c75e28370935e98"
}