GithubHelp home page GithubHelp logo

bluemix-object-storage's Introduction

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

bluemix-object-storage's People

Contributors

chyld avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

csaroff alanbraz

bluemix-object-storage's Issues

How to mock Ibm bluemix object storage URl locally using Nodejs

0
down vote
favorite

I am using Nock for mocking all the URl in my microservices using nodejs technology. I am using IBM bluemix ObjectStorage for deleting and creating object in cloud object storage. I Using IBM-COS-SDK npm module for configuring apiKey,endpoints and using var cos = new AWS.s3(config); for initilizing the apikey and endpoints.

I am unable to mock the object storage URL.

Please let me know if anybody has faced the same issue and resolved

Looks like token is always null

having this issue: Unhandled rejection TypeError: body.map is not a function

added some log messages to debug and every request is having:

"headers": {
        "x-auth-token": null,
        "accept": "application/json",
        "content-length": 0
      }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.