Sample Ruby Application for Cloud Files
Sample Ruby Application
From Connection to Objects
In the sample command below, use your Rackspace Cloud account username and API key, where indicated by <username> and <API key> in the following command. For information about how to find your API key, see View and reset your API key.
#!/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')
Carry on the conversation in the Rackspace Community.
© 2015 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