Skip to content

Instantly share code, notes, and snippets.

@elight
Created July 23, 2014 19:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elight/64499231e73944fabbb8 to your computer and use it in GitHub Desktop.
Save elight/64499231e73944fabbb8 to your computer and use it in GitHub Desktop.
cf = Redrax::CloudFiles.new
cf.configure!(
user: ENV['RAX_USERNAME'],
api_key: ENV['RAX_API_KEY'],
region: :iad
)
cf.authenticate!
container_name = "test_container"
file_name = "test_file"
body = "test body"
containers = cf.containers
files = cf.files
containers.create(container_name)
files.create(container_name, file_name, body)
files.create_with_metadata(container_name + "_meta", file_name, body, foo: "bar")
file = files.get(container_name, file_name)
body = files.get_body(container_name, file_name)
files.delete(container_name, file_name)
container.delete(container_name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment