The Ruby Plugin for Sakura Cloud Object Storage access.
- Not Amazon S3 compartible, writing for only Sakura Cloud Object storage.
- Support the following functions.
- get object list. (GET /)
- get an object. (GET with object_name)
- put an object. (PUT)
- delete an object. (DELETE)
- get only an object-information. (HEAD, get only ETag and LastModified.)
- NOT support the following function.
- multipart uploading for large object (over 4GiB) ... It is need?? ( I don't need, maybe. )
- Create a bucket on your Sakura Cloud Object storage.
- Keep API-Key and API-Secret-Key.
require 'sakura_object_storage'
instance = SakuraObjectStorage::Storage.new( bucket_name, api_key, api_secret_key )
# Create an object.
body = 'object contents.'
instance.put_object('object name', body, body.size)
# Get list
list = instance.get_object_list()[:contents]
# Get an object
obj = instance.get_object('object name')
# Get an information of object
info = instance.get_object_info('object name')
etag = info['etag']
last_modified = info['last-modified']
# Delete an object
instance.delete_object('object name')
Add this line to your application's Gemfile:
gem 'sakura_object_storage', git: 'https://github.com/kmamiya/sakura_object_storage_ruby.git'
And then execute:
$ bundle
http://logicalrabbit.jp/sakura-object-storage
The gem is available as open source under the terms of the MIT License.