获取MySQL实例查杀会话历史
更新时间:2024-11-15
接口描述
获取MySQL实例查杀会话历史
权限说明
鉴权认证机制的详细内容请参见鉴权认证。
请求结构
POST /v{version}/diagnosis/mysql/session/kill/history?appId=appId&nodeId=nodeId&start=start&end=end
Host: dbsc.bj.baidubce.com
Authorization: authorization string
{
"appId":appId,
"nodeId":nodeId,
"start":start,
"end":end
}
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 必选 | 参数位置 | 描述 |
---|---|---|---|---|
version | string | 是 | Path参数 | API版本号 |
appId | string | 是 | Query参数 | 集群ID |
nodeId | string | 是 | Query参数 | 节点ID |
start | datetime | 是 | Query参数 | 查询范围开始时间 |
end | datetime | 是 | Query参数 | 查询范围结束时间 |
响应头域
除公共头域外,无其它特殊头域。
响应参数
参数名称 | 类型 | 描述 |
---|---|---|
totalCount | integer | 查杀历史会话总数 |
items | LIst |
查杀历史会话详情 |
SessionKillHistory
参数名称 | 类型 | 描述 |
---|---|---|
sessionId | integer | 会话ID |
sessionUser | string | 会话连接用户 |
sessionHost | string | 会话客户端Host |
sessionDb | string | 会话连接DB |
sessionCommand | string | 会话执行的命令类型 |
sessionExecuteTime | integer | 会话持续的时间,单位秒 |
sessionState | string | 会话状态 |
sessionSql | string | 会话执行的SQL |
status | integer | 查杀会话任务的状态值 |
statusDesc | string | 查杀会话任务的状态描述 |
statusInfo | string | 查杀会话任务的详情,一般查杀失败时会展示 |
operateTime | datetime | 操作时间 |
请求示例
GET /v1/diagnosis/mysql/session/kill/history?appId=rds-0mxm0cTI&nodeId=rds-0mxm0cTI&start=2024-11-11T00:00:00Z&end=2024-11-12T10:00:00Z HTTP/1.1
Host: dbsc.bj.baidubce.com
Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2023-07-11T11:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
响应示例
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
x-bce-request-id: d8752367-38e8-45e4-b4c7-e53be3137ce5
{
"totalCount": 1,
"items": [
{
"sessionId": 8636039,
"sessionUser": "test",
"sessionHost": "100.79.9.105:14670",
"sessionDb": "",
"sessionCommand": "Sleep",
"sessionExecuteTime": 192,
"sessionState": "",
"sessionSql": "",
"status": 1,
"statusDesc": "SUCCESS",
"statusInfo": "",
"operateTime": "2024-11-12T03:31:15.658Z"
},
{
"sessionId": 8636039,
"sessionUser": "",
"sessionHost": "",
"sessionDb": "",
"sessionCommand": "",
"sessionExecuteTime": 0,
"sessionState": "",
"sessionSql": "",
"status": 0,
"statusDesc": "FAILED",
"statusInfo": "The session termination attempt failed.",
"operateTime": "2024-11-12T03:31:45Z"
},
{
"sessionId": 8636039,
"sessionUser": "",
"sessionHost": "",
"sessionDb": "",
"sessionCommand": "",
"sessionExecuteTime": 0,
"sessionState": "",
"sessionSql": "",
"status": 0,
"statusDesc": "FAILED",
"statusInfo": "The session termination attempt failed.",
"operateTime": "2024-11-12T03:33:54.522Z"
},
{
"sessionId": 8636411,
"sessionUser": "test",
"sessionHost": "100.79.9.105:20351",
"sessionDb": "",
"sessionCommand": "Sleep",
"sessionExecuteTime": 41,
"sessionState": "",
"sessionSql": "",
"status": 1,
"statusDesc": "SUCCESS",
"statusInfo": "",
"operateTime": "2024-11-12T03:34:05.265Z"
}
]
}