1.URL

http://124.223.60.234:8080/system/asset/supervisor/deleteLogFile

2.请求参数

2.1请求头

在Headers里面增加token:对应登录验证成功后,data里面对应的tokenId

2.2.参数示例

{
    "id":"B4006BDA34E941789B5EBAC2665D0F60",
    "path":"/opt/gnss/system-api/logs/",
    "fileName":"system-api-2023-05-31.log",
    "key":"ERROR:",
    "type":0
}

2.3.参数说明

字段 类型 说明 是否必须
id String 服务器唯一标识 Y
path String 日志文件的目录 Y
fileName String 日志文件名称 Y
key String 关键字或者自定义检索命令 Y
type int 0:关键字查找(如果是模糊搜索,则key例如:1234567890);1:自定义检索脚本(如果是自定义检索搅拌,则key例如:grep ‘1234567890’) Y

3.接口应答

3.1.返回示例

{
    "code": 200,
    "message": "Operation succeeded",
    "data": {
        "stdOutput": "[\"2023-05-31 18:36:54.730 ERROR [http-nio-8080-exec-8] org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/system].[dispatcherServlet]:175 - Servlet.service() for servlet [dispatcherServlet] in context with path [/system] threw exception [Request processing failed; nested exception is org.springframework.http.converter.HttpMessageNotWritableException: No converter for [class com.gnss.system.base.Result] with preset Content-Type 'application/octet-stream'] with root cause\",\"2023-05-31 20:52:18.818 ERROR [http-nio-8080-exec-10] com.gnss.system.service.asset.operation.SupervisorService:457 - selectLogsByKey:\"]",
        "errOutput": "",
        "returnCode": 0
    }
}

3.2.返回结果说明

字段 类型 说明
code int 返回状态
message String 返回结果描述
data object 返回结果体

data说明

字段 类型 说明
stdOutput String 匹配到的行集合JSON格式
errOutput String 如果操作异常,则此处才会有值
returnCode int 返回码,暂时不考虑

4.示例

作者:admin  创建时间:2023-12-27 10:57
最后编辑:admin  更新时间:2023-12-27 11:11