Navigation
This version of the documentation is archived and no longer supported. To learn how to upgrade your version of MongoDB Ops Manager, refer to the upgrade documentation.
You were redirected from a different version of the documentation. Click here to go back.

Whitelist

The resource modification operations POST and DELETE are whitelisted. For example, you can only add an IP address to a whitelist if the request originates from an IP address on the existing whitelist.

Operations

  • GET /api/public/v1.0/users/USER-ID/whitelist - Gets the whitelist for the specified user. You can only access your own whitelist, so the USER-ID in the URL must match the ID of the user associated with the API Key.
  • GET /api/public/v1.0/users/USER-ID/whitelist/IP-ADDRESS - Gets the whitelist entry for a single IP address.
  • POST /api/public/v1.0/users/USER-ID/whitelist - Add one or more IP addresses to the user’s whitelist.
    • The entity body must be an array of whitelist entities, even if there is only one. The only field you need to specify for each entity is the ipAddress.
    • If an IP address is already in the whitelist, it will be ignored.
  • DELETE /api/public/v1.0/users/USER-ID/whitelist/IP-ADDRESS - Remove an IP address from the whitelist.
    • You cannot remove your current IP address from the whitelist.

Sample Entity

{
  "ipAddress": "1.2.3.4",
  "created": "2014-01-02T12:34:56Z",
  "lastUsed": "2014-03-12T02:03:04Z",
  "count": 1234
}

Entity Fields

Name Type Description
ipAddress string A whitelisted IP address.
created date The date this IP address was added to the whitelist.
lastUsed date 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.
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.

Examples

Get a User’s Whitelist

curl -i -u "username:apiKey" --digest "https://mms.mongodb.com/api/public/v1.0/users/5356823b3004dee37132bb7b/whitelist"

HTTP/1.1 200 OK

{
  "totalCount" : 1,
  "results" : [ {
    "ipAddress" : "12.34.56.78",
    "created" : "2014-04-23T16:17:44Z",
    "count" : 482,
    "links" : [ ... ]
  } ],
  "links" : [ ... ]
}

Get a Single Whitelist Entry

curl -i -u "username:apiKey" --digest "https://mms.mongodb.com/api/public/v1.0/users/5356823b3004dee37132bb7b/whitelist/12.34.56.78"

HTTP/1.1 200 OK

{
  "ipAddress" : "12.34.56.78",
  "created" : "2014-04-23T16:17:44Z",
  "count" : 482,
  "links" : [ ... ]
}

Add Entries to a User’s Whitelist

curl -i -u "username:apiKey" -H "Content-Type: application/json" --digest -X POST "https://mms.mongodb.com/api/public/v1.0/users/5356823b3004dee37132bb7b/whitelist" --data '
[ {
    "ipAddress" : "76.54.32.10"
  }, {
    "ipAddress" : "2.3.4.5"
} ]'

HTTP/1.1 201 Created
Location: https://mms.mongodb.com/api/public/v1.0/users/5356823b3004dee37132bb7b/whitelist

{
  "totalCount" : 3,
  "results" : [ {
    "ipAddress" : "12.34.56.78",
    "created" : "2014-04-23T16:17:44Z",
    "count" : 0,
    "links" : [ ... ]
  }, {
    "ipAddress" : "76.54.32.10",
    "created" : "2014-04-23T16:23:44Z",
    "count" : 0,
    "links" : [ ... ]
  }, {
    "ipAddress" : "2.3.4.5",
    "created" : "2014-04-23T16:23:44Z",
    "count" : 0,
    "links" : [ ... ]
  } ],
  "links" : [ ... ]
}

Delete an Entry from a User’s Whitelist

curl -i -u "username:apiKey" --digest -X DELETE "https://mms.mongodb.com/api/public/v1.0/users/5356823b3004dee37132bb7b/whitelist/2.3.4.5"

HTTP/1.1 200 OK