Skip to content
OpenStack Object Storage(Swift) REST client API for Node.JS
JavaScript
Latest commit 600343a Aug 2, 2013 @firejune add syntax highlight
Failed to load latest commit information.
lib remove some files Jan 26, 2012
README.md add syntax highlight Aug 2, 2013
index.js first commit Oct 19, 2011
package.json fix error handler Jan 26, 2012

README.md

Swift

OpenStack Object Storage(Swift) REST client API for Node.JS

Installing

GIT

$ git clone git://github.com/firejune/swift.git

NPM

$ npm install swift

Code

    var Swift = require('swift');

    var swift = new Swift({
        user: 'auth-user'
      , pass: 'auth-key'
      , host: 'auth.api.yourcloud.com'
      , port: 443
    }, function(err, res) {
      if (swift.account && swift.token)
        // success
      else
        // error
    });

    // Authentication
    swift.listContainers(handlerFunction);
    swift.retrieveAccountMetadata(handlerFunction);

    // Storage Services
    swift.listObjects(containerName, handlerFunction);
    swift.createContainer(containerName, handlerFunction);
    swift.deleteContainer(containerName, handlerFunction);
    swift.retrieveContainerMetadata(containerName, handlerFunction);

    // Object Services
    swift.retrieveObject(containerName, objectName, handlerFunction);
    swift.createObject(containerName, objectName, handlerFunction, requestObject);
    swift.updateObject(containerName, objectName, handlerFunction, requestObject);
    swift.copyObject(containerName, destObject, fromContainer, sourceObject, handlerFunction);
    swift.deleteObject(containerName, objectName, handlerFunction);
    swift.retrieveObjectMetadata(containerName, objectName, handlerFunction);
    swift.updateObjectMetadata(containerName, objectName, handlerFunction);

    // Get Object Binary
    swift.getFile(containerName, objectName, responseObject);

License

MIT <3

Something went wrong with that request. Please try again.