Query the running log list
Last Updated:2021-04-13
Query the running logs
Query the running log of specified instance on specified node.
Description
- The instance is in non-deleted status
- The running log service should be opened for the instance
Request structure
GET /v{version}/instance/{dbInstanceId}/log?memberId={memberId}&type={type}&startTime={startTime}&endTime={endTime} HTTP/1.1
HOST: mongodb.bj.baidubce.com
Authorization: authorization string
Request header fields
There is no other special header field except the common header fileds.
Request parameters
Name | Type | Required or not | Position | Description |
---|---|---|---|---|
version | string | Yes | URL parameters | API version No. |
dbInstanceId | string | Yes | URL parameters | Specify the instance Id |
memberId | string | Yes | URL parameters | Specify the node short Id |
type | string | No | URL parameters | Type of log service, default to “running”, i.e. running log |
startTime | string | No | URL parameters | Query the start time in the format yyyy-MM-ddTHH:mm:ssZ (UTC time) |
endTime | string | No | URL parameters | Query the end time, in the format yyyy-MM-ddTHH:mm:ssZ (UTC time), must be later than querying the start time |
Return header fields
There is no other special header field except the common header fields.
Return parameters
Name | Type | Description |
---|---|---|
logs | List LogFile | Array consisting of running log files |
LogFile structure
Name | Type | Description |
---|---|---|
name | string | Log file name |
startTime | string | The file records the start time, in the format yyyy-MM-ddTHH:mm:ssZ |
endTime | string | The file records the end time, in the format yyyy-MM-ddTHH:mm:ssZ |
size | int | File size, in Byte |
downloadUrl | string | Log file download address |
downloadExpires | int | The download address expires after 86400s by default |
downloadExpireTime | string | Download address expiry time, in the format yyyy-MM-ddTHH:mm:ssZ |
Examples of request
GET /v1/instance/m-qNlWTz/log?memberId="node-LqHbCd"&type="running"&startTime="2021-01-06T00:00:00Z"&endTime="2021-01-06T00:59:59Z" HTTP/1.1
HOST: mongodb.bj.baidubce.com
Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2017-11-21T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
Examples of return
HTTP/1.1 200 OK
x-bce-request-id: 7869616F-7A68-6977-656E-406261696475
Content-Type: application/json
{
"logs":[
{
"downloadExpireTime": "2021-01-07T11:58:44Z",
"downloadExpires": 86400,
"downloadUrl": "http://bj-bos-sandbox.baidu-int.com/xxxx",
"endTime": "2021-01-06T00:00:00Z",
"name": "mongod.log.2021-01-06T01:00:01Z.0_13630403.gz",
"size": 779579,
"startTime": "2021-01-06T01:00:00Z"
}
]
}