Working with MMS Alerts
Name | Type | Description | Example |
---|---|---|---|
acknowledgedUntil | date-time | The date through which the alert has been acknowledged. Will not be present if the alert has never been acknowledged. | "2014-03-01T12:00:00Z" |
created | date-time | When the alert was opened. | "2014-03-01T12:00:00Z" |
currentValue:number | number | The value of the metric. | 100.0 |
currentValue:units | string | The units in which the metric values are expressed. one of: "RAW" or "BITS" or "KILOBITS" or "MEGABITS" or "GIGABITS" or "BYTES" or "KILOBYTES" or "MEGABYTES" or "GIGABYTES" or "TERABYTES" or "PETABYTES" or "MILLISECONDS" or "SECONDS" or "MINUTES" or "HOURS" or "DAYS" |
"BYTES" |
eventTypeName | string | The name of the event that triggered the alert. The possible values here depend on the typeName. | "MONITORING_AGENT_DOWN" |
groupId | string | ID of the group that this alert was opened for. | "5196d3628d022db4cbc26d9e" |
id | string | Unique identifier | "5196d3628d022db4cbc26d9e" |
lastNotified | date-time | When the last notification was sent for this alert. Only present if notifications have been sent. | "2014-03-01T12:00:00Z" |
metricName | string | The name of the metric. one of: "ASSERT_MSG" or "ASSERT_REGULAR" or "ASSERT_USER" or "ASSERT_WARNING" or "BACKGROUND_FLUSH_AVG" or "COMPUTED_MEMORY" or "CONNECTIONS" or "CONNECTIONS_MAX" or "CURSORS_TOTAL_CLIENT_CURSORS_SIZE" or "CURSORS_TOTAL_OPEN" or "CURSORS_TOTAL_TIMED_OUT" or "DB_DATA_SIZE_TOTAL" or "DB_LOCK_PERCENTAGE" or "DB_ACCESSES_NOT_IN_MEMORY" or "DB_PAGE_FAULT_EXCEPTIONS_THROWN" or "DB_STORAGE_TOTAL" or "EFFECTIVE_LOCK_PERCENTAGE" or "EXTRA_INFO_PAGE_FAULTS" or "GLOBAL_ACCESSES_NOT_IN_MEMORY" or "GLOBAL_LOCK_CURRENT_QUEUE_READERS" or "GLOBAL_LOCK_CURRENT_QUEUE_TOTAL" or "GLOBAL_LOCK_CURRENT_QUEUE_WRITERS" or "GLOBAL_PAGE_FAULT_EXCEPTIONS_THROWN" or "INDEX_COUNTERS_BTREE_ACCESSES" or "INDEX_COUNTERS_BTREE_HITS" or "INDEX_COUNTERS_BTREE_MISSES" or "INDEX_COUNTERS_BTREE_MISS_RATIO" or "JOURNALING_COMMITS_IN_WRITE_LOCK" or "JOURNALING_MB" or "JOURNALING_WRITE_DATA_FILES_MB" or "MEMORY_MAPPED" or "MEMORY_RESIDENT" or "MEMORY_VIRTUAL" or "MUNIN_CPU_IOWAIT" or "MUNIN_CPU_IRQ" or "MUNIN_CPU_NICE" or "MUNIN_CPU_SOFTIRQ" or "MUNIN_CPU_STEAL" or "MUNIN_CPU_SYSTEM" or "MUNIN_CPU_USER" or "MUNIN_IOSTAT_OP_READ" or "MUNIN_IOSTAT_OP_WRITE" or "MUNIN_IOSTAT_TIME_READ" or "MUNIN_IOSTAT_TIME_WRITE" or "NETWORK_BYTES_IN" or "NETWORK_BYTES_OUT" or "NETWORK_NUM_REQUESTS" or "OPCOUNTER_CMD" or "OPCOUNTER_DELETE" or "OPCOUNTER_GETMORE" or "OPCOUNTER_INSERT" or "OPCOUNTER_QUERY" or "OPCOUNTER_REPL_CMD" or "OPCOUNTER_REPL_DELETE" or "OPCOUNTER_REPL_INSERT" or "OPCOUNTER_REPL_UPDATE" or "OPCOUNTER_UPDATE" or "OPLOG_MASTER_LAG_TIME_DIFF" or "OPLOG_MASTER_TIME" or "OPLOG_RATE_GB_PER_HOUR" or "OPLOG_SLAVE_LAG_MASTER_TIME" |
"ASSERT_MSG" |
resolved | date-time | When the alert was closed. Only present if the status is CLOSED. | "2014-03-01T12:00:00Z" |
status | string | The current state of the alert. Possible values are: OPEN CLOSED one of: "OPEN" or "CLOSED" |
"OPEN" |
typeName | string | The type of alert. one of: "AGENT" or "BACKUP" or "HOST" or "HOST_METRIC" or "REPLICA_SET" |
"AGENT" |
updated | date-time | When the alert was last updated. | "2014-03-01T12:00:00Z" |
Info for existing alert.
GET /groups/{group_id}/alerts/{alert_id}
$ curl -n -X GET https://mms.mongodb.com/api/public/v1.0/groups/$GROUP_ID/alerts/$ALERT_ID
HTTP/1.1 200 OK
{
"id": "5196d3628d022db4cbc26d9e",
"groupId": "5196d3628d022db4cbc26d9e",
"typeName": "AGENT",
"eventTypeName": "MONITORING_AGENT_DOWN",
"status": "OPEN",
"acknowledgedUntil": "2014-03-01T12:00:00Z",
"created": "2014-03-01T12:00:00Z",
"updated": "2014-03-01T12:00:00Z",
"resolved": "2014-03-01T12:00:00Z",
"lastNotified": "2014-03-01T12:00:00Z",
"metricName": "ASSERT_MSG",
"currentValue": {
"number": 100.0,
"units": "BYTES"
}
}
List existing alerts.
GET /groups/{group_id}/alerts
$ curl -n -X GET https://mms.mongodb.com/api/public/v1.0/groups/$GROUP_ID/alerts
HTTP/1.1 200 OK
{
"totalCount": 1,
"results": [
{
"id": "5196d3628d022db4cbc26d9e",
"groupId": "5196d3628d022db4cbc26d9e",
"typeName": "AGENT",
"eventTypeName": "MONITORING_AGENT_DOWN",
"status": "OPEN",
"acknowledgedUntil": "2014-03-01T12:00:00Z",
"created": "2014-03-01T12:00:00Z",
"updated": "2014-03-01T12:00:00Z",
"resolved": "2014-03-01T12:00:00Z",
"lastNotified": "2014-03-01T12:00:00Z",
"metricName": "ASSERT_MSG",
"currentValue": {
"number": 100.0,
"units": "BYTES"
}
}
]
}
List existing alerts for specified alert config.
GET /groups/{group_id}/alertConfigs/{alertConfig_id}/alerts
$ curl -n -X GET https://mms.mongodb.com/api/public/v1.0/groups/$GROUP_ID/alertConfigs/$ALERTCONFIG_ID/alerts
HTTP/1.1 200 OK
{
"totalCount": 1,
"results": [
{
"id": "5196d3628d022db4cbc26d9e",
"groupId": "5196d3628d022db4cbc26d9e",
"typeName": "AGENT",
"eventTypeName": "MONITORING_AGENT_DOWN",
"status": "OPEN",
"acknowledgedUntil": "2014-03-01T12:00:00Z",
"created": "2014-03-01T12:00:00Z",
"updated": "2014-03-01T12:00:00Z",
"resolved": "2014-03-01T12:00:00Z",
"lastNotified": "2014-03-01T12:00:00Z",
"metricName": "ASSERT_MSG",
"currentValue": {
"number": 100.0,
"units": "BYTES"
}
}
]
}
Update an existing alert.
PATCH /groups/{group_id}/alerts/{alert_id}
$ curl -n -X PATCH https://mms.mongodb.com/api/public/v1.0/groups/$GROUP_ID/alerts/$ALERT_ID
-H "Content-Type: application/json" \
-d '{"id":"5196d3628d022db4cbc26d9e","groupId":"5196d3628d022db4cbc26d9e","typeName":"AGENT","eventTypeName":"MONITORING_AGENT_DOWN","status":"OPEN","acknowledgedUntil":"2014-03-01T12:00:00Z","created":"2014-03-01T12:00:00Z","updated":"2014-03-01T12:00:00Z","resolved":"2014-03-01T12:00:00Z","lastNotified":"2014-03-01T12:00:00Z","metricName":"ASSERT_MSG","currentValue":{"number":100.0,"units":"BYTES"}}'
HTTP/1.1 200 OK
{
"id": "5196d3628d022db4cbc26d9e",
"groupId": "5196d3628d022db4cbc26d9e",
"typeName": "AGENT",
"eventTypeName": "MONITORING_AGENT_DOWN",
"status": "OPEN",
"acknowledgedUntil": "2014-03-01T12:00:00Z",
"created": "2014-03-01T12:00:00Z",
"updated": "2014-03-01T12:00:00Z",
"resolved": "2014-03-01T12:00:00Z",
"lastNotified": "2014-03-01T12:00:00Z",
"metricName": "ASSERT_MSG",
"currentValue": {
"number": 100.0,
"units": "BYTES"
}
}
Working with MMS Alert Configurations
Name | Type | Description | Example |
---|---|---|---|
created | date-time | When this alert configuration was created. | "2012-01-01T12:00:00Z" |
enabled | boolean | Is this alert configuration enabled? | true |
eventTypeName | string | The name of the event that triggered the alert. The possible values here depend on the typeName. | "MONITORING_AGENT_DOWN" |
groupId | string | ID of the group that owns this alert configuration. | "5196d3628d022db4cbc26d9e" |
id | string | Unique identifier. | "533dc40ae4b00835ff81eaee" |
matchers | array | [{"fieldName"=>"hostnameAndPort", "operator"=>"EQUALS", "value"=>"mongo.babypearfoo.com:27017"}] |
|
metricThreshold:metricName | string | The name of the metric. one of: "ASSERT_MSG" or "ASSERT_REGULAR" or "ASSERT_USER" or "ASSERT_WARNING" or "BACKGROUND_FLUSH_AVG" or "COMPUTED_MEMORY" or "CONNECTIONS" or "CONNECTIONS_MAX" or "CURSORS_TOTAL_CLIENT_CURSORS_SIZE" or "CURSORS_TOTAL_OPEN" or "CURSORS_TOTAL_TIMED_OUT" or "DB_DATA_SIZE_TOTAL" or "DB_LOCK_PERCENTAGE" or "DB_ACCESSES_NOT_IN_MEMORY" or "DB_PAGE_FAULT_EXCEPTIONS_THROWN" or "DB_STORAGE_TOTAL" or "EFFECTIVE_LOCK_PERCENTAGE" or "EXTRA_INFO_PAGE_FAULTS" or "GLOBAL_ACCESSES_NOT_IN_MEMORY" or "GLOBAL_LOCK_CURRENT_QUEUE_READERS" or "GLOBAL_LOCK_CURRENT_QUEUE_TOTAL" or "GLOBAL_LOCK_CURRENT_QUEUE_WRITERS" or "GLOBAL_PAGE_FAULT_EXCEPTIONS_THROWN" or "INDEX_COUNTERS_BTREE_ACCESSES" or "INDEX_COUNTERS_BTREE_HITS" or "INDEX_COUNTERS_BTREE_MISSES" or "INDEX_COUNTERS_BTREE_MISS_RATIO" or "JOURNALING_COMMITS_IN_WRITE_LOCK" or "JOURNALING_MB" or "JOURNALING_WRITE_DATA_FILES_MB" or "MEMORY_MAPPED" or "MEMORY_RESIDENT" or "MEMORY_VIRTUAL" or "MUNIN_CPU_IOWAIT" or "MUNIN_CPU_IRQ" or "MUNIN_CPU_NICE" or "MUNIN_CPU_SOFTIRQ" or "MUNIN_CPU_STEAL" or "MUNIN_CPU_SYSTEM" or "MUNIN_CPU_USER" or "MUNIN_IOSTAT_OP_READ" or "MUNIN_IOSTAT_OP_WRITE" or "MUNIN_IOSTAT_TIME_READ" or "MUNIN_IOSTAT_TIME_WRITE" or "NETWORK_BYTES_IN" or "NETWORK_BYTES_OUT" or "NETWORK_NUM_REQUESTS" or "OPCOUNTER_CMD" or "OPCOUNTER_DELETE" or "OPCOUNTER_GETMORE" or "OPCOUNTER_INSERT" or "OPCOUNTER_QUERY" or "OPCOUNTER_REPL_CMD" or "OPCOUNTER_REPL_DELETE" or "OPCOUNTER_REPL_INSERT" or "OPCOUNTER_REPL_UPDATE" or "OPCOUNTER_UPDATE" or "OPLOG_MASTER_LAG_TIME_DIFF" or "OPLOG_MASTER_TIME" or "OPLOG_RATE_GB_PER_HOUR" or "OPLOG_SLAVE_LAG_MASTER_TIME" |
"ASSERT_MSG" |
metricThreshold:mode | string | The mode to use when computing the current metric value. one of: "AVERAGE" or "TOTAL" |
"TOTAL" |
metricThreshold:operator | string | The operator to apply when checking the current metric value against the threshold value. one of: "GREATER_THAN" or "LESS_THAN" |
"GREATER_THAN" |
metricThreshold:threshold | integer | The threshold value outside of which an alert will be triggered. | 7 |
metricThreshold:units | string | The units in which the metric values are expressed. one of: "RAW" or "BITS" or "KILOBITS" or "MEGABITS" or "GIGABITS" or "BYTES" or "KILOBYTES" or "MEGABYTES" or "GIGABYTES" or "TERABYTES" or "PETABYTES" or "MILLISECONDS" or "SECONDS" or "MINUTES" or "HOURS" or "DAYS" |
"BYTES" |
notifications | array | [{"typeName"=>"SMS", "delayMin"=>5, "intervalMin"=>0, "emailAddress"=>"jane.doe@gmail.com", "notificationToken"=>"123456abcdef", "roomName"=>"Test Chat Room", "emailEnabled"=>true, "smsEnabled"=>true, "username"=>"jane.doe@gmail.com", "mobileNumber"=>"(212) 212-1212", "snmpAddress"=>"somedomain.com:161", "serviceKey"=>"123456abcdef"}] |
|
typeName | string | The type of alert. one of: "AGENT" or "BACKUP" or "HOST" or "HOST_METRIC" or "REPLICA_SET" |
"AGENT" |
updated | date-time | When this alert configuration was last updated. | "2012-01-01T12:00:00Z" |
Create a new alertConfig.
POST /groups/{group_id}/alertConfigs
$ curl -n -X POST https://mms.mongodb.com/api/public/v1.0/groups/$GROUP_ID/alertConfigs
-H "Content-Type: application/json" \
-d '{"id":"533dc40ae4b00835ff81eaee","groupId":"5196d3628d022db4cbc26d9e","typeName":"AGENT","eventTypeName":"MONITORING_AGENT_DOWN","created":"2012-01-01T12:00:00Z","updated":"2012-01-01T12:00:00Z","enabled":true,"matchers":[{"fieldName":"hostnameAndPort","operator":"EQUALS","value":"mongo.babypearfoo.com:27017"}],"notifications":[{"typeName":"SMS","delayMin":5,"intervalMin":0,"emailAddress":"jane.doe@gmail.com","notificationToken":"123456abcdef","roomName":"Test Chat Room","emailEnabled":true,"smsEnabled":true,"username":"jane.doe@gmail.com","mobileNumber":"(212) 212-1212","snmpAddress":"somedomain.com:161","serviceKey":"123456abcdef"}],"metricThreshold":{"metricName":"ASSERT_MSG","operator":"GREATER_THAN","threshold":7,"units":"BYTES","mode":"TOTAL"}}'
HTTP/1.1 201 Created
{
"id": "533dc40ae4b00835ff81eaee",
"groupId": "5196d3628d022db4cbc26d9e",
"typeName": "AGENT",
"eventTypeName": "MONITORING_AGENT_DOWN",
"created": "2012-01-01T12:00:00Z",
"updated": "2012-01-01T12:00:00Z",
"enabled": true,
"matchers": [
{
"fieldName": "hostnameAndPort",
"operator": "EQUALS",
"value": "mongo.babypearfoo.com:27017"
}
],
"notifications": [
{
"typeName": "SMS",
"delayMin": 5,
"intervalMin": 0,
"emailAddress": "jane.doe@gmail.com",
"notificationToken": "123456abcdef",
"roomName": "Test Chat Room",
"emailEnabled": true,
"smsEnabled": true,
"username": "jane.doe@gmail.com",
"mobileNumber": "(212) 212-1212",
"snmpAddress": "somedomain.com:161",
"serviceKey": "123456abcdef"
}
],
"metricThreshold": {
"metricName": "ASSERT_MSG",
"operator": "GREATER_THAN",
"threshold": 7,
"units": "BYTES",
"mode": "TOTAL"
}
}
Delete an existing alertConfig.
DELETE /groups/{group_id}/alertConfigs/{alertConfig_id}
$ curl -n -X DELETE https://mms.mongodb.com/api/public/v1.0/groups/$GROUP_ID/alertConfigs/$ALERTCONFIG_ID
HTTP/1.1 200 OK
{
"id": "533dc40ae4b00835ff81eaee",
"groupId": "5196d3628d022db4cbc26d9e",
"typeName": "AGENT",
"eventTypeName": "MONITORING_AGENT_DOWN",
"created": "2012-01-01T12:00:00Z",
"updated": "2012-01-01T12:00:00Z",
"enabled": true,
"matchers": [
{
"fieldName": "hostnameAndPort",
"operator": "EQUALS",
"value": "mongo.babypearfoo.com:27017"
}
],
"notifications": [
{
"typeName": "SMS",
"delayMin": 5,
"intervalMin": 0,
"emailAddress": "jane.doe@gmail.com",
"notificationToken": "123456abcdef",
"roomName": "Test Chat Room",
"emailEnabled": true,
"smsEnabled": true,
"username": "jane.doe@gmail.com",
"mobileNumber": "(212) 212-1212",
"snmpAddress": "somedomain.com:161",
"serviceKey": "123456abcdef"
}
],
"metricThreshold": {
"metricName": "ASSERT_MSG",
"operator": "GREATER_THAN",
"threshold": 7,
"units": "BYTES",
"mode": "TOTAL"
}
}
Info for existing alertConfig.
GET /groups/{group_id}/alertConfigs/{alertConfig_id}
$ curl -n -X GET https://mms.mongodb.com/api/public/v1.0/groups/$GROUP_ID/alertConfigs/$ALERTCONFIG_ID
HTTP/1.1 200 OK
{
"id": "533dc40ae4b00835ff81eaee",
"groupId": "5196d3628d022db4cbc26d9e",
"typeName": "AGENT",
"eventTypeName": "MONITORING_AGENT_DOWN",
"created": "2012-01-01T12:00:00Z",
"updated": "2012-01-01T12:00:00Z",
"enabled": true,
"matchers": [
{
"fieldName": "hostnameAndPort",
"operator": "EQUALS",
"value": "mongo.babypearfoo.com:27017"
}
],
"notifications": [
{
"typeName": "SMS",
"delayMin": 5,
"intervalMin": 0,
"emailAddress": "jane.doe@gmail.com",
"notificationToken": "123456abcdef",
"roomName": "Test Chat Room",
"emailEnabled": true,
"smsEnabled": true,
"username": "jane.doe@gmail.com",
"mobileNumber": "(212) 212-1212",
"snmpAddress": "somedomain.com:161",
"serviceKey": "123456abcdef"
}
],
"metricThreshold": {
"metricName": "ASSERT_MSG",
"operator": "GREATER_THAN",
"threshold": 7,
"units": "BYTES",
"mode": "TOTAL"
}
}
List existing alertConfigs.
GET /groups/{group_id}/alertConfigs
$ curl -n -X GET https://mms.mongodb.com/api/public/v1.0/groups/$GROUP_ID/alertConfigs
HTTP/1.1 200 OK
{
"totalCount": 1,
"results": [
{
"id": "533dc40ae4b00835ff81eaee",
"groupId": "5196d3628d022db4cbc26d9e",
"typeName": "AGENT",
"eventTypeName": "MONITORING_AGENT_DOWN",
"created": "2012-01-01T12:00:00Z",
"updated": "2012-01-01T12:00:00Z",
"enabled": true,
"matchers": [
{
"fieldName": "hostnameAndPort",
"operator": "EQUALS",
"value": "mongo.babypearfoo.com:27017"
}
],
"notifications": [
{
"typeName": "SMS",
"delayMin": 5,
"intervalMin": 0,
"emailAddress": "jane.doe@gmail.com",
"notificationToken": "123456abcdef",
"roomName": "Test Chat Room",
"emailEnabled": true,
"smsEnabled": true,
"username": "jane.doe@gmail.com",
"mobileNumber": "(212) 212-1212",
"snmpAddress": "somedomain.com:161",
"serviceKey": "123456abcdef"
}
],
"metricThreshold": {
"metricName": "ASSERT_MSG",
"operator": "GREATER_THAN",
"threshold": 7,
"units": "BYTES",
"mode": "TOTAL"
}
}
]
}
Replace an existing alertConfig.
PUT /groups/{group_id}/alertConfigs/{alertConfig_id}
$ curl -n -X PUT https://mms.mongodb.com/api/public/v1.0/groups/$GROUP_ID/alertConfigs/$ALERTCONFIG_ID
-H "Content-Type: application/json" \
-d '{"id":"533dc40ae4b00835ff81eaee","groupId":"5196d3628d022db4cbc26d9e","typeName":"AGENT","eventTypeName":"MONITORING_AGENT_DOWN","created":"2012-01-01T12:00:00Z","updated":"2012-01-01T12:00:00Z","enabled":true,"matchers":[{"fieldName":"hostnameAndPort","operator":"EQUALS","value":"mongo.babypearfoo.com:27017"}],"notifications":[{"typeName":"SMS","delayMin":5,"intervalMin":0,"emailAddress":"jane.doe@gmail.com","notificationToken":"123456abcdef","roomName":"Test Chat Room","emailEnabled":true,"smsEnabled":true,"username":"jane.doe@gmail.com","mobileNumber":"(212) 212-1212","snmpAddress":"somedomain.com:161","serviceKey":"123456abcdef"}],"metricThreshold":{"metricName":"ASSERT_MSG","operator":"GREATER_THAN","threshold":7,"units":"BYTES","mode":"TOTAL"}}'
HTTP/1.1 200 OK
{
"id": "533dc40ae4b00835ff81eaee",
"groupId": "5196d3628d022db4cbc26d9e",
"typeName": "AGENT",
"eventTypeName": "MONITORING_AGENT_DOWN",
"created": "2012-01-01T12:00:00Z",
"updated": "2012-01-01T12:00:00Z",
"enabled": true,
"matchers": [
{
"fieldName": "hostnameAndPort",
"operator": "EQUALS",
"value": "mongo.babypearfoo.com:27017"
}
],
"notifications": [
{
"typeName": "SMS",
"delayMin": 5,
"intervalMin": 0,
"emailAddress": "jane.doe@gmail.com",
"notificationToken": "123456abcdef",
"roomName": "Test Chat Room",
"emailEnabled": true,
"smsEnabled": true,
"username": "jane.doe@gmail.com",
"mobileNumber": "(212) 212-1212",
"snmpAddress": "somedomain.com:161",
"serviceKey": "123456abcdef"
}
],
"metricThreshold": {
"metricName": "ASSERT_MSG",
"operator": "GREATER_THAN",
"threshold": 7,
"units": "BYTES",
"mode": "TOTAL"
}
}
Update an existing alertConfig.
PATCH /groups/{group_id}/alertConfigs/{alertConfig_id}
$ curl -n -X PATCH https://mms.mongodb.com/api/public/v1.0/groups/$GROUP_ID/alertConfigs/$ALERTCONFIG_ID
-H "Content-Type: application/json" \
-d '{"id":"533dc40ae4b00835ff81eaee","groupId":"5196d3628d022db4cbc26d9e","typeName":"AGENT","eventTypeName":"MONITORING_AGENT_DOWN","created":"2012-01-01T12:00:00Z","updated":"2012-01-01T12:00:00Z","enabled":true,"matchers":[{"fieldName":"hostnameAndPort","operator":"EQUALS","value":"mongo.babypearfoo.com:27017"}],"notifications":[{"typeName":"SMS","delayMin":5,"intervalMin":0,"emailAddress":"jane.doe@gmail.com","notificationToken":"123456abcdef","roomName":"Test Chat Room","emailEnabled":true,"smsEnabled":true,"username":"jane.doe@gmail.com","mobileNumber":"(212) 212-1212","snmpAddress":"somedomain.com:161","serviceKey":"123456abcdef"}],"metricThreshold":{"metricName":"ASSERT_MSG","operator":"GREATER_THAN","threshold":7,"units":"BYTES","mode":"TOTAL"}}'
HTTP/1.1 200 OK
{
"id": "533dc40ae4b00835ff81eaee",
"groupId": "5196d3628d022db4cbc26d9e",
"typeName": "AGENT",
"eventTypeName": "MONITORING_AGENT_DOWN",
"created": "2012-01-01T12:00:00Z",
"updated": "2012-01-01T12:00:00Z",
"enabled": true,
"matchers": [
{
"fieldName": "hostnameAndPort",
"operator": "EQUALS",
"value": "mongo.babypearfoo.com:27017"
}
],
"notifications": [
{
"typeName": "SMS",
"delayMin": 5,
"intervalMin": 0,
"emailAddress": "jane.doe@gmail.com",
"notificationToken": "123456abcdef",
"roomName": "Test Chat Room",
"emailEnabled": true,
"smsEnabled": true,
"username": "jane.doe@gmail.com",
"mobileNumber": "(212) 212-1212",
"snmpAddress": "somedomain.com:161",
"serviceKey": "123456abcdef"
}
],
"metricThreshold": {
"metricName": "ASSERT_MSG",
"operator": "GREATER_THAN",
"threshold": 7,
"units": "BYTES",
"mode": "TOTAL"
}
}
Working with MMS Backup Configurations
Name | Type | Description | Example |
---|---|---|---|
authMechanismName | string | The name of the authentication mechanism to use when connecting to the sync cource database. Only present when using authentication. one of: "MONGODB_CR" or "GSSAPI" |
"MONGODB_CR" |
clusterId | string | ID of the cluster that this backup configuration is for. | "5196e5b0e4b0fca9cc88334a" |
excludedNamespaces | string | The username to use to connect to the sync source database. Only present when auth is required to connect to the mongod being backed up. | "12!@hello" |
groupId | string | ID of the group that owns this host. | "5196d3628d022db4cbc26d9e" |
password | string | The username to use to connect to the sync source database. Only present when auth is required to connect to the mongod being backed up. | "12!@hello" |
sslEnabled | string | The username to use to connect to the sync source database. Only present when auth is required to connect to the mongod being backed up. | "12!@hello" |
statusName | string | The current (or desired) status of the backup configuration. one of: "INACTIVE" or "PROVISIONING" or "STARTED" or "STOPPED" or "TERMINATING" |
"STARTED" |
syncSource | string | The username to use to connect to the sync source database. Only present when auth is required to connect to the mongod being backed up. | "12!@hello" |
username | string | The username to use to connect to the sync source database. Only present when auth is required to connect to the mongod being backed up. | "bob@gmail.com" |
Info for existing backupConfig.
GET /groups/{group_id}/backupConfigs/{backupConfig_clusterId}
$ curl -n -X GET https://mms.mongodb.com/api/public/v1.0/groups/$GROUP_ID/backupConfigs/$BACKUPCONFIG_CLUSTERID
HTTP/1.1 200 OK
{
"clusterId": "5196e5b0e4b0fca9cc88334a",
"groupId": "5196d3628d022db4cbc26d9e",
"statusName": "STARTED",
"authMechanismName": "MONGODB_CR",
"username": "bob@gmail.com",
"password": "12!@hello",
"sslEnabled": "12!@hello",
"syncSource": "12!@hello",
"excludedNamespaces": "12!@hello"
}
List existing backupConfigs.
GET /groups/{group_id}/backupConfigs
$ curl -n -X GET https://mms.mongodb.com/api/public/v1.0/groups/$GROUP_ID/backupConfigs
HTTP/1.1 200 OK
{
"totalCount": 1,
"results": [
{
"clusterId": "5196e5b0e4b0fca9cc88334a",
"groupId": "5196d3628d022db4cbc26d9e",
"statusName": "STARTED",
"authMechanismName": "MONGODB_CR",
"username": "bob@gmail.com",
"password": "12!@hello",
"sslEnabled": "12!@hello",
"syncSource": "12!@hello",
"excludedNamespaces": "12!@hello"
}
]
}
Update an existing backupConfig.
PATCH /groups/{group_id}/backupConfigs/{backupConfig_clusterId}
$ curl -n -X PATCH https://mms.mongodb.com/api/public/v1.0/groups/$GROUP_ID/backupConfigs/$BACKUPCONFIG_CLUSTERID
-H "Content-Type: application/json" \
-d '{"clusterId":"5196e5b0e4b0fca9cc88334a","groupId":"5196d3628d022db4cbc26d9e","statusName":"STARTED","authMechanismName":"MONGODB_CR","username":"bob@gmail.com","password":"12!@hello","sslEnabled":"12!@hello","syncSource":"12!@hello","excludedNamespaces":"12!@hello"}'
HTTP/1.1 200 OK
{
"clusterId": "5196e5b0e4b0fca9cc88334a",
"groupId": "5196d3628d022db4cbc26d9e",
"statusName": "STARTED",
"authMechanismName": "MONGODB_CR",
"username": "bob@gmail.com",
"password": "12!@hello",
"sslEnabled": "12!@hello",
"syncSource": "12!@hello",
"excludedNamespaces": "12!@hello"
}
Working with MMS Clusters
Name | Type | Description | Example |
---|---|---|---|
clusterName | string | Display name of the cluster. Only applies to sharded clusters. Note that mongod itself doesn't allow you to name a cluster; this name is supplied by (and editable within) MMS. For a replica set within a sharded cluster, the cluster name is the name of its parent cluster. | "Cluster 0" |
groupId | string | ID of the group that owns this cluster. | "533d7d4730040be257defe88" |
id | string | Unique identifier | "5196d3628d022db4cbc26d9e" |
lastHeartbeat | date-time | The approximate last time MMS processed a ping from this cluster. | "2014-02-26T17:32:45Z" |
replicaSetName | string | Name of the replica set. Only present for a cluster of type REPLICA_SET. | "rs1" |
shardName | string | Name of the shard. Only present for a cluster of type SHARDED or REPLICA_SET that is part of a sharded cluster. | "shard001" |
typeName | string | Specifies what kind of cluster this is. one of: "MASTER_SLAVE" or "REPLICA_SET" or "SHARDED" or "SHARDED_REPLICA_SET" |
"REPLICA_SET" |
Info for existing cluster.
GET /groups/{group_id}/clusters/{cluster_id}
$ curl -n -X GET https://mms.mongodb.com/api/public/v1.0/groups/$GROUP_ID/clusters/$CLUSTER_ID
HTTP/1.1 200 OK
{
"id": "5196d3628d022db4cbc26d9e",
"groupId": "533d7d4730040be257defe88",
"typeName": "REPLICA_SET",
"clusterName": "Cluster 0",
"shardName": "shard001",
"replicaSetName": "rs1",
"lastHeartbeat": "2014-02-26T17:32:45Z"
}
List existing clusters.
GET /groups/{group_id}/clusters
$ curl -n -X GET https://mms.mongodb.com/api/public/v1.0/groups/$GROUP_ID/clusters
HTTP/1.1 200 OK
{
"totalCount": 1,
"results": [
{
"id": "5196d3628d022db4cbc26d9e",
"groupId": "533d7d4730040be257defe88",
"typeName": "REPLICA_SET",
"clusterName": "Cluster 0",
"shardName": "shard001",
"replicaSetName": "rs1",
"lastHeartbeat": "2014-02-26T17:32:45Z"
}
]
}
Update an existing cluster.
PATCH /groups/{group_id}/clusters/{cluster_id}
$ curl -n -X PATCH https://mms.mongodb.com/api/public/v1.0/groups/$GROUP_ID/clusters/$CLUSTER_ID
-H "Content-Type: application/json" \
-d '{"id":"5196d3628d022db4cbc26d9e","groupId":"533d7d4730040be257defe88","typeName":"REPLICA_SET","clusterName":"Cluster 0","shardName":"shard001","replicaSetName":"rs1","lastHeartbeat":"2014-02-26T17:32:45Z"}'
HTTP/1.1 200 OK
{
"id": "5196d3628d022db4cbc26d9e",
"groupId": "533d7d4730040be257defe88",
"typeName": "REPLICA_SET",
"clusterName": "Cluster 0",
"shardName": "shard001",
"replicaSetName": "rs1",
"lastHeartbeat": "2014-02-26T17:32:45Z"
}
Working with MMS Groups
Name | Type | Description | Example |
---|---|---|---|
activeAgentCount | integer | Number of monitoring agents sending regular pings to MMS. | "1" |
hostsCounts:arbiter | integer | 1 |
|
hostsCounts:config | integer | 1 |
|
hostsCounts:master | integer | 1 |
|
hostsCounts:mongos | integer | 1 |
|
hostsCounts:primary | integer | 1 |
|
hostsCounts:secondary | integer | 1 |
|
hostsCounts:slave | integer | 1 |
|
id | string | Unique identifier | "5196d3628d022db4cbc26d9e" |
lastActiveAgent | date-time | Date that a ping was last received from one of the group's monitoring agents. | "2012-01-01T12:00:00Z" |
name | string | Display name for the group | "My Group" |
publicApiEnabled | boolean | Is the Public API enabled for this group? This is a read-only field that will always be true for groups created with the API. Note that for groups created in the MMS UI, the only way to set this flag to true is by enabling the Public API for the group in the Settings tab. | true |
replicaSetCount | integer | Total number of replica sets for this group. | "1" |
shardCount | integer | Total number of shards for this group. | "1" |
Create a new group.
POST /groups
$ curl -n -X POST https://mms.mongodb.com/api/public/v1.0/groups
-H "Content-Type: application/json" \
-d '{"id":"5196d3628d022db4cbc26d9e","name":"My Group","hostsCounts":{"arbiter":1,"config":1,"primary":1,"secondary":1,"mongos":1,"master":1,"slave":1},"lastActiveAgent":"2012-01-01T12:00:00Z","activeAgentCount":"1","replicaSetCount":"1","shardCount":"1","publicApiEnabled":true}'
HTTP/1.1 201 Created
{
"id": "5196d3628d022db4cbc26d9e",
"name": "My Group",
"hostsCounts": {
"arbiter": 1,
"config": 1,
"primary": 1,
"secondary": 1,
"mongos": 1,
"master": 1,
"slave": 1
},
"lastActiveAgent": "2012-01-01T12:00:00Z",
"activeAgentCount": "1",
"replicaSetCount": "1",
"shardCount": "1",
"publicApiEnabled": true
}
Delete an existing group.
DELETE /groups/{group_id}
$ curl -n -X DELETE https://mms.mongodb.com/api/public/v1.0/groups/$GROUP_ID
HTTP/1.1 200 OK
{
"id": "5196d3628d022db4cbc26d9e",
"name": "My Group",
"hostsCounts": {
"arbiter": 1,
"config": 1,
"primary": 1,
"secondary": 1,
"mongos": 1,
"master": 1,
"slave": 1
},
"lastActiveAgent": "2012-01-01T12:00:00Z",
"activeAgentCount": "1",
"replicaSetCount": "1",
"shardCount": "1",
"publicApiEnabled": true
}
Info for existing groups.
GET /groups/{group_id}
$ curl -n -X GET https://mms.mongodb.com/api/public/v1.0/groups/$GROUP_ID
HTTP/1.1 200 OK
{
"id": "5196d3628d022db4cbc26d9e",
"name": "My Group",
"hostsCounts": {
"arbiter": 1,
"config": 1,
"primary": 1,
"secondary": 1,
"mongos": 1,
"master": 1,
"slave": 1
},
"lastActiveAgent": "2012-01-01T12:00:00Z",
"activeAgentCount": "1",
"replicaSetCount": "1",
"shardCount": "1",
"publicApiEnabled": true
}
List existing groups.
GET /groups
$ curl -n -X GET https://mms.mongodb.com/api/public/v1.0/groups
HTTP/1.1 200 OK
{
"totalCount": 1,
"results": [
{
"id": "5196d3628d022db4cbc26d9e",
"name": "My Group",
"hostsCounts": {
"arbiter": 1,
"config": 1,
"primary": 1,
"secondary": 1,
"mongos": 1,
"master": 1,
"slave": 1
},
"lastActiveAgent": "2012-01-01T12:00:00Z",
"activeAgentCount": "1",
"replicaSetCount": "1",
"shardCount": "1",
"publicApiEnabled": true
}
]
}
Working with MMS Hosts
Name | Type | Description | Example |
---|---|---|---|
alertsEnabled | boolean | Are alerts enabled for this host? | true |
authMechanismName | string | The authentication mechanism used to connect to this host. one of: "MONGODB_CR" or "GSSAPI" or "NONE" |
"MONGODB_CR" |
created | date-time | Date this host was created or first discovered by MMS. | "2013-12-15T09:17:23Z" |
deactivated | boolean | Has this host been deactivated by MMS? A host will be marked as deactivated when MMS hasn't received a ping from it in several days. | false |
groupId | string | ID of the group that owns this host. | "5196d3628d022db4cbc26d9e" |
hasStartupWarnings | boolean | Are there startup warnings for this host? | false |
hidden | boolean | Is this host currently hidden? When MMS deactivates a host, it will also mark it as hidden. | false |
hostEnabled | boolean | Is this host currently enabled? Hosts can be manually disabled in the MMS UI. | true |
hostname | string | Primary hostname. A host typically has several aliases, so the primary is the best available name as decided by MMS. | "localhost" |
id | string | Unique identifier | "4059580c20c4581872ef24d0b8f5dca0" |
journalingEnabled | boolean | Is journaling enabled for this host? | true |
lastPing | date-time | When the last ping for this host was received. | "2014-04-22T19:56:50Z" |
lastReactivated | date-time | The last time this has was manually reactivated. | "2014-04-22T19:56:50Z" |
lastRestart | date-time | Date this host was last restarted. | "2014-04-22T19:56:50Z" |
logsEnabled | boolean | Is MMS collecting logs for this host? | false |
lowUlimit | boolean | Does this host have a low ulimit setting? | false |
muninEnabled | boolean | Are Munin stats being collected for this host? | true |
muninPort | integer | What port should be used to collect Munin stats from this host? | 4949 |
password | string | Password for connecting to this host. If a host's authMechanismName is MONGODB_CR, then you must include this field when creating the host or updating its credentials. However, it will never be exposed when a host entity is returned. | "myM0NGO0!" |
port | integer | Port that MongoDB process (mongod or mongos) listens on. | 27017 |
profilerEnabled | boolean | Is MMS collecting profile information from this host? | true |
replicaSetName | string | Name of the replica set this host belongs to. Only present if this host is part of a replica set. | "rs0" |
replicaStateName | string | Current state of this host within a replica set. Only present if this host is part of a replica set. one of: "STARTUP" or "PRIMARY" or "SECONDARY" or "RECOVERING" or "FATAL" or "STARTUP2" or "UNKNOWN" or "ARBITER" or "DOWN" or "ROLLBACK" or "REMOVED" |
"SECONDARY" |
shardName | string | Name of the shard this host belongs to. Only present if the host is part of a sharded cluster. | "myShard0" |
sslEnabled | boolean | Is SSL enabled for this host? | false |
uptimeMsec | integer | Number of milliseconds since this host's last restart. | 1024 |
username | string | Username for connecting to this host. Only present when the authMechanismName is MONGODB_CR. | "mongo" |
version | string | Version of MongoDB running on this host. | "2.6.3" |
Create a new host.
POST /groups/{group_id}/hosts
$ curl -n -X POST https://mms.mongodb.com/api/public/v1.0/groups/$GROUP_ID/hosts
-H "Content-Type: application/json" \
-d '{"id":"4059580c20c4581872ef24d0b8f5dca0","groupId":"5196d3628d022db4cbc26d9e","hostname":"localhost","port":27017,"lastPing":"2014-04-22T19:56:50Z","version":"2.6.3","deactivated":false,"hasStartupWarnings":false,"sslEnabled":false,"logsEnabled":false,"lastReactivated":"2014-04-22T19:56:50Z","uptimeMsec":1024,"lastRestart":"2014-04-22T19:56:50Z","shardName":"myShard0","replicaSetName":"rs0","replicaStateName":"SECONDARY","created":"2013-12-15T09:17:23Z","hostEnabled":true,"journalingEnabled":true,"alertsEnabled":true,"muninEnabled":true,"hidden":false,"profilerEnabled":true,"lowUlimit":false,"muninPort":4949,"authMechanismName":"MONGODB_CR","username":"mongo","password":"myM0NGO0!"}'
HTTP/1.1 201 Created
{
"id": "4059580c20c4581872ef24d0b8f5dca0",
"groupId": "5196d3628d022db4cbc26d9e",
"hostname": "localhost",
"port": 27017,
"lastPing": "2014-04-22T19:56:50Z",
"version": "2.6.3",
"deactivated": false,
"hasStartupWarnings": false,
"sslEnabled": false,
"logsEnabled": false,
"lastReactivated": "2014-04-22T19:56:50Z",
"uptimeMsec": 1024,
"lastRestart": "2014-04-22T19:56:50Z",
"shardName": "myShard0",
"replicaSetName": "rs0",
"replicaStateName": "SECONDARY",
"created": "2013-12-15T09:17:23Z",
"hostEnabled": true,
"journalingEnabled": true,
"alertsEnabled": true,
"muninEnabled": true,
"hidden": false,
"profilerEnabled": true,
"lowUlimit": false,
"muninPort": 4949,
"authMechanismName": "MONGODB_CR",
"username": "mongo",
"password": "myM0NGO0!"
}
Delete an existing host.
DELETE /groups/{group_id}/hosts/{host_id}
$ curl -n -X DELETE https://mms.mongodb.com/api/public/v1.0/groups/$GROUP_ID/hosts/$HOST_ID
HTTP/1.1 200 OK
{
"id": "4059580c20c4581872ef24d0b8f5dca0",
"groupId": "5196d3628d022db4cbc26d9e",
"hostname": "localhost",
"port": 27017,
"lastPing": "2014-04-22T19:56:50Z",
"version": "2.6.3",
"deactivated": false,
"hasStartupWarnings": false,
"sslEnabled": false,
"logsEnabled": false,
"lastReactivated": "2014-04-22T19:56:50Z",
"uptimeMsec": 1024,
"lastRestart": "2014-04-22T19:56:50Z",
"shardName": "myShard0",
"replicaSetName": "rs0",
"replicaStateName": "SECONDARY",
"created": "2013-12-15T09:17:23Z",
"hostEnabled": true,
"journalingEnabled": true,
"alertsEnabled": true,
"muninEnabled": true,
"hidden": false,
"profilerEnabled": true,
"lowUlimit": false,
"muninPort": 4949,
"authMechanismName": "MONGODB_CR",
"username": "mongo",
"password": "myM0NGO0!"
}
Info for existing host.
GET /groups/{group_id}/hosts/{host_id}
$ curl -n -X GET https://mms.mongodb.com/api/public/v1.0/groups/$GROUP_ID/hosts/$HOST_ID
HTTP/1.1 200 OK
{
"id": "4059580c20c4581872ef24d0b8f5dca0",
"groupId": "5196d3628d022db4cbc26d9e",
"hostname": "localhost",
"port": 27017,
"lastPing": "2014-04-22T19:56:50Z",
"version": "2.6.3",
"deactivated": false,
"hasStartupWarnings": false,
"sslEnabled": false,
"logsEnabled": false,
"lastReactivated": "2014-04-22T19:56:50Z",
"uptimeMsec": 1024,
"lastRestart": "2014-04-22T19:56:50Z",
"shardName": "myShard0",
"replicaSetName": "rs0",
"replicaStateName": "SECONDARY",
"created": "2013-12-15T09:17:23Z",
"hostEnabled": true,
"journalingEnabled": true,
"alertsEnabled": true,
"muninEnabled": true,
"hidden": false,
"profilerEnabled": true,
"lowUlimit": false,
"muninPort": 4949,
"authMechanismName": "MONGODB_CR",
"username": "mongo",
"password": "myM0NGO0!"
}
List existing hosts.
GET /groups/{group_id}/hosts
$ curl -n -X GET https://mms.mongodb.com/api/public/v1.0/groups/$GROUP_ID/hosts
HTTP/1.1 200 OK
{
"totalCount": 1,
"results": [
{
"id": "4059580c20c4581872ef24d0b8f5dca0",
"groupId": "5196d3628d022db4cbc26d9e",
"hostname": "localhost",
"port": 27017,
"lastPing": "2014-04-22T19:56:50Z",
"version": "2.6.3",
"deactivated": false,
"hasStartupWarnings": false,
"sslEnabled": false,
"logsEnabled": false,
"lastReactivated": "2014-04-22T19:56:50Z",
"uptimeMsec": 1024,
"lastRestart": "2014-04-22T19:56:50Z",
"shardName": "myShard0",
"replicaSetName": "rs0",
"replicaStateName": "SECONDARY",
"created": "2013-12-15T09:17:23Z",
"hostEnabled": true,
"journalingEnabled": true,
"alertsEnabled": true,
"muninEnabled": true,
"hidden": false,
"profilerEnabled": true,
"lowUlimit": false,
"muninPort": 4949,
"authMechanismName": "MONGODB_CR",
"username": "mongo",
"password": "myM0NGO0!"
}
]
}
Update an existing host.
PATCH /groups/{group_id}/hosts/{host_id}
$ curl -n -X PATCH https://mms.mongodb.com/api/public/v1.0/groups/$GROUP_ID/hosts/$HOST_ID
-H "Content-Type: application/json" \
-d '{"id":"4059580c20c4581872ef24d0b8f5dca0","groupId":"5196d3628d022db4cbc26d9e","hostname":"localhost","port":27017,"lastPing":"2014-04-22T19:56:50Z","version":"2.6.3","deactivated":false,"hasStartupWarnings":false,"sslEnabled":false,"logsEnabled":false,"lastReactivated":"2014-04-22T19:56:50Z","uptimeMsec":1024,"lastRestart":"2014-04-22T19:56:50Z","shardName":"myShard0","replicaSetName":"rs0","replicaStateName":"SECONDARY","created":"2013-12-15T09:17:23Z","hostEnabled":true,"journalingEnabled":true,"alertsEnabled":true,"muninEnabled":true,"hidden":false,"profilerEnabled":true,"lowUlimit":false,"muninPort":4949,"authMechanismName":"MONGODB_CR","username":"mongo","password":"myM0NGO0!"}'
HTTP/1.1 200 OK
{
"id": "4059580c20c4581872ef24d0b8f5dca0",
"groupId": "5196d3628d022db4cbc26d9e",
"hostname": "localhost",
"port": 27017,
"lastPing": "2014-04-22T19:56:50Z",
"version": "2.6.3",
"deactivated": false,
"hasStartupWarnings": false,
"sslEnabled": false,
"logsEnabled": false,
"lastReactivated": "2014-04-22T19:56:50Z",
"uptimeMsec": 1024,
"lastRestart": "2014-04-22T19:56:50Z",
"shardName": "myShard0",
"replicaSetName": "rs0",
"replicaStateName": "SECONDARY",
"created": "2013-12-15T09:17:23Z",
"hostEnabled": true,
"journalingEnabled": true,
"alertsEnabled": true,
"muninEnabled": true,
"hidden": false,
"profilerEnabled": true,
"lowUlimit": false,
"muninPort": 4949,
"authMechanismName": "MONGODB_CR",
"username": "mongo",
"password": "myM0NGO0!"
}
Available metrics for existing host.
GET /groups/{group_id}/hosts/{host_id}/metrics
$ curl -n -X GET https://mms.mongodb.com/api/public/v1.0/groups/$GROUP_ID/hosts/$HOST_ID/metrics
HTTP/1.1 200 OK
{
"totalCount": 1,
"results": [
{
"hostId": "680ab316473d6b28f966364b947134fc",
"groupId": "2847387cd717dabc348a",
"metricName": "ASSERT_MSG",
"units": "BYTES",
"granularity": "MINUTE",
"deviceName": "xxx",
"databaseName": "mydb",
"dataPoints": [
{
"timestamp": "2014-08-29T14:00:00Z",
"value": 381.2
}
]
}
]
}
Get the data points for the specified host and metric.
GET /groups/{group_id}/hosts/{host_id}/metrics/{metric_metricName}
$ curl -n -X GET https://mms.mongodb.com/api/public/v1.0/groups/$GROUP_ID/hosts/$HOST_ID/metrics/$METRIC_METRICNAME
HTTP/1.1 200 OK
{
"hostId": "680ab316473d6b28f966364b947134fc",
"groupId": "2847387cd717dabc348a",
"metricName": "ASSERT_MSG",
"units": "BYTES",
"granularity": "MINUTE",
"deviceName": "xxx",
"databaseName": "mydb",
"dataPoints": [
{
"timestamp": "2014-08-29T14:00:00Z",
"value": 381.2
}
]
}
Get the data points for the specified host, db, and metric.
GET /groups/{group_id}/hosts/{host_id}/metrics/{metric_metricName}/{metric_databaseName}
$ curl -n -X GET https://mms.mongodb.com/api/public/v1.0/groups/$GROUP_ID/hosts/$HOST_ID/metrics/$METRIC_METRICNAME/$METRIC_DATABASENAME
HTTP/1.1 200 OK
{
"hostId": "680ab316473d6b28f966364b947134fc",
"groupId": "2847387cd717dabc348a",
"metricName": "ASSERT_MSG",
"units": "BYTES",
"granularity": "MINUTE",
"deviceName": "xxx",
"databaseName": "mydb",
"dataPoints": [
{
"timestamp": "2014-08-29T14:00:00Z",
"value": 381.2
}
]
}
Get the data points for the specified host, device and metric.
GET /groups/{group_id}/hosts/{host_id}/metrics/{metric_metricName}/{metric_deviceName}
$ curl -n -X GET https://mms.mongodb.com/api/public/v1.0/groups/$GROUP_ID/hosts/$HOST_ID/metrics/$METRIC_METRICNAME/$METRIC_DEVICENAME
HTTP/1.1 200 OK
{
"hostId": "680ab316473d6b28f966364b947134fc",
"groupId": "2847387cd717dabc348a",
"metricName": "ASSERT_MSG",
"units": "BYTES",
"granularity": "MINUTE",
"deviceName": "xxx",
"databaseName": "mydb",
"dataPoints": [
{
"timestamp": "2014-08-29T14:00:00Z",
"value": 381.2
}
]
}
MMS API Information
Name | Type | Description | Example |
---|---|---|---|
throttling | boolean | Tells whether or not MMS is throttling data. This can be used as a simple indicator of the current health of MMS, since throttling is generally enabled when MMS is in an unhealthy state. | false |
Info for existing root.
GET
$ curl -n -X GET https://mms.mongodb.com/api/public/v1.0
HTTP/1.1 200 OK
{
"throttling": false
}
Working with MMS Users
Name | Type | Description | Example |
---|---|---|---|
emailAddress | string | Email address | "jane.doe@mongodb.com" |
firstName | string | First name | "Jane" |
id | string | Unique identifier | "533dc19ce4b00835ff81e2eb" |
lastName | string | Last name | "Doe" |
mobileNumber | string | Mobile number. This field can only be set or edited using the MMS UI because it is tied to two factor authentication | "2125551234" |
password | string | Password. This field is NOT included in the entity returned from the server. It can only be sent in the entity body when creating a new user. | "M0ng0D8!:)" |
roles | array | Role assignments | [{"groupId"=>"8491812938cbda83918c", "roleName"=>"GROUP_OWNER"}] |
username | string | MMS username | "jane.doe@mongodb.com" |
Create a new user.
POST /users
$ curl -n -X POST https://mms.mongodb.com/api/public/v1.0/users
-H "Content-Type: application/json" \
-d '{"id":"533dc19ce4b00835ff81e2eb","username":"jane.doe@mongodb.com","password":"M0ng0D8!:)","emailAddress":"jane.doe@mongodb.com","mobileNumber":"2125551234","firstName":"Jane","lastName":"Doe","roles":[{"groupId":"8491812938cbda83918c","roleName":"GROUP_OWNER"}]}'
HTTP/1.1 201 Created
{
"id": "533dc19ce4b00835ff81e2eb",
"username": "jane.doe@mongodb.com",
"password": "M0ng0D8!:)",
"emailAddress": "jane.doe@mongodb.com",
"mobileNumber": "2125551234",
"firstName": "Jane",
"lastName": "Doe",
"roles": [
{
"groupId": "8491812938cbda83918c",
"roleName": "GROUP_OWNER"
}
]
}
Add a user to an existing group.
POST /groups/{group_id}/users
$ curl -n -X POST https://mms.mongodb.com/api/public/v1.0/groups/$GROUP_ID/users
-H "Content-Type: application/json" \
-d '{"id":"533dc19ce4b00835ff81e2eb","username":"jane.doe@mongodb.com","password":"M0ng0D8!:)","emailAddress":"jane.doe@mongodb.com","mobileNumber":"2125551234","firstName":"Jane","lastName":"Doe","roles":[{"groupId":"8491812938cbda83918c","roleName":"GROUP_OWNER"}]}'
HTTP/1.1 201 Created
{
"id": "533dc19ce4b00835ff81e2eb",
"username": "jane.doe@mongodb.com",
"password": "M0ng0D8!:)",
"emailAddress": "jane.doe@mongodb.com",
"mobileNumber": "2125551234",
"firstName": "Jane",
"lastName": "Doe",
"roles": [
{
"groupId": "8491812938cbda83918c",
"roleName": "GROUP_OWNER"
}
]
}
Info for existing user.
GET /users/{user_id}
$ curl -n -X GET https://mms.mongodb.com/api/public/v1.0/users/$USER_ID
HTTP/1.1 200 OK
{
"id": "533dc19ce4b00835ff81e2eb",
"username": "jane.doe@mongodb.com",
"password": "M0ng0D8!:)",
"emailAddress": "jane.doe@mongodb.com",
"mobileNumber": "2125551234",
"firstName": "Jane",
"lastName": "Doe",
"roles": [
{
"groupId": "8491812938cbda83918c",
"roleName": "GROUP_OWNER"
}
]
}
List existing users.
GET /groups/{group_id}/users
$ curl -n -X GET https://mms.mongodb.com/api/public/v1.0/groups/$GROUP_ID/users
HTTP/1.1 200 OK
{
"totalCount": 1,
"results": [
{
"id": "533dc19ce4b00835ff81e2eb",
"username": "jane.doe@mongodb.com",
"password": "M0ng0D8!:)",
"emailAddress": "jane.doe@mongodb.com",
"mobileNumber": "2125551234",
"firstName": "Jane",
"lastName": "Doe",
"roles": [
{
"groupId": "8491812938cbda83918c",
"roleName": "GROUP_OWNER"
}
]
}
]
}
Delete an existing user.
DELETE /groups/{group_id}/users/{user_id}
$ curl -n -X DELETE https://mms.mongodb.com/api/public/v1.0/groups/$GROUP_ID/users/$USER_ID
HTTP/1.1 200 OK
{
"id": "533dc19ce4b00835ff81e2eb",
"username": "jane.doe@mongodb.com",
"password": "M0ng0D8!:)",
"emailAddress": "jane.doe@mongodb.com",
"mobileNumber": "2125551234",
"firstName": "Jane",
"lastName": "Doe",
"roles": [
{
"groupId": "8491812938cbda83918c",
"roleName": "GROUP_OWNER"
}
]
}
Update an existing user.
PATCH /users/{user_id}
$ curl -n -X PATCH https://mms.mongodb.com/api/public/v1.0/users/$USER_ID
-H "Content-Type: application/json" \
-d '{"id":"533dc19ce4b00835ff81e2eb","username":"jane.doe@mongodb.com","password":"M0ng0D8!:)","emailAddress":"jane.doe@mongodb.com","mobileNumber":"2125551234","firstName":"Jane","lastName":"Doe","roles":[{"groupId":"8491812938cbda83918c","roleName":"GROUP_OWNER"}]}'
HTTP/1.1 200 OK
{
"id": "533dc19ce4b00835ff81e2eb",
"username": "jane.doe@mongodb.com",
"password": "M0ng0D8!:)",
"emailAddress": "jane.doe@mongodb.com",
"mobileNumber": "2125551234",
"firstName": "Jane",
"lastName": "Doe",
"roles": [
{
"groupId": "8491812938cbda83918c",
"roleName": "GROUP_OWNER"
}
]
}
Working with MMS Whitelists
Name | Type | Description | Example |
---|---|---|---|
count | integer | The total number of requests that originated from this IP address. Note that this field is only updated when a resource that is protected by the whitelist is accessed. | 1 |
created | date-time | The date this IP address was added to the whitelist. | "2012-01-01T12:00:00Z" |
ipAddress | string | A whitelisted IP address. | "12.34.56.78" |
lastUsed | date-time | The date of the most recent request that originated from this IP address. Note that this field is only updated when a resource that is protected by the whitelist is accessed. | "2012-01-01T12:00:00Z" |
Create a new whitelist.
POST /users/{user_id}/whitelist
$ curl -n -X POST https://mms.mongodb.com/api/public/v1.0/users/$USER_ID/whitelist
-H "Content-Type: application/json" \
-d '{"ipAddress":"12.34.56.78","created":"2012-01-01T12:00:00Z","lastUsed":"2012-01-01T12:00:00Z","count":1}'
HTTP/1.1 201 Created
{
"ipAddress": "12.34.56.78",
"created": "2012-01-01T12:00:00Z",
"lastUsed": "2012-01-01T12:00:00Z",
"count": 1
}
Delete an existing whitelist.
DELETE /users/{user_id}/whitelist/{whitelist_id}
$ curl -n -X DELETE https://mms.mongodb.com/api/public/v1.0/users/$USER_ID/whitelist/$WHITELIST_ID
HTTP/1.1 200 OK
{
"ipAddress": "12.34.56.78",
"created": "2012-01-01T12:00:00Z",
"lastUsed": "2012-01-01T12:00:00Z",
"count": 1
}
Info for existing whitelist.
GET /users/{user_id}/whitelist/{whitelist_id}
$ curl -n -X GET https://mms.mongodb.com/api/public/v1.0/users/$USER_ID/whitelist/$WHITELIST_ID
HTTP/1.1 200 OK
{
"ipAddress": "12.34.56.78",
"created": "2012-01-01T12:00:00Z",
"lastUsed": "2012-01-01T12:00:00Z",
"count": 1
}
List existing whitelists.
GET /users/{user_id}/whitelist
$ curl -n -X GET https://mms.mongodb.com/api/public/v1.0/users/$USER_ID/whitelist
HTTP/1.1 200 OK
{
"totalCount": 1,
"results": [
{
"ipAddress": "12.34.56.78",
"created": "2012-01-01T12:00:00Z",
"lastUsed": "2012-01-01T12:00:00Z",
"count": 1
}
]
}