Navigation

Acknowledge One Alert

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.

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

Resource

PATCH /groups/{GROUP-ID}/alerts/{ALERT-ID}

Request Path Parameters

Parameter Type Description
GROUP-ID string (Required.) Group identifier.
ALERT-ID string (Required.) Alert identifier.

Request Query Parameters

The following query parameters are optional:

Name Type Description Default
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 one result, the response body includes:

status
HTTP response code
envelope
The expected response body
false

Request Body Parameters

Field Type 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 string (Optional.) If you add a comment, MongoDB Atlas displays the comment next to the message that the alert has been acknowledged.

Response

The fields in the return document depend on the alert type:

Name Type Description
acknowledgedUntil string Timestamp in the number of seconds that have elapsed since the UNIX epoch’, when the alert has been acknowledged. Only displayed if the alert has never been acknowledged.
acknowledgementComment string Comment left by the user who acknowledged the alert. Only displayed if the alert has never been acknowledged.
acknowledgingUsername string Username of the user who acknowledged the alert. Only displayed if the alert has never been acknowledged.
alertConfigId string Unique identifier for the alert configuration that triggered this alert.
clusterId string unique identifier for the cluster to which this alert applies. Only displayed for alerts of type BACKUP, REPLICA_SET, and CLUSTER.
clusterName string Name the cluster to which this alert applies. Only present for alerts of type BACKUP, REPLICA_SET, and CLUSTER.
created string Timestamp in the number of seconds that have elapsed since the UNIX epoch’, when the alert was opened.
currentValue object Current value of the metric that triggered the alert. Only present for alerts of type HOST_METRIC.
currentValue.number number Value of the metric.
currentValue.units string

Units for the value. Value depends on the type of metric.

Example

A metric that measures memory consumption would have a byte measurement, while a metric that measures time would have a time unit.

Possible values are:

  • RAW
  • BITS
  • BYTES
  • KILOBITS
  • KILOBYTES
  • MEGABITS
  • MEGABYTES
  • GIGABITS
  • GIGABYTES
  • TERABYTES
  • PETABYTES
  • MILLISECONDS
  • SECONDS
  • MINUTES
  • HOURS
  • DAYS
eventTypeName string

Name of the event that triggered the alert.

To review the types of events that generate alerts, see Alert Types.

groupId string Unique identifier of the group for which this alert was opened.
hostId string unique identifier for the host to which the metric pertains. Only displayed for alerts of type HOST, HOST_METRIC, and REPLICA_SET.
hostnameAndPort string Hostname and port of each host to which the alert applies. This can be a hostname, an FQDN, an IPv4 address, or an IPv6 address. Only displayed for alerts of type HOST, HOST_METRIC, and REPLICA_SET.
id string Unique identifier for this alert.
lastNotified string Timestamp in the number of seconds that have elapsed since the UNIX epoch’, when the last notification was sent for this alert. Only displayed if notifications have been sent.
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.
metricName string

Name of the measurement whose value went outside the threshold. Only displayed if eventTypeName is set to OUTSIDE_METRIC_THRESHOLD.

For possible values, see Measurement Types for Alerts.

replicaSetName string Name of the replica set. Only displayed for alerts of type HOST, HOST_METRIC, BACKUP, and REPLICA_SET.
resolved string Timestamp in the number of seconds that have elapsed since the UNIX epoch’, when the alert was closed. Only displayed if the status is CLOSED.
status string

Current state of the alert. Possible values are:

  • TRACKING

    The alert condition exists but has not persisted beyond the defined notification delay. For details, see Request Query Parameters.

  • OPEN

  • CLOSED

  • CANCELLED

sourceTypeName string

Type of server being backed up when alerts are "type" : "BACKUP". Possible values are:

  • REPLICA_SET
  • SHARDED_CLUSTER
  • CONFIG_SERVER
tags string array Identifying labels set for this alert.
typeName string This field is deprecated and will be ignored.
updated string Timestamp in the number of seconds that have elapsed since the UNIX epoch’, when the alert was last updated.

Example Request

curl --user "{PUBLIC-KEY}:{PRIVATE-KEY}" --digest \
 --header "Accept: application/json" \
 --header "Content-Type: application/json" \
 --include \
 --request PATCH "https://cloud.mongodb.com/api/public/v1.0/groups/5196d3628d022db4cbc26d9e/alerts/533dc45ee4b00835ff81ec2a"
 --data '
   {
     "acknowledgedUntil": "2016-04-15T00:00:00-0400",
     "acknowledgementComment": "This is normal. Please ignore."
   }'

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

{
  "id" : "533dc45ee4b00835ff81ec2a",
  "groupId" : "5196d3628d022db4cbc26d9e",
  "eventTypeName" : "OUTSIDE_METRIC_THRESHOLD",
  "status" : "OPEN",
  "acknowledgedUntil" : "2014-04-15T04:00:00Z",
  "acknowledgementComment" : "This is normal. Please ignore.",
  "acknowledgingUsername" : "someuser@example.com",
  "created" : "2014-04-03T20:28:14Z",
  "updated" : "2014-04-03T20:33:14Z",
  "lastNotified" : "2014-04-03T20:33:23Z",
  "metricName": "ASSERTS_REGULAR",
  "currentValue" : {
    "number" : 0.0,
    "units" : "RAW"
  },
  "links" : []
}