Permalink
Browse files

First commit of rackspace-openstack

  • Loading branch information...
0 parents commit 19eb2322ed778947d84c94eb1faa731dd4ec54bc Ken Perkins committed Dec 13, 2012
Showing with 1,379 additions and 0 deletions.
  1. +4 −0 .gitignore
  2. +13 −0 Makefile
  3. +53 −0 README.md
  4. +22 −0 lib/openstack.js
  5. +502 −0 lib/openstack/core.js
  6. +52 −0 lib/openstack/flavor.js
  7. +108 −0 lib/openstack/image.js
  8. +408 −0 lib/openstack/server.js
  9. +33 −0 package.json
  10. +48 −0 test/authenticate-tests.js
  11. +44 −0 test/flavors-tests.js
  12. +44 −0 test/images-tests.js
  13. +48 −0 test/servers-tests.js
@@ -0,0 +1,4 @@
+node_modules/
+.testing/
+config.json
+test/manual.js
@@ -0,0 +1,13 @@
+MOCHA_OPTS=-t 120000 test/*-tests.js
+REPORTER = spec
+
+check: test
+
+test: test-unit
+
+test-unit:
+ @NODE_ENV=test ./node_modules/.bin/mocha \
+ --reporter $(REPORTER) \
+ $(MOCHA_OPTS)
+
+.PHONY: test
@@ -0,0 +1,53 @@
+# rackspace-openstack
+
+A client implementation for the Rackspace Openstack API (v2)
+
+## Usage
+
+The rackspace-openstack module is compliant with the [Rackspace Openstack API][0]. rackspace-openstack
+is a nearly feature complete wrapper for the Rackspace Openstack APIs and should work in most scenarios.
+
+### Getting Started
+Creating and authenticating your client against the Rackspace API is simple:
+
+```Javascript
+var openstack = require('openstack'),
+ config = {
+ auth : {
+ username: 'your-username',
+ apiKey: 'your-api-key'
+ }
+};
+
+var client = openstack.createClient(config);
+
+client.authorize(function(err) {
+ if (err) {
+ process.exit(1);
+ return;
+ }
+
+ // Do stuff here
+}
+```
+
+### Creating a Server
+```Javascript
+client.createServer({
+ image: '5cebb13a-f783-4f8c-8058-c4182c724ccd',
+ flavor: 2,
+ name: 'My Server'
+}, function(err, server) {
+
+ // Do stuff with your new server
+
+});
+
+```
+
+## Run Tests
+All rackspace-openstack tests are available by running `make test`
+
+#### Author: [Ken Perkins](http://github.com/kenperkins)
+
+[0]: http://docs.rackspace.com/servers/api/v2/cs-devguide/content/ch_preface.html
@@ -0,0 +1,22 @@
+/*
+ * openstack.js: Wrapper for rackspace-openstack object
+ *
+ * (C) 2012 Clipboard, Inc.
+ * Inspired by node-cloudservers from Nodejitsu
+ * MIT LICENSE
+ *
+ */
+
+var openstack = exports;
+
+// Expose version through `pkginfo`.
+require('pkginfo')(module, 'version');
+
+// Core functionality
+openstack.createClient = require('./openstack/core').createClient;
+
+// Type Definitions
+openstack.Client = require('./openstack/core').Client;
+openstack.Server = require('./openstack/server').Server;
+openstack.Flavor = require('./openstack/flavor').Flavor;
+openstack.Image = require('./openstack/image').Image;
Oops, something went wrong.

0 comments on commit 19eb232

Please sign in to comment.