bluemix-object-storage

Easily manages the accounts, containers, and objects for the IBM Bluemix Object Storage service.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
bluemix-object-storage
2.0.16 years ago6 years agoMinified + gzip package size for bluemix-object-storage in KB

Readme

bluemix-object-storage
Bluemix Object Storage
NPM
Build Status npm GitHub OpenStack Bluemix

Description

Easily manage the accounts, containers, and objects for the IBM Bluemix Object Storage service.

Install

$ npm install bluemix-object-storage --save

Usage

var ObjectStorage = require('bluemix-object-storage');
var os = new ObjectStorage('user_id', 'password', 'project_id', 'container_name', 'access_point_url');

os.createContainer()
.then(function(){
  return os.setContainerPublicReadable();
})
.then(function(){
  return os.uploadFileToContainer('fido.jpg', 'image/jpeg', buffer, 49057);
})
.then(function(file){
  console.log('url to uploaded file:', file);
  return os.listContainerFiles();
})
.then(function(files){
  console.log('list of files in container:', files);
});

Access Points

  • https://dal.objectstorage.open.softlayer.com
  • https://lon.objectstorage.open.softlayer.com

API

Constructor(userId, password, projectId, containerName, accessPointUrl)
createContainer()
listContainerFiles()
setContainerPublicReadable()
uploadFileToContainer(filename, mimetype, buffer, filesize)

Test

$ git clone https://github.com/chyld/bluemix-object-storage
$ cd bluemix-object-storage
$ npm install
$ npm test

License

MIT © Chyld Medford