Get All Organization Events
On this page
- OAuth 2.0 authentication for programmatic access to Cloud Manager is available as a Preview feature.
- The feature and the corresponding documentation might change at any time during the Preview period. To use OAuth 2.0 authentication, create a service account to use in your requests to the Cloud Manager Public API.
Required Roles
Your API Key must have the Organization Member
role to
successfully call this resource.
Request
Base URL: https://cloud.mongodb.com/api/public/v1.0
GET /orgs/{orgId}/events
Request Path Parameters
This endpoint doesn't use HTTP request path parameters.
Request Query Parameters
Unique Query Parameters
This endpoint accepts the following query parameters to filter returned events:
Name | Type | Description | Default |
---|---|---|---|
eventType | string | Return only events of the specified types. To review the types of events that generate alerts, see Alert Types. | |
includeRaw | boolean | Specifies whether to include the IMPORTANT: The values in the | false |
minDate | string | Return only events for which the created date is greater than
or equal to the specified Timestamp in ISO 8601 date and time format in UTC. | |
maxDate | string | Return only events for which the created date is less than or
equal to the specified Timestamp in ISO 8601 date and time format in UTC. |
Common Query Parameters
This endpoint also accepts the query parameters common to all endpoints that return lists of values:
Name | Type | Description | Default | ||||||
---|---|---|---|---|---|---|---|---|---|
pageNum | integer | Page number (1-index based). | 1 | ||||||
itemsPerPage | integer | Number of items to return per page, up to a maximum of 500. | 100 | ||||||
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 For endpoints that return one result, response body includes:
For endpoints that return a list of results, the | None |
Request Body Parameters
This endpoint doesn't use HTTP request body parameters.
Response
Response Document
The response JSON document includes an array of result objects, an array of link objects and a count of the total number of result objects retrieved.
Name | Type | Description |
---|---|---|
results | array | Array includes one object for each item detailed in the
results Embedded Document section. |
links | array | Array includes one or more links to sub-resources
and/or related resources. The relations between URLs are
explained in the Web Linking Specification. |
totalCount | number | Integer count of the total number of items in the result set. It
may be greater than the number of objects in the
results array if the entire result set is paginated. |
results
Embedded Document
Each result is one event.
Name | Type | Description |
---|---|---|
alertId | string | Unique identifier for the alert associated with this event. |
alertConfigId | string | Unique identifier for the alert configuration associated with
the alertId . |
apiKeyId | string | Unique identifier for the API Key that triggered this event. If this field is present in the response, Cloud Manager does not return
the |
clusterId | string | ID of the cluster to which this event applies. |
clusterName | string | Name of the cluster to which this event applies. |
collection | string | Name of the collection on which the event occurred. This field
can be present when the eventTypeName is either
DATA_EXPLORER or DATA_EXPLORER_CRUD . |
created | string | Timestamp in ISO 8601 date and time format in UTC when this event was triggered. |
currentValue | object | Current value of the metric that triggered this event. |
currentValue .number | number | Value of the metric. |
currentValue .units | string | Relevant units for the value. For example, 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:
|
database | string | Name of the database on which the event occurred. This field
can be present when the eventTypeName is either
DATA_EXPLORER or DATA_EXPLORER_CRUD . |
eventTypeName | string | Name of the circumstance that triggered this event. To review the types of events that generate alerts, see Alert Types. |
groupId | string | ID of the project in which this event occurred. |
hostId | string | ID of the host on which this event occurred. |
hostname | string | Hostname, FQDN, IPv4 address, or IPv6 address of the host
on which this event occurred. |
id | string | Unique identifier for this event. |
invoiceId | string | Unique identifier of the invoice associated with this event. |
isGlobalAdmin | boolean | Flag indicating whether the user who triggered this event is a
MongoDB employee. |
links | object array | One or more links to sub-resources and/or related resources. All
|
metricName | string | Name of the measurement whose value went outside the threshold. For possible values, see below. |
opType | string | Type of operation that generated the event. This field is
present when the eventTypeName is either DATA_EXPLORER
or DATA_EXPLORER_CRUD . |
paymentId | string | Unique identifier of the invoice payment associated with this
event. |
port | integer | Port of the host associated with this event. |
publicKey | string | Public key associated with the API Key that triggered this event. If this field is present in the response, Cloud Manager does not return
the |
raw | document | Additional meta information about the event. This field only
appears when the IMPORTANT: The values in the |
remoteAddress | string | IP address associated with the Cloud Manager user (userId) who
triggered the event. |
replicaSetName | string | Name of the replica set. |
shardName | string | The name of the shard associated with the event. |
targetPublicKey | string | Public key of the API Key targeted by the event. |
targetUsername | string | Username for the Cloud Manager user targeted by this event. |
teamId | string | Unique identifier for the Cloud Manager team associated with this event. |
userId | string | Unique identifier for the Cloud Manager user who triggered this event. If this field is present in the response, Cloud Manager does not
return the |
username | string | Username for the Cloud Manager user who triggered this event. If this field is present in the response, Cloud Manager does not return
|
accessListEntry | string | Access list entry of the API Key targeted by the event. |
Example Request
curl --user "{publicKey}:{privateKey}" --digest \ --header "Accept: application/json" \ --include \ --request GET "https://cloud.mongodb.com/api/public/v1.0/orgs/{orgId}/events?pretty=true"
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
1 { 2 "alertConfigId": "{alertConfigId}", 3 "alertId": "{alertId}", 4 "clusterId": "{clusterId}", 5 "clusterName": "Test Cluster", 6 "created": "2018-06-11T12:34:56Z", 7 "currentValue": { 8 "number": 50, 9 "units": "RAW" 10 }, 11 "eventTypeName": "OUTSIDE_METRIC_THRESHOLD", 12 "groupId": "{groupId}", 13 "hostId": "{hostId}", 14 "hostname": "db.example.com", 15 "id": "{globalAlertId}", 16 "invoiceId": "{invoiceId}", 17 "isGlobalAdmin": false, 18 "maintenanceWindowId": "{maintenanceWindowId}", 19 "metricName": "OPCOUNTER_CMD", 20 "orgId": "{orgId}", 21 "paymentId": "{paymentId}", 22 "port": 27017, 23 "remoteAddress": "192.168.1.1", 24 "replicaSetName": "rs1", 25 "shardName": "sh1", 26 "userId": "{userId}", 27 "username": "john.doe@example.com", 28 "targetUsername": "jane.doe@example.com", 29 "teamId": "{teamId}" 30 }