0.2.10 • Published 12 years ago

cloudservers v0.2.10

Weekly downloads
34
License
-
Repository
github
Last release
12 years ago

node-cloudservers

A client implementation for Rackspace CloudServers in node.js

Installation

Installing npm (node package manager)

Installing cloudservers

Getting Rackspace Account

Usage

http://blog.nodejitsu.com/nodejs-cloud-server-in-three-minutes

The node-cloudservers library is compliant with the Rackspace CloudServers API. Using node-cloudservers is easy for a variety of scenarios: authenticating, getting flavors and images, creating servers, and working with servers.

Getting Started

Before we can do anything with cloudfiles, we have to create a client with valid credentials. Cloudservers will authenticate for you automatically:

Getting Flavors and Images

There are several entities in the Rackspace CloudServer ecosystem: images, flavors, and servers. Both the getFlavors and getImages methods take an optional first parameter which when set to true will return more details for the objects returned. Here's how to get the list of all available flavors and images associated with your Rackspace account:

Create Server

If you manually create servers yourself via the Rackspace CloudServer management console, you can skip this section. For dynamically load balanced applications like nodejitsu, creating servers on-the-fly is important. To create a server, you will need the id of the image and flavor of the server. You can also pass an instance of a node-cloudservers Flavor or Image.

Setting a 'personality' for a Server

Rackspace CloudServers exposes an API that allows you to include an arbitrary number of files less than 10kb on a new server. Each file must be Base64 encoded. To use this functionality in node-cloudservers just include the path and contents of each file when creating a server:

Waiting for Servers to Become 'Active'

Once you've created a server, you can't work with it until it has become active. The node-cloudservers library is designed to allow you to wait for a server to meet a set of criteria:

Working with Servers

If you have already created a some Rackspace CloudServer instances it is easy to get them from your account with node-cloudservers with the getServers method. This method takes an optional first parameter that when set to true will return all details for the servers:

Once you're working with servers that are already active there are several operations that you can perform on it:

destroy

The 'destroy' method will delete a server from your Rackspace CloudServer account.

disableBackup

The 'disableBackup' method will disable the backup schedule for the Server.

getAddresses

The 'getAddresses' method takes a callback which has the set of the valid IP addresses for the Server as a parameter. This method takes an optional first parameter with a value of 'public' or 'private', which will force only the public or private IP addresses to be returned respectively.

getBackup

The 'getBackup' method will get the backup schedule for the Server.

getDetails

The 'getDetails' method will get the server with all details.

updateBackup

The 'updateBackup' method will update the backup schedule of the server on which it is called.

Roadmap

  1. Get Server resize operations working: confirmResize, resize, revertResize.
  2. Get miscellaneous Server operations working: rebuild.
  3. Get the core 'createImage' operation working.

Run Tests

All of the node-cloudservers tests are written in vows, and cover all of the use cases described above. You will need to add your Rackspace API username and API key to test/data/test-config.json before running tests:

Once you have valid Rackspace credentials you can run tests with vows:

Running Personality tests

One common usage of the personality features in Rackspace CloudServers is to upload your own SSH keys for communicating with your new server. To run these tests you will need to generate a test key locally.

Author: Charlie Robbins

Contributors: Elijah Insua Matthew Bergman

0.2.10

12 years ago

0.2.8

12 years ago

0.2.7

13 years ago

0.2.6

13 years ago

0.2.5

13 years ago

0.2.4

13 years ago

0.2.3

13 years ago

0.2.2

13 years ago

0.2.1

13 years ago

0.2.0

13 years ago

0.1.4

13 years ago

0.1.3

13 years ago

0.1.2

13 years ago

0.1.1

13 years ago

0.1.0

13 years ago