Git Product home page Git Product logo

digitalocean-api's Introduction

digitalocean-api

The digitalocean-api is a module that allows you to communicate with the DigitalOcean API from node.js

Installation

This module is published in NPM:

npm install digitalocean-api --save

The --save tells NPM to automatically add it to your package.json file

Usage

// Import a module
var DigitalOceanAPI = require('digitalocean-api');
// Create an instance with your API credentials
var api = new DigitalOceanAPI('client_id', 'api_key');

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

Methods

All methods follow the official API documentation.

Convention for callback arguments: callback(error, data)

Droplets

dropletGetAll(callback)
dropletGet(id, callback)
dropletNew(name, sizeId, imageId, regionId, sshKeyIds, callback)
dropletRebootHard(id, callback)
dropletPowerCycle(id, callback)
dropletShutdown(id, callback)
dropletPowerOff(id, callback)
dropletPowerOn(id, callback)
dropletResetRootPassword(id, callback)
dropletResize(id, sizeId, callback)
dropletSnapshot(id, name, callback)
dropletRestore(id, imageId, callback)
dropletRebuild(id, imageId, callback)
dropletBackupEnable(id, callback)
dropletBackupDisable(id, callback)
dropletDestroy(id, callback)

Sizes

sizeGetAll(callback)

Images

imageGetAll(callback)
imageGetGlobal(callback)
imageGetMine(callback)
imageGet(id, callback)
imageDestroy(id, callback)

SSH keys

sshKeyGetAll(callback)
sshKeyGet(id, callback)
sshKeyAdd(name, pubKey, callback)
sshKeyEdit(id, pubKey, callback)
sshKeyDestroy(id, callback)

Regions

regionGetAll(callback)

digitalocean-api's People

Contributors

enzy avatar ericvicenti avatar manuelstofer avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.