- API >
- API Resources >
- Alerts
Acknowledge an Alert¶
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. The resource and corresponding endpoints use the
term groups
.
https://cloud.mongodb.com/api/atlas/v1.0
The Atlas API authenticates using HTTP Digest Authentication. Provide a programmatic API public key and corresponding private key as the username and password when constructing the HTTP request.
To learn how to configure API access for an Atlas project, see Configure Atlas API Access.
Syntax¶
PATCH /api/atlas/v1.0/groups/{GROUP-ID}/alerts/{ALERT-ID}
Request Path Parameters¶
Parameter | Required/Optional | Description |
---|---|---|
GROUP-ID | Required | Project identifier. |
ALERT-ID | Required | Alert identifier. |
Request Query Parameters¶
The following query parameters are optional:
Name | Type | Necessity | Description | Default |
---|---|---|---|---|
pageNum | integer | Optional | Page number, starting with one, that Atlas returns of the total number of objects. | 1 |
itemsPerPage | integer | Optional | Number of items that Atlas returns per page, up to a maximum of 500. | 100 |
includeCount | boolean | Optional | Flag that indicates whether Atlas returns the totalCount parameter in the response body. | true |
pretty | boolean | Optional | Flag that indicates whether Atlas returns the JSON response in the prettyprint format. | false |
envelope | boolean | Optional | Flag that indicates whether Atlas wraps the response in an envelope. Some API clients cannot access the HTTP response headers or
status code. To remediate this, set Endpoints that return a list of results use the results object as an envelope. Atlas adds the status parameter to the response body. | false |
Request Body Parameters¶
Field | Required/Optional | Description |
---|---|---|
acknowledgedUntil | Required. To acknowledge an alert "forever", set the field value to 100 years in the future. To unacknowledge a previously acknowledged alert, set the field value to the past. | The page to return. |
acknowledgementComment | Optional. | If you add a comment, Atlas displays the comment next to the message that the alert has been acknowledged. |
Response Elements¶
The fields in the return document depend on the alert type:
Name | Type | Description | |||
---|---|---|---|---|---|
acknowledgedUntil | string | Timestamp in ISO 8601 date and time format in UTC through which the alert has been acknowledged. Returned if the alert has been acknowledged. | |||
acknowledgementComment | string | Comment left by the user who acknowledged the alert. Returned if the alert has been acknowledged. | |||
acknowledgingUsername | string | Username of the user who acknowledged the alert. Returned if the alert has been acknowledged. | |||
alertConfigId | string | Unique identifier of the alert configuration that triggered this alert. | |||
clusterName | string | Name the cluster to which this alert applies. | |||
created | string | Timestamp in ISO 8601 date and time format in UTC when the alert was opened. | |||
currentValue | object | Current value of the metric that triggered the alert. | |||
currentValue.number | number | Value. | |||
currentValue.units | string | Units for the value. Possible units are:
| |||
eventTypeName | string | Name of the event that triggered the alert. | |||
id | string | Unique identifier for the alert. | |||
groupId | string | Unique identifier of the project that this alert was opened for. | |||
hostnameAndPort | string | Hostname and port of the host to which the alert applies. | |||
lastNotified | string | Timestamp in ISO 8601 date and time format in UTC when the last notification was sent for this alert. Returned if notifications have been sent. | |||
metricName | string | Name of the metric whose value went outside the threshold. Possible values are:
| |||
replicaSetName | string | Name of the replica set, if applicable. | |||
resolved | string | Timestamp in ISO 8601 date and time format in UTC when the alert was closed. Returned if
"status" : "CLOSED" . | |||
status | string | Current state of the alert. Possible values are:
| |||
updated | string | Timestamp in ISO 8601 date and time format in UTC when the alert was last updated. |
Example Request¶
curl -u "{PUBLIC-KEY}:{PRIVATE-KEY}" -H "Content-Type: application/json" --digest -X PATCH "https://cloud.mongodb.com/api/atlas/v1.0/groups/535683b3794d371327b/alerts/524dc45ee4b835ff81ec2a" --data ' { "acknowledgedUntil" : "2016-10-01T00:00:00-0400", "acknowledgementComment" : "This is normal. Please ignore." }'
Example Response¶
{ "id" : "524dc45ee4b835ff81ec2a", "groupId" : "535683b3794d371327b", "eventTypeName" : "OUTSIDE_METRIC_THRESHOLD", "status" : "OPEN", "acknowledgedUntil" : "2016-10-01T04:00:00Z", "acknowledgementComment" : "This is normal. Please ignore.", "acknowledgingUsername" : "someuser@example.com", "created" : "2016-08-23T20:28:14Z", "updated" : "2016-08-23T20:33:14Z", "lastNotified" : "2016-08-23T20:33:23Z", "metricName" : "ASSERTS_REGULAR", "currentValue" : { "number" : 0.0, "units" : "RAW" }, "links" : [ ... ] }