Navigation

Get All Alert Configurations for a Group

Info With Circle IconCreated with Sketch.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. The resource and corresponding endpoints use the term groups.

https://cloud.mongodb.com/api/atlas/v1.0

GET /api/atlas/v1.0/groups/{GROUP-ID}/alertConfigs
ParameterRequired/OptionalDescription
{GROUP-ID}RequiredProject identifier.

The following query parameters are optional:

NameTypeNecessityDescriptionDefault
pageNumintegerOptionalPage number, starting with one, that Atlas returns of the total number of objects.1
itemsPerPageintegerOptionalNumber of items that Atlas returns per page, up to a maximum of 500.100
includeCountbooleanOptionalFlag that indicates whether Atlas returns the totalCount parameter in the response body.true
prettybooleanOptionalFlag that indicates whether Atlas returns the JSON response in the prettyprint format.false
envelopebooleanOptional

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

Endpoints that return a list of results use the results object as an envelope. Atlas adds the status parameter to the response body.

false

This endpoint does not use HTTP request body parameters.

The response includes the totalCount of the alert configurations and a results array which lists all alert configurations for the group. Each alert configuration details include:

Info With Circle IconCreated with Sketch.Note

Alert configurations vary. An alert configuration may only include a subset of these elements.

NameTypeDescription
idstringUnique identifier of the alert configuration.
groupIdstringUnique identifier of the project that owns this alert configuration.
eventTypeNamestring

Type of event that triggers an alert.

Accepted values are:

Alert TargetCondition
Backup
CPS_SNAPSHOT_SUCCESSFUL
Snapshot taken successfully
CPS_SNAPSHOT_FALLBACK_SUCCESSFUL
Fallback snapshot taken
CPS_SNAPSHOT_FALLBACK_FAILED
Fallback snapshot failed
CPS_SNAPSHOT_BEHIND
Snapshot schedule fell behind
CPS_RESTORE_FAILED
Backup restore failed
CPS_RESTORE_SUCCESSFUL
Backup restore succeeded
CPS_SNAPSHOT_DOWNLOAD_REQUEST_FAILED
Snapshot download request failed
Billing
CREDIT_CARD_ABOUT_TO_EXPIRE
Credit card is about to expire
PENDING_INVOICE_OVER_THRESHOLD
Monthly pending invoice ($) total is...
DAILY_BILL_OVER_THRESHOLD
Daily amount billed ($) is...
Encryption Key
AWS_ENCRYPTION_KEY_NEEDS_ROTATION
AWS encryption key elapsed time since last rotation is...
AZURE_ENCRYPTION_KEY_NEEDS_ROTATION
Azure encryption key elapsed time since last rotation is...
GCP_ENCRYPTION_KEY_NEEDS_ROTATION
GCP encryption key elapsed time since last rotation is...
Host
HOST_DOWN
Host is down
OUTSIDE_METRIC_THRESHOLD
Metric occurred outside of the metric threshold. See View Cluster Metrics.
Project
USERS_WITHOUT_MULTIFACTOR_AUTH
Users do not have two-factor authentication enabled
Replica Set
PRIMARY_ELECTED
Replica set elected a new primary
NO_PRIMARY
Replica set has no primary
TOO_MANY_ELECTIONS
Number of election events is...
REPLICATION_OPLOG_WINDOW_RUNNING_OUT
Replication Oplog Window is...
Sharded Cluster
CLUSTER_MONGOS_IS_MISSING
Cluster is missing an active mongos
User
USER_ROLES_CHANGED_AUDIT
User had their role changed
JOINED_GROUP
User joined the project
REMOVED_FROM_GROUP
User left the project
USER_ROLES_CHANGED_AUDIT
User had their role changed
X.509
NDS_X509_USER_AUTHENTICATION_MANAGED_USER_CERTS_EXPIRATION_CHECK
X.509 User Authentication, Client Certificates Expiration Alert when days to expiration is...
NDS_X509_USER_AUTHENTICATION_CUSTOMER_CA_EXPIRATION_CHECK
X.509 User Authentication, Self-Managed CA Expiration Alert when days to expiration is...
createdstringTimestamp in ISO 8601 date and time format in UTC when this alert configuration was created.
updatedstringTimestamp in ISO 8601 date and time format in UTC when this alert configuration was last updated.
enabledboolean

If set to true, the alert configuration is enabled.

If enabled is not specified in a POST command, it defaults to false.

matchersobject array

Rules to apply when matching an object against this alert configuration. Only entities that match all these rules are checked for an alert condition.

You can filter using the matchers array only when the eventTypeName specifies an event for a host, replica set, or sharded cluster.

matchers
.fieldName
string

Name of the field in the target object to match on.

  • Host alerts support these fields:

    • TYPE_NAME
    • HOSTNAME
    • PORT
    • HOSTNAME_AND_PORT
    • REPLICA_SET_NAME
  • Replica set alerts support these fields:

    • REPLICA_SET_NAME
    • SHARD_NAME
    • CLUSTER_NAME
  • Sharded cluster alerts support these fields:

    • CLUSTER_NAME
    • SHARD_NAME

All other types of alerts do not support matchers.

matchers
.operator
string

Operator to test the field's value. Accepted values are:

  • EQUALS
  • NOT_EQUALS
  • CONTAINS
  • NOT_CONTAINS
  • STARTS_WITH
  • ENDS_WITH
  • REGEX
matchers
.value
string

Value to test with the specified operator.

If "matchers.fieldName" : "TYPE_NAME", you can match on the following values:

  • PRIMARY
  • SECONDARY
  • STANDALONE
  • CONFIG
  • MONGOS
metricThresholdobjectThreshold that causes an alert to be triggered. Populated if "eventTypeName" : "OUTSIDE_METRIC_THRESHOLD".
metricThreshold
.metricName
string

Name of the metric against which Atlas checks the configured metricThreshold.threshold.

See Host Metrics for the available metrics.

metricThreshold
.operator
string

Operator to apply when checking the current metric value against the threshold value. Accepted values are:

  • GREATER_THAN
  • LESS_THAN
metricThreshold
.threshold
integerThreshold value outside of which an alert will be triggered.
metricThreshold
.units
string

Units for the threshold value. Depends on the type of metric.

Beaker IconExample

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

Accepted values are:

  • RAW
  • BITS
  • BYTES
  • KILOBITS
  • KILOBYTES
  • MEGABITS
  • MEGABYTES
  • GIGABITS
  • GIGABYTES
  • TERABYTES
  • PETABYTES
  • MILLISECONDS
  • SECONDS
  • MINUTES
  • HOURS
  • DAYS
metricThreshold
.mode
stringAVERAGE. Atlas computes the current metric value as an average.
notificationsobject arrayNotifications to send when an alert condition is detected.
notifications
.typeName
string

Type of alert notification. Accepted values are:

  • DATADOG
  • EMAIL
  • FLOWDOCK
  • GROUP (Project)
  • OPS_GENIE
  • ORG
  • PAGER_DUTY
  • SLACK
  • SMS
  • TEAM
  • USER
  • VICTOR_OPS
  • WEBHOOK
notifications
.intervalMin
integerNumber of minutes to wait between successive notifications for unacknowledged alerts that are not resolved.
notifications
.delayMin
integerNumber of minutes to wait after an alert condition is detected before sending out the first notification.
notifications
.emailEnabled
booleanFlag indicating if email notifications should be sent. Returned with ORG, GROUP, and USER notifications types.
notifications
.smsEnabled
booleanFlag indicating if text message notifications should be sent. Returned with ORG, GROUP, and USER notifications types.
notifications
.username
stringName of the Atlas user to which to send notifications. Only a user in the project that owns the alert configuration is allowed here. Returned with the USER notifications type.
notifications
.roles
array of strings

One or more project roles that receive the configured alert. Accepted values include:

  • GROUP_CLUSTER_MANAGER
  • GROUP_DATA_ACCESS_ADMIN
  • GROUP_DATA_ACCESS_READ_ONLY
  • GROUP_DATA_ACCESS_READ_WRITE
  • GROUP_OWNER
  • GROUP_READ_ONLY
notifications
.teamId
stringUnique identifier of a team.
notifications
.emailAddress
stringEmail address to which alert notifications are sent. Returned with the EMAIL notifications type.
notifications
.mobileNumber
stringMobile number to which alert notifications are sent. Returned with the SMS notifications type.
notifications
.channelName
stringSlack channel name. Returned with the SLACK notifications type.
notifications
.apiToken
stringSlack API token or Bot token. Returned with the SLACK notifications type. If the token later becomes invalid, Atlas sends an email to the project owner and eventually removes the token.
notifications
.orgName
stringFlowdock organization name in lower-case letters. This is the name that appears after www.flowdock.com/app/ in the URL string. Returned with the FLOWDOCK notifications type.
notifications
.flowName
string

Flowdock flow name in lower-case letters. The flow name appears after the organization name in the URL string:

www.flowdock.com/app/<organization-name>/<flow-name>.

Returned with the FLOWDOCK notifications type.

notifications
.flowdockApiToken
stringFlowdock personal API token. Returned with the FLOWDOCK notifications type. If the token later becomes invalid, Atlas sends an email to the project owner and eventually removes the token.
notifications
.serviceKey
stringPagerDuty service key. Returned with the PAGER_DUTY notifications type. If the key later becomes invalid, Atlas sends an email to the project owner and eventually removes the key.
notifications
.victorOpsApiKey
stringVictorOps API key. Returned with the VICTOR_OPS notifications type. If the key later becomes invalid, Atlas sends an email to the project owner and eventually removes the key.
notifications
.victorOpsRoutingKey
stringVictorOps routing key. Returned with the VICTOR_OPS notifications type. If the key later becomes invalid, Atlas sends an email to the project owner and eventually removes the key.
notifications
.opsGenieApiKey
stringOpsgenie API Key. Returned with the OPS_GENIE notifications type. If the key later becomes invalid, Atlas sends an email to the project owner and eventually removes the token.
notifications
.opsGenieRegion
string

Region that indicates which API URL to use. Accepted regions are:

  • US
  • EU

The default Opsgenie region is US.

notifications
.datadogApiKey
stringDatadog API Key. Found in the Datadog dashboard. Populated for the DATADOG notifications type.
notifications
.datadogRegion
string

Region that indicates which API URL to use. Accepted regions are:

  • US
  • EU

The default Datadog region is US.

curl -X GET -u "{PUBLIC-KEY}:{PRIVATE-KEY}" --digest "https://cloud.mongodb.com/api/atlas/v1.0/groups/535683b3794d371327b/alertConfigs"
{
"results": [ {
"id" : "533dc40ae4b00835ff81eaee",
"groupId" : "535683b3794d371327b",
"eventTypeName" : "OUTSIDE_METRIC_THRESHOLD",
"created" : "2016-08-23T20:26:50Z",
"updated" : "2016-08-23T20:26:50Z",
"enabled" : true,
"matchers" : [ {
"field" : "HOSTNAME_AND_PORT",
"operator" : "EQUALS",
"value" : "mongo.example.com:27017"
} ],
"notifications" : [ {
"typeName" : "SMS",
"intervalMin" : 5,
"delayMin" : 0,
"mobileNumber" : "2343454567"
} ],
"metricThreshold" : {
"metricName" : "ASSERT_REGULAR",
"operator" : "LESS_THAN",
"threshold" : 99.0,
"units" : "RAW",
"mode" : "AVERAGE"
},
"links" : [ ... ]
}, ... ],
"totalCount": 3,
"links" : [ ... ]
}
Give Feedback