Sample Ruby Application for Cloud Files


Sample Ruby Application

From Connection to Objects

#!/usr/bin/env ruby
require 'rubygems'
require 'cloudfiles'
# Log into the Cloud Files system
cf = CloudFiles::Connection.new('UsernameGoesHere','APIKeyGoesHere')                   
#Create a Container
container = cf.create_container('ContainerNameGoesHere')
#Create an Object
object = container.create_object('ObjectNameGoesHere')
# Write Data to an Object
object.write('DataGoesHere')

 



Was this content helpful?




© 2011-2013 Rackspace US, Inc.

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License


See license specifics and DISCLAIMER