Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
pkgcloud is a standard library for node.js that abstracts away differences among multiple cloud providers.
JavaScript

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples
lib
test
.gitignore
LICENSE
README.md
package.json

README.md

pkgcloud

pkgcloud is a standard library for node.js that abstracts away differences among multiple cloud providers.

Unified Vocabulary

When considering all IaaS providers as a whole their vocabulary is somewhat disjoint. pkgcloud attempts to overcome this through a unified vocabulary. Note that all Database providers use the same vocabulary: database.

Compute

pkgcloud OpenStack Joyent Amazon
Server Server Machine Instance
Image Image Dataset AMI
Flavor Flavor Package InstanceType

Storage

pkgcloud OpenStack Amazon
Container Container Bucket
File StorageObject Object

Services

Currently there are several service types which are handled by pkgcloud:

Compute

Creating Compute Clients

The options to be passed to the pkgcloud.compute.Client object should be:

Rackspace

  var rackspace = pkgcloud.compute.createClient({
    provider: 'rackspace',
    username: 'nodejitsu',
    apiKey: 'foobar'
  });

Amazon

  var amazon = pkgcloud.compute.createClient({
    provider: 'amazon',
    accessKey: 'asdfkjas;dkj43498aj3n',
    accessKeyId: '98kja34lkj'
  });

Joyent

  var path = require('path'),
      fs   = require('fs');

  //
  // Joyent requires a username / password or key / keyId combo.
  // key/keyId should be registered in Joyent servers.
  // check `test/helpers/index.js` for details on key/keyId works.
  //
  var joyent = pkgcloud.compute.createClient({
    provider: 'joyent',
    account: 'nodejitsu'
    keyId: '/nodejitsu1/keys/dscape',
    key: fs.readFileSync(path.join(process.env.HOME, '.ssh/id_rsa'), 'ascii')
  });

Server

  • client.getServers(function (err, servers) { })
  • client.createServer(options, function (err, server) { })
  • client.destroyServer(serverId, function (err, server) { })
  • client.getServer(serverId, function (err, server) { })
  • client.rebootServer(server, function (err, server) { })

Image

  • client.getImages(function (err, images) { })
  • client.getImage(imageId, function (err, image) { })
  • client.destroyImage(image, function (err, ok) { })
  • client.createImage(options, function (err, image) { })

Flavor

  • client.getFlavors(function (err, flavors) { })
  • client.getFlavor(flavorId, function (err, flavor) { })

Storage

Creating Storage Clients

The options to be passed to the pkgcloud.storage.Client object should be:

Rackspace

  {
    provider: 'rackspace', // 'cloudservers'
    username: 'nodejitsu',
    apiKey: 'foobar'
  }

AWS

  {
    provider: 'amazon', // 'aws', 's3'
    accessKey: 'asdfkjas;dkj43498aj3n',
    accessKeyId: '98kja34lkj'
  }
  • pkgcloud.storage.create(options, callback)
  • new pkgcloud.storage.Client(options, callback)

Roadmap

  1. Add support for additional IaaS providers (Azure, etc)
  2. Backport latest fixes from node-cloudfiles and node-cloudservers

Author: Nodejitsu

License: MIT

Something went wrong with that request. Please try again.