Skip to content

kkosuge/cono_storage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ConoStorage

https://objectstore-r1nd1001.cnode.jp/v1/b7daff98c2b748dfa6cb8240c8ac7c33/kksg/bg_main-visual.png
OpenStack Swift Client for ConoHa オブジェクトストレージ

Usage

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

Documentation

Requirements

Ruby 2.1.0 or later

Installation

Add this line to your application's Gemfile:

gem 'cono_storage'

And then execute:

$ bundle

Or install it yourself as:

$ gem install cono_storage

Contributing

  1. Fork it ( https://github.com/kkosuge/cono_storage/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

About

ConoHa オブジェクトストレージ用 Ruby クライアント http://blog.kksg.net/posts/conoha-object-storage

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages