Skip to content
SoftLayer Object Storage Ruby Client
Ruby
Find file
Latest commit 2e0c135 Aug 17, 2015 @briancline briancline Merge pull request #7 from cmc476/update_readme
Updated readme for installation procedures and complete example.
Failed to load latest commit information.
lib Adds endpoints for Paris and Melbourne clusters Nov 22, 2014
spec added readme and tests for search Feb 14, 2012
.gitignore Initial Import Feb 13, 2012
CONTRIBUTORS
COPYING Initial Import Feb 13, 2012
Gemfile added readme and tests for search Feb 14, 2012
README.markdown
softlayer-object-storage.gemspec

README.markdown

SoftLayer Object Storage Ruby Client

Ruby bindings for SoftLayer Object Storage

Installation from Source

git clone https://github.com/softlayer/softlayer-object-storage-ruby.git cd softlayer-object-storage gem build softlayer-object-storage.gemspec gem install softlayer-object-storage

Basic Usage

require 'softlayer/object_storage'
sl_storage = SoftLayer::ObjectStorage::Connection.new({
    :username => "YOUR_USERNAME", 
    :api_key => "YOUR_API_KEY", 
    :datacenter => :dal05
})

sl_storage.containers
# ["foo"]

sl_storage.create_container("bar")

sl_storage.containers
# ["foo", "bar"]

container = sl_storage.container("foo")
container.objects
# []

container.create_object("baz")

container.objects
# ["foo"]

object = container.object("foo")

Search Usage

results = sl_storage.search(:q => "bar")

puts results[:count]
# 1

puts results[:items][0].inspect
# {:type => "container", :name => "bar"...}

For complete usage examples, see the specs.

Something went wrong with that request. Please try again.