bluemix-object-storage

2.0.1 • Public • Published

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

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

Package Sidebar

Install

npm i bluemix-object-storage

Weekly Downloads

6

Version

2.0.1

License

MIT

Last publish

Collaborators

  • chyld