https://objectstore-r1nd1001.cnode.jp/v1/b7daff98c2b748dfa6cb8240c8ac7c33/kksg/bg_main-visual.png
OpenStack Swift Client for ConoHa オブジェクトストレージ
require 'cono_storage'
client = ConoStorage.new(
# via. https://identity.tyo1.conoha.io/
auth_url: 'https://identity.tyo1.conoha.io/v2.0/',
tenant_id: 'b7daff9xxxxxxxxxxxxxxxxx',
username: 1111111,
password: '^passw0rd$',
endpoint: 'https://objectstore-r1nd1001.cnode.jp/v1/b7daff9xxxxxxxxxxxxxxxxx',
web_mode: true # Web公開モード
)
client.put_container('awsome_gifs')# => ConoStorage::Response
client.put_object('awsome_gifs', 'nyan.gif', '/local/path/to/nyan.gif').url #=> "https://objectstore-...cnode.jp/.../awsome_gifs/nyan.gif"
client.put_object('awsome_gifs', 'wan.gif', '/local/path/to/wan.gif', headers: { 'X-Delete-At' => "1170774000" } ) # Custom Headers
client.get_object('awsome_gifs', 'nyan.gif')
client.delete_object('awsome_gifs', 'nyan.gif')
client.delete_container('awsome_gifs').status #=> 204
Ruby 2.1.0 or later
Add this line to your application's Gemfile:
gem 'cono_storage'
And then execute:
$ bundle
Or install it yourself as:
$ gem install cono_storage
- Fork it ( https://github.com/kkosuge/cono_storage/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request