Created
September 23, 2011 05:42
-
-
Save levicook/1236822 to your computer and use it in GitHub Desktop.
learning fog storage on Rackspace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> Storage[:rackspace].directories.new | |
<Fog::Storage::Rackspace::Directory | |
key=nil, | |
bytes=nil, | |
count=nil, | |
cdn_cname=nil | |
> | |
>> d = _ | |
<Fog::Storage::Rackspace::Directory | |
key=nil, | |
bytes=nil, | |
count=nil, | |
cdn_cname=nil | |
> | |
>> d.key = 'console-testing' | |
"console-testing" | |
>> d.save | |
true | |
>> Storage[:rackspace].directories | |
<Fog::Storage::Rackspace::Directories | |
[ | |
<Fog::Storage::Rackspace::Directory | |
key="cloudservers", | |
bytes=24314401781, | |
count=35, | |
cdn_cname=nil | |
>, | |
<Fog::Storage::Rackspace::Directory | |
key="console-testing", | |
bytes=0, | |
count=0, | |
cdn_cname=nil | |
>, | |
<Fog::Storage::Rackspace::Directory | |
key="public", | |
bytes=12877617, | |
count=404, | |
cdn_cname=nil | |
> | |
] | |
> | |
>> Storage[:rackspace].directories.get('console-testing') | |
<Fog::Storage::Rackspace::Directory | |
key="console-testing", | |
bytes="0", | |
count="0", | |
cdn_cname=nil | |
> | |
>> d = Storage[:rackspace].directories.get('console-testing') | |
<Fog::Storage::Rackspace::Directory | |
key="console-testing", | |
bytes="0", | |
count="0", | |
cdn_cname=nil | |
> | |
>> d.public_url | |
nil | |
>> d.public = true | |
true | |
>> d.save | |
true | |
>> d = Storage[:rackspace].directories.get('console-testing') | |
<Fog::Storage::Rackspace::Directory | |
key="console-testing", | |
bytes="0", | |
count="0", | |
cdn_cname=nil | |
> | |
>> d.public = true | |
true | |
>> d.public_url | |
"http://c754760.r60.cf2.rackcdn.com" | |
>> d.files | |
<Fog::Storage::Rackspace::Files | |
directory= <Fog::Storage::Rackspace::Directory | |
key="console-testing", | |
bytes="0", | |
count="0", | |
cdn_cname=nil | |
>, | |
limit=nil, | |
marker=nil, | |
path=nil, | |
prefix=nil | |
[] | |
> | |
>> f = d.files.new | |
<Fog::Storage::Rackspace::File | |
key=nil, | |
content_length=nil, | |
content_type=nil, | |
etag=nil, | |
last_modified=nil | |
> | |
>> f.key = 'deleteme' | |
"deleteme" | |
>> f.public = true | |
true | |
>> f.body = 'hello world!' | |
"hello world!" | |
>> f.save | |
true | |
>> d.files | |
<Fog::Storage::Rackspace::Files | |
directory= <Fog::Storage::Rackspace::Directory | |
key="console-testing", | |
bytes="0", | |
count="0", | |
cdn_cname=nil | |
>, | |
limit=nil, | |
marker=nil, | |
path=nil, | |
prefix=nil | |
[] | |
> | |
>> d = Storage[:rackspace].directories.get('console-testing') | |
<Fog::Storage::Rackspace::Directory | |
key="console-testing", | |
bytes="12", | |
count="1", | |
cdn_cname=nil | |
> | |
>> d.files | |
<Fog::Storage::Rackspace::Files | |
directory= <Fog::Storage::Rackspace::Directory | |
key="console-testing", | |
bytes="12", | |
count="1", | |
cdn_cname=nil | |
>, | |
limit=nil, | |
marker=nil, | |
path=nil, | |
prefix=nil | |
[ | |
<Fog::Storage::Rackspace::File | |
key="deleteme", | |
content_length=12, | |
content_type="application/json", | |
etag="fc3ff98e8c6a0d3087d515c0473f8677", | |
last_modified=2011-09-23 05:39:54 -0600 | |
> | |
] | |
> | |
>> d.files.get('deleteme') | |
<Fog::Storage::Rackspace::File | |
key="deleteme", | |
content_length=12, | |
content_type="application/json", | |
etag="fc3ff98e8c6a0d3087d515c0473f8677", | |
last_modified=2011-09-22 23:39:54 -0600 | |
> | |
>> d.files.get('deleteme').public_url | |
"http://c754760.r60.cf2.rackcdn.com/deleteme" | |
>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment