Code Monkey home page Code Monkey logo

slo-up's Introduction

slo-up

standard-readme compliant

Tool for uploading massive data into OpenStack Object Storage

This utility is an example of using the swiftlygo pipeline api to build a data uploader for OpenStack Object Storage.

Table of Contents

Install

go get github.com/ibmjstart/slo-up

Usage

Upload to IBM Bluemix

slo-up makes it easy to upload data into the Object Storage service on Bluemix. Navigate to the Object Storage instanct that you would like to use in the Bluemix web user interface and find the "Service Credentials" for your Object Storage instance. It should look like this:

{
  "auth_url": "https://identity.open.softlayer.com",
  "project": "project_string",
  "projectId": "project_id",
  "region": "dallas",
  "userId": "user_id",
  "username": "user_name",
  "password": "password",
  "domainId": "domain_id",
  "domainName": "domain_name",
  "role": "admin"
}

To upload a local file to a container (called container_name) in this object store with an SLO named object_name, you would invoke slo-up as follows:

slo-up -url https://identity.open.softlayer.com/v3 -user user_name -p password -d domain_name -c container_name -o object_name -f path/to/local/file

Note that we had to append /v3 to the authentication URL.

Authentication Flags

The flags that you need to give slo-up vary with the authentication version of the Object Storage instance that you're trying to upload to. If you don't know the authentication version, the credentials that you are provided with should give you a clue.

slo-up -url <auth-url> -user <username> -p <password> ...upload-flags...

The password is sometimes referred to as an API key. SoftLayer Object Storage uses this Authentication method.

Auth V2

For services supporting Auth V2, you will additionally need to provide a tenant id.

slo-up ...auth-flags... -t <tenant-id> ...upload-flags...

Auth V3

For services supporting Auth V3, you will additionally need to provide a domain id.

slo-up ...auth-flags... -d <domain-name> ...upload-flags...

IBM Bluemix uses this type of authentication.

Upload Flags

The other flags exist to provide upload options:

  • -c <container> The name of the container in object storage into which you are uploading data. The container must already exist.
  • -o <object> The name of the object in object storage into which you are uploading data. Anything in the targeted container with this name will be overwritten.
  • -f <path> The local file that you are uploading.
  • -z size Optionally choose the size of each chunk of your file. Defaults to 10^9 bytes.
  • -e <comma-separated-list> Optional list of chunk numbers to skip reading. Useful if some file sections are unreadable due to hard drive failure.
  • -only-missing Optional flag that causes uploader to only upload chunks that are not already in object storage. This is determined by checking the names of existing file chunks, and can have false positives (though it's unlikely unless you follow the slo-up file chunk naming convention).
  • -memprof Enables memory profiling for the upload. Useful mainly for debugging.
  • -no-color Optionally turns off the fancy colorized output and disables ANSI redrawing.
  • -help Prints usage info and exits.

Contribute

PRs accepted.

Small note: If editing the README, please conform to the standard-readme specification.

License

Apache 2.0 © IBM jStart

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.