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.
Resource
Base URL: https://{OPSMANAGER-HOST}:{PORT}/api/public/v1.0
PATCH /groups/{PROJECT-ID}/alerts/{ALERT-ID}Request Path Parameters
Parameter | Type | Necessity | Description |
|---|---|---|---|
| string | Required | Unique identifier for the Project in which this alert is set. |
| string | Required | Unique identifier for the Alert. |
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
Field | Type | Necessity | Description |
|---|---|---|---|
| string | Conditional | Timestamp in ISO 8601 date and time format in UTC until which the alert should be acknowledged.
|
| string | Optional | Text description of the reason for this acknowledgement. Ops Manager 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 |
|---|---|---|
| string | Timestamp in ISO 8601 date and time format in UTC until which the alert has been acknowledged. Ops Manager returns this value if the alert has been acknowledged. |
| string | Comment left by the user who acknowledged the alert. Ops Manager returns this value if the alert has been acknowledged. |
| string | Username of the user who acknowledged the alert. Ops Manager returns this value if the alert has been acknowledged. |
| string | Unique identifier for the alert configuration that triggered this alert. |
| string | Unique identifier for the cluster to which this alert applies. Ops Manager returns this value if |
| string | Name of the cluster to which this alert applies. Ops Manager returns this value if |
| string | Timestamp in ISO 8601 date and time format in UTC when the alert was opened. |
| object | Current value of the metric that triggered the alert. Ops Manager returns this value if |
| number | Value of the metric. |
| string | Units for the value. Value depends on the type of metric. For example, a metric that measures memory consumption would have a byte measurement, while a metric that measures time would have a time unit. Ops Manager can return:
|
| string | Name of the event that triggered the alert. Accepted values are: Agent Automation Configuration Backup BI Connector Cluster Data Explorer Accessed Host Organization Project Replica Set Team User For a complete list of events included in the Ops Manager audit log, see Audit Events. |
| string | Unique identifier of the group for which this alert was opened. |
| string | unique identifier for the host to which the metric pertains. Ops Manager returns this value if
|
| 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. Ops Manager returns this value if
|
| string | Unique identifier for the alert. |
| string | Timestamp in ISO 8601 date and time format in UTC when the last notification was sent for this alert. Ops Manager returns this value if notifications have been sent. |
| array of objects | One or more links to sub-resources or related resources. All |
| string | Name of the measurement whose value went outside the threshold. Ops Manager returns this value if For possible values, see Measurement Types for Alerts. |
| string | Name of the replica set. Ops Manager returns this value if
|
| string | Timestamp in ISO 8601 date and time format in UTC when the alert was closed. Ops Manager returns this value if |
| string | Current state of the alert. Ops Manager can return one of the following:
|
| string | Type of host being backed up when
|
| string array | Identifying labels set for this alert. |
| string | Timestamp in ISO 8601 date and time format in UTC 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://<ops-manager-host>/api/public/v1.0/groups/{PROJECT-ID}/alerts/{ALERT-CONFIG-ID}" --data ' { "acknowledgedUntil": "2016-04-15T00:00:00-0400", "acknowledgementComment": "This is normal. Please ignore." }'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 200 OKVary: 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" : "{ALERT-CONFIG-ID}", "groupId" : "{PROJECT-ID}", "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" : []}