mongolab-partner

MongoLab Partner API wrapper

npm install mongolab-partner
6 downloads in the last week
12 downloads in the last month

mongolab-partner

MongoLab Partner API wrapper & CLI interface.

Installation

npm install mongolab-partner

API Usage


var mongolab = require('mongolab-partner')({username: "my-username", password: "super secret"})

mongolab.viewPartner(function(err, res) {
  if (err) return console.log(err)
  console.log(res)
})

API

The module should be initialized with an options object:

{username: ..., password: ...}

It will return an object which implements the following API calls:

viewPartner(cb)

viewAccounts(cb)

createAccount({accountName: ..., adminUser: ..., adminEmail: ...}, cb)

createDatabase({databaseName: ..., databaseUser: ..., databasePassword: ..., plan: ..., cloud: ..., accountName: ...}, cb)

listDatabases(accountName, cb)

viewDatabase(accountName, cb)

deleteDatabase(accountName, databaseName, cb)

CLI

mongolab-partner <command> [options]

Commands map to API calls. The following are available:

  • viewPartner
  • viewAccounts
  • createAccount
  • createDatabase
  • listDatabases
  • viewDatabase
  • deleteDatabase

Create database example:

mongolab-partner createDatabase \
  -u <username>  \
  -p <password>  \
  --accountName <account name> \
  --databaseUsername <database username> \
  --databasePassword <database password> \
  --databaseName <database name>`

View database example:

mongolab-partner viewDatabase \
  -u <username> \
  -p <password> \
  --accountName <account name>\
  --databaseName <database name>

List databases:

mongolab-partner listDatabases -u <username> -p <password> --accountName <account name>

npm loves you