Logs
How to manage/fetch logs of a database cluster.
Retrieves MongoDB logs based on the given parameters.
Authorizations
Path parameters
clusterIdstringRequired
The unique ID of the cluster.
Query parameters
startstring · date-timeOptional
The start time for the query in RFC3339 format. Must not be more than 30 days ago but before the end parameter. The default is 30 days ago.
endstring · date-timeOptional
The end time for the query in RFC3339 format. Must not be greater than now. The default is the current timestamp.
directionstring · enumOptionalDefault:
The direction in which to scan through the logs. The logs are returned in order of the direction.
BACKWARD
Possible values: limitinteger · min: 1 · max: 5000OptionalDefault:
The maximal number of log lines to return. If the limit is reached then log lines will be cut at the end (respecting the scan direction).
100
Responses
200
Successful operation.
application/json
default
Any erroneous status code: 400 (parse error), 401 (auth error),
402 (trial access), 403 (insufficient permissions), 404 (not found),
405 (unsupported HTTP method), 415 (unsupported content type),
422 (validation error), 429 (request rate limit exceeded),
500 (server error), 503 (maintenance)
application/json
get
GET /databases/mongodb/clusters/{clusterId}/logs HTTP/1.1
Host: api.ionos.com
Authorization: Basic username:password
Accept: */*
{
"instances": [
{
"name": "mongodb-cluster-0",
"messages": [
{
"time": "2021-09-06T10:00:38.253+02:00",
"message": "Hello World"
}
]
}
]
}
Was this helpful?