Get All Log Collection Jobs for One Project
On this page
Note
Groups and projects are synonymous terms. Your {PROJECT-ID}
is the
same as your project id. For existing groups, your group/project id
remains the same. This page uses the more familiar term group when
referring to descriptions. The endpoint remains as stated in the
document.
When you create a log collection job, Ops Manager starts a background job to download the logs from the specified Ops Manager deployment. Use this endpoint to retrieve all log collection jobs for a specified Ops Manager project.
Base URL: https://{OPSMANAGER-HOST}:{PORT}/api/public/v1.0
Resource
GET /groups/{GROUP-ID}/logCollectionJobs
Request Path Parameters
Name | Type | Necessity | Description |
---|---|---|---|
GROUP-ID | string | Required | Unique 24-hexadecimal digit string that identifies the log
collection request job. |
Request Query Parameters
Name | Type | Necessity | Description | Default |
---|---|---|---|---|
pageNum | number | Optional | One-based integer that returns a subsection of results. | 1 |
itemsPerPage | number | Optional | Number of items to return per page, up to a maximum of 500. | 100 |
pretty | boolean | Optional | Flag that indicates whether the response body should be in a
prettyprint format. | false |
envelope | boolean | Optional | Flag that indicates whether or not to wrap the response in an envelope. Some API clients cannot access the HTTP response headers or
status code. To remediate this, set For endpoints that return a list of results, the | false |
verbose | Boolean | Optional | Flag that indicates whether to include all child jobs in the
response. Each log collection job contains child jobs for each
log type and MongoDB process included in the request. | false |
Request Body Parameters
This endpoint doesn't use HTTP request body parameters.
Response
Response Document
The response JSON document includes an array of result objects, an array of link objects and a count of the total number of result objects retrieved.
Name | Type | Description |
---|---|---|
results | array | Array includes one object for each item detailed in the
results Embedded Document section. |
links | array | Array includes one or more links to sub-resources
and/or related resources. The relations between URLs are
explained in the Web Linking Specification. |
totalCount | number | Integer count of the total number of items in the result set. It
may be greater than the number of objects in the
results array if the entire result set is paginated. |
results
Embedded Document
Each result is one log collection job.
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
childJobs | array | List of child jobs associated with this request. Included in the
response if you set tthe verbose query parameter to
true . | ||||||||||||
childJobs[n].errorMessage | string | Error message showing why this child job failed, if applicable. | ||||||||||||
childJobs[n].finishDate | string | Timestamp in ISO 8601 date and time format in UTC when this child job finished. | ||||||||||||
childJobs[n].hostName | string | Name of the host from whom the child job collects the logs. | ||||||||||||
childJobs[n].logCollectionType | string | Type of log this child job collects. Returns one of the following values:
| ||||||||||||
childJobs[n].path | string | Path to the process in the deployment for which this child job collects logs. MongoDB Atlas uses these paths to build the directory hierarchy in the compressed archive file.
| ||||||||||||
childJobs[n].startDate | string | Timestamp in ISO 8601 date and time format in UTC when this child job started. | ||||||||||||
childJobs[n].status | string | Status of this child job. This resource returns one of the following values:
| ||||||||||||
childJobs[n].uncompressedDiskSpaceBytes | number | Total uncompressed disk space in bytes that this child job uses. | ||||||||||||
creationDate | string | Timestamp, in the number of seconds that have elapsed since the UNIX epoch when you created the log collection request job. | ||||||||||||
expirationDate | string | Timestamp, in the number of seconds that have elapsed since the UNIX epoch when the log collection request job expires. | ||||||||||||
groupId | string | Unique 24-hexadecimal digit string that identifies the
project associated with log collection request. | ||||||||||||
id | string | Unique 24-hexadecimal digit string that identifies the log
collection request job. | ||||||||||||
logTypes | array | List of log types included in this request. This resource returns one or more of the following values:
| ||||||||||||
redacted | boolean | Flag that indicates whether the request replaces emails,
hostnames, IP addresses, and namespaces in the response with
random string values. | ||||||||||||
resourceName | string | Name of the resource for which you requested logs. | ||||||||||||
resourceType | string | Type of resource for which you requested logs. This resource returns one of the following values:
| ||||||||||||
rootResourceName | string | Name of the complete deployment if you made the log request to a
part of a deployment. Part of the deployment could be a replica
set in a cluster or one shard of a sharded cluster. | ||||||||||||
rootResourceType | string | Type of the part of the complete deployment if you made the log request to a part of a deployment. Part of the deployment could be a replica set in a cluster or one shard of a sharded cluster. This resource returns one of the following values:
| ||||||||||||
status | string | Status of the log collection request job. This resource returns one of the following values:
| ||||||||||||
sizeRequestedPerFileBytes | number | Size for each log file in bytes. | ||||||||||||
uncompressedSizeTotalBytes | number | Total uncompressed size of the log data in bytes that this
request returns. | ||||||||||||
userId | string | Unique 24-hexadecimal digit string that identifies the user
executing the request. | ||||||||||||
downloadUrl | string | Internet address from which you download the logs from this
request. |
Example Request
1 curl --user "{PUBLIC-KEY}:{PRIVATE-KEY}" --digest \ 2 --header "Accept: application/json" \ 3 --include \ 4 --request GET "https://<OpsManagerHost>:<Port>/api/public/v1.0/groups/{GROUP-ID}/logCollectionJobs?verbose=true&pretty=true"
Example Response
Response Header
401 Unauthorized Content-Type: application/json;charset=ISO-8859-1 Date: {dateInUnixFormat} WWW-Authenticate: Digest realm="MMS Public API", domain="", nonce="{nonce}", algorithm=MD5, op="auth", stale=false Content-Length: {requestLengthInBytes} Connection: keep-alive
200 OK Vary: Accept-Encoding Content-Type: application/json Strict-Transport-Security: max-age=300 Date: {dateInUnixFormat} Connection: keep-alive Content-Length: {requestLengthInBytes} X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion}
Response Body
1 { 2 "links": [ 3 { 4 "href": "https://<OpsManagerHost>:<Port>/api/public/v1.0/groups/{GROUP-ID}/logCollectionJobs?verbose=true&pageNum=1&itemsPerPage=100", 5 "rel": "self" 6 } 7 ], 8 "results": [ 9 { 10 "childJobs": [ 11 { 12 "automationAgentId": "5c810cc4ff7a256345ff97bf", 13 "errorMessage": null, 14 "finishDate": "2019-03-07T12:21:30Z", 15 "hostName": "server1.example.com", 16 "logCollectionType": "AUTOMATION_AGENT", 17 "path": "server1.example.com/automation_agent", 18 "startDate": "2019-03-07T12:21:24Z", 19 "status": "SUCCESS", 20 "uncompressedDiskSpaceBytes": 14686 21 } 22 ], 23 "creationDate": "2019-03-07T12:21:24Z", 24 "downloadUrl": "https://<OpsManagerHost>:<Port>/api/public/v1.0/groups/{GROUP-ID}/logCollectionJobs/5c810cc4ff7a256345ff97b7/download", 25 "expirationDate": "2019-04-06T12:21:24Z", 26 "groupId": "5c8100bcf2a30b12ff88258f", 27 "id": "5c810cc4ff7a256345ff97b7", 28 "logTypes": [ 29 "AUTOMATION_AGENT", 30 "MONGODB" 31 ], 32 "redacted": true, 33 "resourceName": "myReplicaSet", 34 "resourceType": "replicaset", 35 "rootResourceName": "myReplicaSet", 36 "rootResourceType": "replicaset", 37 "sizeRequestedPerFileBytes": 1000, 38 "status": "SUCCESS", 39 "uncompressedSizeTotalBytes": 63326, 40 "userId": "5c80f75fcf09a246878f67a4" 41 }, 42 { 43 "childJobs": [ 44 { 45 "automationAgentId": "5c81086e014b76a3d85e1117", 46 "errorMessage": null, 47 "finishDate": "2019-03-07T12:02:57Z", 48 "hostName": "server1.example.com:27027", 49 "logCollectionType": "MONGODB", 50 "path": "server1.example.com/27027/mongodb", 51 "startDate": "2019-03-07T12:02:54Z", 52 "status": "SUCCESS", 53 "uncompressedDiskSpaceBytes": 9292 54 } 55 ], 56 "creationDate": "2019-03-07T12:02:54Z", 57 "downloadUrl": "https://<OpsManagerHost>:<Port>/api/public/v1.0/groups/{GROUP-ID}/logCollectionJobs/5c81086e014b76a3d85e1113/download", 58 "expirationDate": "2019-05-06T12:02:54Z", 59 "groupId": "5c8100bcf2a30b12ff88258f", 60 "id": "5c81086e014b76a3d85e1113", 61 "logTypes": [ 62 "MONGODB", 63 "FTDC", 64 "AUTOMATION_AGENT" 65 ], 66 "redacted": false, 67 "resourceName": "myReplicaSet", 68 "resourceType": "replicaset", 69 "rootResourceName": "myReplicaSet", 70 "rootResourceType": "replicaset", 71 "sizeRequestedPerFileBytes": 1000, 72 "status": "IN_PROGRESS", 73 "uncompressedSizeTotalBytes": 44518, 74 "userId": "5c80f75fcf09a246878f67a4" 75 } 76 ], 77 "totalCount": 2 78 }