API for MeteorJS

A MeteorJS Package for version 2 of DigitalOcean's API

Meteor-DigitalOcean

Build Status

The Package allows you to communicate with the DigitalOcean API V2 from MeteorJS in a promise friendly manner. It also supports automatic request retries.

This Package based on icodeforlove's NodeJS wrapper, And the documentation here is based on his README.md.

DigitalOcean

Easily deploy an SSD cloud server on DigitalOcean in 55 seconds. Sign up using my link and receive $10 in credit.

Installation

This module is published in AtmosphereJS:

meteor add dyaa:digitalocean

Usage

// Import a module
var api = new Digitalocean({token:'my_token'});

// Get things done
api.dropletGetAll().then(function (droplets) {
    console.log(droplets);
});

Config

new Digitalocean({
    token: 'my_token',
    itemsPerPage: 100, // default=100
    maxRetries: 5, // default=5
    raw: false // default=false
});

Pagination

you can pass pagination params into any method that has a body or query argument.

api.dropletGetAll({per_page: 1, page: 2}).then(function (droplets) {
    console.log(droplets);
});

Raw

if you set raw it will return the full response body with request info and ratelimiting details, the default is false.

api.accountGet(true)

would return

    {
        account: {
            droplet_limit: 25,
            email: 'email@domain.com',
            uuid: 'f5bbaffce3a8792421593a7075b486bafd66672f',
            email_verified: true
        },
        ratelimit: {
            limit: '5000',
            remaining: '4993',
            reset: '1434197547'
        },
        requestinfo: {
            id: 'a24427fd-0d43-9536-a206-zac22d2696e1',
            runtime: '0.038537'
         }
    }

and with raw set to false (the default), it would return

    {
        droplet_limit: 25,
        email: 'email@domain.com',
        uuid: 'f5bbaffce3a8792421593a7075b486bafd66672f',
        email_verified: true
    }

Methods

All methods follow the official API documentation.

Droplets

Account

Regions

Images

SSH keys

Sizes

Domains

Actions

Floating IPs

License

Copyright (c) 2015 Dyaa Eldin Moustafa Licensed under the MIT license.

by: Dyaa Eldin November 17, 2015

0 Comments