Small library to manage safely starting and stopping CloudSigma virtual servers
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
LICENSE
README.md
config.sample.js
cs
cs-server.js
cs.bash_completion
mock-handlers.js
package.json

README.md

cs-server

Small Node.js library to manage CloudSigma virtual servers.

The following operations are supported:

  • Start
  • Shutdown
  • Hard stop
  • Update CPU and MEM based on configured 'profiles'
  • Get basic server status information (status, CPU, MEM)
  • Run commands on groups of servers via custom configured groups
  • Operate on servers in different datacenters

Both a CLI executable and a Node.js library are provided.

Installation

git clone https://github.com/stirlab/cs-server.git
cd cs-server
npm install
cp config.sample.js config.js

Edit config.js to taste.

See config.sample.js for a fully commented explanation of the various configuration options.

Usage

CLI

For commands on individual (or groups of configured) servers.

Run cs without arguments for script usage.

The CLI executable supports configuring 'groups' in the config file which allow commands to be run on multiple servers at once.

As a node module.

var CsServer = require('./cs-server');
var config = require('./config');
var cs = new CsServer(config.cs, config.ssh);

// Server labels are the keys as defined in config.js, 'servers' object.
var serverName = 'serverLabelOne';
var cb = function(err, data) {
  if (err) {
    console.log(format("ERROR: %s, %s", err, data));
  }
  console.log(data);
}
cs.getServer(serverName, cb);

See cs-server.js for all currently supported methods, and cs for more usage examples.

Shell completion

The provided cs.bash_completion can be used to enable shell completion for BASH.

Support

The issue tracker for this project is provided to file bug reports, feature requests, and project tasks -- support requests are not accepted via the issue tracker. For all support-related issues, including configuration, usage, and training, consider hiring a competent consultant.