mlab-buddy

1.0.5 • Public • Published

mLab Buddy

NPM Version Downloads Stats Code Climate Issues npm

mLab Buddy

mLab Buddy is a node module used for integrating with mLabs new API (Still in BETA and subject to change)

mLab is currently building a new API for creating and managing your mLab account and creating new deployments. This is very different from their existing Data API which allows you to interact with the actual MongoDB's.

Installation

OS X & Linux:

npm install mlab-buddy --save

Usage example

All methods return a promise with the result of the call. If you're unfamiliar with promises, you call .then to get the result, and .catch to handle errors.

Me

const mLabBuddy = require('mlab-buddy');
 
let options = {
  accessKey: 'INSERT_ACCESS_KEY_HERE',
  accessKeySecret: 'INSERT_ACCESS_KEY_SECRET_HERE',
  timeout: 10000
};
 
mLabBuddy.me.getMe(options)

Accounts

const mLabBuddy = require('mlab-buddy');
 
let options = {
  accessKey: 'INSERT_ACCESS_KEY_HERE',
  accessKeySecret: 'INSERT_ACCESS_KEY_SECRET_HERE',
  accountId: 'INSERT_ACCOUNTID_HERE',
  timeout: 10000,
};
 
mLabBuddy.accounts.getAccount(options)
mLabBuddy.accounts.getCharges(options)
mLabBuddy.accounts.getInvoices(options)
mLabBuddy.accounts.getInvoice(options) //requires options.invoiceId to be set with a valid invoice id
mLabBuddy.accounts.getMaintenanceEvents(options)
 

For more examples and usage, please refer to the Wiki.

Meta

Mark Waldron – @MarkWaldron

Distributed under the MIT license. See MIT for more information.

https://github.com/MarkWaldron/mlab-buddy

Contributing

  1. Fork it (https://github.com/MarkWaldron/mlab-buddy/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

Package Sidebar

Install

npm i mlab-buddy

Weekly Downloads

6

Version

1.0.5

License

MIT

Unpacked Size

18 kB

Total Files

15

Last publish

Collaborators

  • markwaldron