Navigation

Get All Log Collection Jobs for a Group

Note

Groups and projects are synonymous terms. Your {GROUP-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, Cloud Manager starts a background job to download the logs from the specified Cloud Manager deployment. Use this endpoint to retrieve all log collection jobs for a specified Cloud Manager group.

Base URL: https://cloud.mongodb.com/api/public/v1.0

Resource

GET /groups/{GROUP-ID}/logCollectionJobs

Request Path Parameters

Name Type Description
GROUP-ID string Unique identifier of the project for which to retrieve log collection jobs.

Request Query Parameters

Name Type Description Default
pageNum integer Page number (1-based). 1
itemsPerPage integer Number of items to return per page, up to a maximum of 500. 100
pretty boolean Indicates whether the response body should be in a prettyprint format. false
envelope boolean

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 envelope=true in the query.

For endpoints that return a list of results, the results object is an envelope. Cloud Manager adds the status field to the response body.

false
verbose Boolean If true, returns 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 does not 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 object array This array includes one object for each item detailed in the results Embedded Document section.
links object array This 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 The 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
id string Unique identifier of the log collection request job.
groupId string Unique identifier of the project that the log collection request is associated with.
userId string Unique identifier of the user executing the request.
creationDate date Timestamp in ISO 8601 date and time format in UTC when the log collection request job was created.
expirationDate date Timestamp in ISO 8601 date and time format in UTC when the log collection request job expires.
status string

Status of the log collection request job. Will be one of the following values:

  • SUCCESS
  • FAILURE
  • IN_PROGRESS
  • MARKED_FOR_EXPIRY
  • EXPIRED
sizeRequestedPerFileBytes number Size for each log file in bytes.
resourceType string

Type of resource for which logs were requested. Will be one of the following values:

  • CLUSTER
  • PROCESS
  • REPLICA_SET
resourceName string Name of the resource for which logs were requested.
redacted boolean If true, emails, hostnames, IP addresses, and namespaces in the response are replaced with random string values.
rootResourceName string If the request is made to a part of a deployment, such as one replica set in a cluster, this is the name of the complete deployment.
rootResourceType string

If the request is made to a part of a deployment, such as one replica set in a cluster, this is the type of the complete deployment. Will be one of the following values:

  • CLUSTER
  • PROCESS
  • REPLICA_SET
uncompressedSizeTotalBytes number Total uncompressed size of the log data returned by this request in bytes.
logTypes array

Array of log types included in this request. Will contain one or more of the following values:

  • AUTOMATION_AGENT
  • BACKUP_AGENT
  • MONITORING_AGENT
  • MONGODB
  • FTDC
url string URL to download the logs from this request.
childJobs array Array of child jobs associated with this request. Included in the response if the verbose query parameter is set to true.
childJobs[n].uncompressedDiskSpaceBytes number Total uncompressed disk space in bytes used by this child job.
childJobs[n].status string

Status of this child job. Will be one of the following values:

  • SUCCESS
  • FAILURE
  • IN_PROGRESS
  • MARKED_FOR_EXPIRY
  • EXPIRED
childJobs[n].startDate date Timestamp in ISO 8601 date and time format in UTC when this child job started.
childJobs[n].finishDate date Timestamp in ISO 8601 date and time format in UTC when this child job finished.
childJobs[n].hostName string Name of the host whose logs are collected by this child job.
childJobs[n].logCollectionType string

The type of log collected by this child job. Will be one of the following values:

  • AUTOMATION_AGENT
  • BACKUP_AGENT
  • MONITORING_AGENT
  • MONGODB
  • FTDC
childJobs[n].errorMessage string Error message showing why this child job failed, if applicable.
childJobs[n].path string Path to the process in the deployment for which this child job collects logs.

Example Request

curl --user "{username}:{apiKey}" --digest \
 --header "Accept: application/json" \
 --header "Content-Type: application/json" \
 --include \
 --request GET "https://cloud.mongodb.com/api/public/v1.0/groups/{GROUP-ID}/logCollectionJobs?verbose=true"

Example Response

Response Header

HTTP/1.1 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
HTTP/1.1 200 OK
Vary: Accept-Encoding
Content-Type: application/json
Strict-Transport-Security: max-age=300
Date: {dateInUnixFormat}
Connection: keep-alive
Content-Length: {requestLengthInBytes}

Response Body

{
  "links": [
    {
      "href": "https://cloud.mongodb.com/api/public/v1.0/groups/5c8100bcf2a30b12ff88258f/logCollectionJobs?verbose=true&pageNum=1&itemsPerPage=100",
      "rel": "self"
    }
  ],
  "results": [
    {
      "childJobs": [
        {
          "automationAgentId": "5c810cc4ff7a256345ff97bf",
          "errorMessage": null,
          "finishDate": "2019-03-07T12:21:30Z",
          "hostName": "server1.example.com",
          "logCollectionType": "AUTOMATION_AGENT",
          "path": "server1.example.com/automation_agent",
          "startDate": "2019-03-07T12:21:24Z",
          "status": "SUCCESS",
          "uncompressedDiskSpaceBytes": 14686
        },
        ...
      ],
      "creationDate": "2019-03-07T12:21:24Z",
      "downloadUrl": "https://cloud.mongodb.com/api/public/v1.0/groups/5c8100bcf2a30b12ff88258f/logCollectionJobs/5c810cc4ff7a256345ff97b7/download",
      "expirationDate": "2019-04-06T12:21:24Z",
      "groupId": "5c8100bcf2a30b12ff88258f",
      "id": "5c810cc4ff7a256345ff97b7",
      "logTypes": [
        "AUTOMATION_AGENT",
        "MONGODB"
      ],
      "redacted": true,
      "resourceName": "myReplicaSet",
      "resourceType": "replicaset",
      "rootResourceName": "myReplicaSet",
      "rootResourceType": "replicaset",
      "sizeRequestedPerFileBytes": 1000,
      "status": "SUCCESS",
      "uncompressedSizeTotalBytes": 63326,
      "userId": "5c80f75fcf09a246878f67a4"
    },
    {
      "childJobs": [
        {
          "automationAgentId": "5c81086e014b76a3d85e1117",
          "errorMessage": null,
          "finishDate": "2019-03-07T12:02:57Z",
          "hostName": "server1.example.com:27027",
          "logCollectionType": "MONGODB",
          "path": "server1.example.com/27027/mongodb",
          "startDate": "2019-03-07T12:02:54Z",
          "status": "SUCCESS",
          "uncompressedDiskSpaceBytes": 9292
        },
        ...
      ],
      "creationDate": "2019-03-07T12:02:54Z",
      "downloadUrl": "https://cloud.mongodb.com/api/public/v1.0/groups/5c8100bcf2a30b12ff88258f/logCollectionJobs/5c81086e014b76a3d85e1113/download",
      "expirationDate": "2019-05-06T12:02:54Z",
      "groupId": "5c8100bcf2a30b12ff88258f",
      "id": "5c81086e014b76a3d85e1113",
      "logTypes": [
        "MONGODB",
        "FTDC",
        "AUTOMATION_AGENT"
      ],
      "redacted": false,
      "resourceName": "myReplicaSet",
      "resourceType": "replicaset",
      "rootResourceName": "myReplicaSet",
      "rootResourceType": "replicaset",
      "sizeRequestedPerFileBytes": 1000,
      "status": "IN_PROGRESS",
      "uncompressedSizeTotalBytes": 44518,
      "userId": "5c80f75fcf09a246878f67a4"
    }
  ],
  "totalCount": 2
}