mlab-buddy
v1.0.5
Published
Node integration with mLabs new API
Downloads
10
Maintainers
Readme
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
- Fork it (https://github.com/MarkWaldron/mlab-buddy/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request