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.
Use this endpoint to create a new log collection job. When you create a log collection job, Ops Manager starts a background job to download the logs from the specified Ops Manager deployment.
Base URL: https://{OPSMANAGER-HOST}:{PORT}/api/public/v1.0
Resource
POST /groups/{GROUP-ID}/logCollectionJobsRequest 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
The following query parameters are optional:
Name | Type | Necessity | Description | Default |
|---|---|---|---|---|
pretty | boolean | Optional | Flag indicating whether the response body is in a prettyprint format. |
|
envelope | boolean | Optional | Flag that indicates whether 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 one result, the response body includes:
|
|
Request Body Parameters
Name | Type | Necessity | Description |
|---|---|---|---|
resourceType | string | Required | Type of resource from which to collect logs. Must be one of the following values:
|
resourceName | string | Required | Name of the resource from which to collect logs. The resource type defines the value:
|
sizeRequestedPerFileBytes | number | Required | Size for each log file in bytes. |
logTypes | array | Required | Array of strings specifying the types of logs to collect. Each array element must be one of the following values:
|
redacted | boolean | Required | If set to |
logCollectionFromDate | integer | Optional | Date and time from which to start this log, in milliseconds since the Unix epoch. If you specify the |
logCollectionToDate | integer | Optional | Date and time at which to end this log, in milliseconds since the Unix epoch. If you specify the |
Response
Name | Type | Description |
|---|---|---|
id | string | Unique identifier of the created log collection job. |
Example Request
curl --user "{PUBLIC-KEY}:{PRIVATE-KEY}" --digest \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --include \ --request POST "https://<OpsManagerHost>:<Port>/api/public/v1.0/groups/{GROUP-ID}/logCollectionJobs?pretty=true" \ --data ' { "resourceType": "PROCESS", "resourceName": "my_deployment_1", "redacted": true, "sizeRequestedPerFileBytes": 10000000, "logTypes": [ "FTDC", "MONGODB", "AUTOMATION_AGENT" ] }'Example Response
Response Header
HTTP/1.1 401 UnauthorizedContent-Type: application/json;charset=ISO-8859-1Date: {dateInUnixFormat}WWW-Authenticate: Digest realm="MMS Public API", domain="", nonce="{nonce}", algorithm=MD5, op="auth", stale=falseContent-Length: {requestLengthInBytes}Connection: keep-aliveHTTP/1.1 201 CreatedVary: Accept-EncodingContent-Type: application/jsonStrict-Transport-Security: max-age=300Date: {dateInUnixFormat}Connection: keep-aliveContent-Length: {requestLengthInBytes}X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion}Response Body
{ "id": "5c81086e014b76a3d85e1113" }