Get All Project Events¶
On this page
The Atlas Administration API authenticates using HTTP Digest Authentication. Provide a programmatic API public key and corresponding private key as the username and password when constructing the HTTP request. To learn how to configure API access for an Atlas project, see Get Started with the Atlas Administration API.
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
Syntax¶
GET /groups/{GROUP-ID}/events
Request Path Parameters¶
Request Query Parameters¶
Name | Type | Necessity | Description | Default |
---|---|---|---|---|
pageNum | integer | Optional | Page number, starting with one, that Atlas returns of the
total number of objects. | 1 |
itemsPerPage | integer | Optional | Number of items that Atlas returns per page, up to a maximum
of 500. | 100 |
includeCount | boolean | Optional | Flag that indicates whether Atlas returns the totalCount
parameter in the response body. | true |
pretty | boolean | Optional | Flag that indicates whether Atlas returns the JSON
response in the
prettyprint format. | false |
envelope | boolean | Optional | 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 Endpoints that return a list of results use the results object as an envelope. Atlas adds the status parameter to the response body. | false |
clusterNames | string | Optional | Cluster on which the events occurred. To return
events from multiple clusters, specify multiple
| |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
eventType | string | Optional | Event type to be returned. Atlas accepts:
| |||||||||||||||||||||
minDate | date | Optional | Earliest Timestamp in ISO 8601 date and time format in UTC from when Atlas should return
events. | |||||||||||||||||||||
maxDate | date | Optional | Latest Timestamp in ISO 8601 date and time format in UTC from when Atlas should return events. | |||||||||||||||||||||
includeRaw | boolean | Optional | Flag that specifies whether to include the Important The values in the | false |
Request Body Parameters¶
This endpoint does not 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 of objects | One object for each item detailed in the
results Embedded Document section. |
links | array of objects | One or more links to sub-resources and/or related resources. The relations between URLs are explained in the Web Linking Specification |
totalCount | 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¶
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
alertId | string | Unique identifier for the alert associated to the event. | ||||||||||||||||||||
alertConfigId | string | Unique identifier for the alert configuration associated to the
alertId . | ||||||||||||||||||||
apiKeyId | string | Unique identifier for the API Key that triggered the event. If this field is
present in the response, Atlas does not return the
userId field. | ||||||||||||||||||||
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 | date | ISO 8601-formatted
UTC date when the event occurred. | ||||||||||||||||||||
currentValue | document | Describes the value of the metricName at the time of the
event. | ||||||||||||||||||||
currentValue.number | int | The value of the metricName at the time of the event. | ||||||||||||||||||||
currentValue.units | string | The unit of measurement of the Possible 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 | The type of event. Possible values are:
| ||||||||||||||||||||
groupId | string | The unique identifier for the project in which the event
occurred. | ||||||||||||||||||||
hostname | string | The hostname of the Atlas host machine associated to the
event. | ||||||||||||||||||||
id | string | The unique identifier for the event. | ||||||||||||||||||||
invoiceId | string | The unique identifier of the invoice associated to the event. | ||||||||||||||||||||
isGlobalAdmin | boolean | Indicates whether the user who triggered the event is a
MongoDB employee. | ||||||||||||||||||||
links | array | One or more uniform resource locators that link to sub-resources and/or related resources. The Web Linking Specification explains the relation-types between URLs. | ||||||||||||||||||||
metricName | string | The name of the metric associated to the alertId . | ||||||||||||||||||||
opType | string | Type of operation that occurred. This field is present when the
eventTypeName is either DATA_EXPLORER or
DATA_EXPLORER_CRUD . | ||||||||||||||||||||
orgId | string | The unique identifier for the organization in which the
event occurred. | ||||||||||||||||||||
paymentId | string | The unique identifier of the invoice payment associated to the
event. | ||||||||||||||||||||
port | int | |||||||||||||||||||||
publicKey | string | Public key associated with the API Key that triggered the event. If this field
is present in the response, Atlas does not return the
username field. | ||||||||||||||||||||
raw | document | Additional meta information about the event. This field only
appears when the Important The values in the | ||||||||||||||||||||
remoteAddress | string | IP address of the userId Atlas user who triggered the
event. | ||||||||||||||||||||
replicaSetName | string | The name of the replica set associated to the event. | ||||||||||||||||||||
shardName | string | The name of the shard associated to the event. | ||||||||||||||||||||
targetPublicKey | string | The public key of the API Key targeted by the event. | ||||||||||||||||||||
targetUsername | string | The username for the Atlas user targeted by the
event. | ||||||||||||||||||||
teamId | string | The unique identifier for the Atlas team associated to the
event. | ||||||||||||||||||||
userId | string | The unique identifier for the Atlas user who triggered the
event. If this field is present in the response,
Atlas does not return the apiKeyId field. | ||||||||||||||||||||
username | string | The username for the Atlas user who triggered the event.
If this field is present in the response,
Atlas does not return the publicKey field. | ||||||||||||||||||||
whitelistEntry | string | The white list entry of the API Key targeted by the event. |
Example Request¶
curl --user "{PUBLIC-KEY}:{PRIVATE-KEY}" --digest --include \ --header "Content-Type: application/json" \ "https://cloud.mongodb.com/api/atlas/v1.0/groups/5b478b3afc4625789ce616a3/events"
Example Response¶
{ "links": [ { "href": "https://cloud.mongodb.com/api/atlas/v1.0/groups/5b478b3afc4625789ce616a3/events?pageNum=1&itemsPerPage=100", "rel": "self" }, { "href": "https://cloud.mongodb.com/api/atlas/v1.0/groups/5b478b3afc4625789ce616a3/events?itemsPerPage=100&pageNum=2", "rel": "next" } ], "results": [ { "created": "2018-06-04T19:19:00Z", "eventTypeName": "HOST_NOW_PRIMARY", "groupId": "5b478b3afc4625789ce616a3", "hostname": "example-shard-0-abc0p.mongodb.net", "id": "5b478c2562c892f9824cd990", "links": [ { "href": "https://cloud.mongodb.com/api/atlas/v1.0/groups/5b478b3afc4625789ce616a3/events/5b478c2562c892f9824cd990", "rel": "self" } ], "port": 27017, "replicaSetName": "example-shard-0" }, { "created": "2018-06-04T19:16:19Z", "eventTypeName": "HOST_RESTARTED", "groupId": "5b478b3afc4625789ce616a3", "hostname": "example-shard-0-abc0p.mongodb.net", "id": "6b610e4f80eef5366613e4df", "links": [ { "href": "https://cloud.mongodb.com/api/atlas/v1.0/groups/5b478b3afc4625789ce616a3/events/6b610e4f80eef5366613e4df", "rel": "self" } ], "port": 27017, "replicaSetName": "example-shard-0" } ], "totalCount": 2 }