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.
Base URL: https://{OPSMANAGER-HOST}:{PORT}/api/public/v1.0
Resource
PATCH /groups/{PROJECT-ID}/alertConfigs/{ALERT-CONFIG-ID}
Note
This endpoint updates the only the enabled/disabled state for the alert configuration. To update more than just this configuration, see Update an Alert Configuration.
Request Path Parameters
All request path parameters are required.
Parameter | Type | Description |
|---|---|---|
PROJECT-ID | string | Unique identifier for this Project. |
ALERT-CONFIG-ID | string | Unique identifier for this alert configuration. |
Request Query Parameters
The following query parameters are optional:
Name | Type | Necessity | Description | Default | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
pretty | boolean | Optional | Flag indicating whether the response body should be in a prettyprint format. |
| ||||||
envelope | boolean | Optional | Flag that 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:
|
|
Request Body Parameters
All request body parameters are required.
Parameter | Type | Description |
|---|---|---|
enabled | boolean | Specify |
Response
Note
Alert configurations vary. An alert configuration may only include a subset of these elements.
Name | Type | Description |
|---|---|---|
created | string | Timestamp in ISO 8601 date and time format in UTC when this alert configuration was created. |
enabled | boolean | Flag indicating this alert configuration enabled. |
eventTypeName | string | Type of event that triggers an alert. |
groupId | string | Unique identifier of the Project that owns this alert configuration. |
id | string | Unique identifier of the alert configuration. |
links | array of objects | One or more links to sub-resources and/or related resources. The relation-types between URLs are explained in the Web Linking Specification. |
matchers | array of objects | Rules to apply when matching an object against this alert configuration. |
matchers | string | Name of the field in the target object that you wanted this configuration to match. |
matchers | string | Comparison operator to apply when checking the current metric value against |
matchers | string | Value to match or exceed using |
metricThreshold | object | Value and means of comparison that triggers an alert. |
metricThreshold | string | Name of the metric to check. Supports the same values as the |
metricThreshold | string | Average value of this metric. |
metricThreshold | string | Comparison operator that Ops Manager applied when checking the current metric value against the threshold value. |
metricThreshold | number | Value of |
metricThreshold | string | Units of capacity or time that define the scope of the |
notifications | array of objects | One or more targets for Ops Manager to send notifications when an alert condition is detected. |
notifications.[n] | string | Slack API token token. Ops Manager returns this value if you set After you create a third-party integration that requires an API or integration key, the key appears partially redacted when you:
|
notifications.[n] | string | Slack channel name. Ops Manager returns this value if you set |
notifications.[n] | string | DataDog API Key. Ops Manager returns this value if you set After you create a third-party integration that requires an API or integration key, the key appears partially redacted when you:
|
notifications.[n] | number | Number of minutes to wait after an alert condition is detected before sending out the first notification. |
notifications.[n] | string | Email address to which to send notification. Ops Manager returns this value if you set |
notifications.[n] | boolean | Flag indicating email notifications must be sent. Ops Manager returns this value if you set |
notifications.[n] | number | Number of minutes to wait between successive notifications for unacknowledged alerts that are not resolved. |
notifications.[n] | string | Microsoft Teams channel incoming webhook URL. Ops Manager returns this value if you set When you view or edit the alert for a webhook notification, the URL appears partially redacted, and the secret appears completely redacted. |
notifications.[n] | string | Mobile number to which alert notifications are sent. Ops Manager returns this value if you set |
notifications.[n] | string | HipChat API token. Ops Manager returns this value if you set If the token later becomes invalid, MongoDB Atlas sends an email to the After you create a third-party integration that requires an API or integration key, the key appears partially redacted when you:
|
notifications.[n] | string | OpsGenie Alert API key. Ops Manager returns this value if you set After you create a third-party integration that requires an API or integration key, the key appears partially redacted when you:
|
notifications.[n] | string | Region that indicates which API URL to use. Ops Manager returns this value if you set |
notifications.[n] | array of strings | Ops Manager role in current Project or Organization. Ops Manager returns this value if you set |
notifications.[n] | string | HipChat room name. Ops Manager returns this value if |
notifications.[n] | string | PagerDuty service key. Ops Manager returns this value if you set After you create a third-party integration that requires an API or integration key, the key appears partially redacted when you:
|
notifications.[n] | boolean | Flag indicating text notifications must be sent. Ops Manager returns this value if you set |
notifications.[n] | string | Unique identifier of the team that receives this notification. |
notifications.[n] | string | Label for the team that receives this notification. |
notifications.[n] | string | Means by which you want Ops Manager to send you notification of an alert. |
notifications.[n] | string | Name of an Ops Manager user to which to send notifications. Ops Manager returns this value if you set |
notifications.[n] | string | VictorOps API key. If the key later becomes invalid, MongoDB Atlas sends an email to the Ops Manager returns this value if you set After you create a third-party integration that requires an API or integration key, the key appears partially redacted when you:
|
notifications.[n] | string | VictorOps routing key. If the key later becomes invalid, MongoDB Atlas sends an email to the Ops Manager returns this value if you set |
notifications.[n] | string | A value used to authenticate with the Webhook that accepts and forwards the notification. Ops Manager returns this value if you set
After creating a webhook notification, the URL is partially redacted when you view or edit the alert, and the secret is completely redacted. |
notifications.[n] | string | URL for the webhook that triggers this notification. Ops Manager returns this value if you set
After creating a webhook notification, the URL is partially redacted when you view or edit the alert, and the secret is completely redacted. |
notifications.[n] | string | Template for custom headers to include in webhook notifications. Ops Manager returns this value if you set |
notifications.[n] | string | Template for the body content of webhook notifications. Ops Manager returns this value if you set |
notifications.[n] | string | Unique identifier of the notification configuration. |
threshold | object | Threshold that triggers an alert. Ops Manager returns this value if |
threshold | string | Comparison operator that Ops Manager applied when checking the current metric value against the threshold value. |
threshold | number | Value that, when exceeded, Ops Manager triggers an alert. |
threshold | string | Units of capacity or time that define the scope of the |
typeName | string | This field is deprecated and is ignored. |
updated | string | Timestamp in ISO 8601 date and time format in UTC when this alert configuration was last updated. |
Example Request
curl --user '{PUBLIC-KEY}:{PRIVATE-KEY}' --digest \ --header 'Content-Type: application/json' \ --include \ --request PATCH "https://<ops-manager-host>/api/public/v1.0/groups/{PROJECT-ID}/alertConfigs/{ALERT-CONFIG-ID}" \ --data ' { "enabled" : false }'
Example Response
Response Header
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
200 OK Vary: Accept-Encoding Content-Type: application/json Strict-Transport-Security: max-age=300 Date: {dateInUnixFormat} Connection: keep-alive Content-Length: {requestLengthInBytes} X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion}
Response Body
{ "created" : "2014-04-23T14:52:29Z", "enabled" : false, "groupId" : "{PROJECT-ID}", "id" : "{ALERT-CONFIG-ID}", "links" : [], "matchers" : [ { "fieldName" : "REPLICA_SET_NAME", "operator" : "EQUALS", "value" : "rs1" } ], "notifications" : [ { "delayMin" : 5, "emailAddress" : "sos@example.com", "intervalMin" : 60, "typeName" : "EMAIL" }, { "delayMin" : 60, "emailEnabled" : false, "intervalMin" : 120, "smsEnabled" : true, "typeName" : "GROUP" } ], "updated" : "2014-04-23T14:52:29Z" }