Skip to content

Instantly share code, notes, and snippets.

@christophermina
Created October 4, 2014 08:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christophermina/9a92a48e9033b67c38ba to your computer and use it in GitHub Desktop.
Save christophermina/9a92a48e9033b67c38ba to your computer and use it in GitHub Desktop.
_getClient: function() {
return pkgcloud.storage.createClient({
provider: 'openstack',
username: slConfigs.SL_STORAGE_USERNAME,
password: slConfigs.SL_STORAGE_PASS,
authUrl: slConfigs.SL_STORAGE_AUTH_URL,
version: 1,
useServiceCatalog: false
});
}
streamToSoftlayer: function (stream, container, resourceKey, fn) {
var client = _getClient();
stream.pipe(client.upload({
container: container,
remote: resourceKey
}, function(err, value) {
return fn(err, value);
}));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment