Skip to content

Instantly share code, notes, and snippets.

@adamloving
Last active December 19, 2015 13:08
Show Gist options
  • Save adamloving/5959477 to your computer and use it in GitHub Desktop.
Save adamloving/5959477 to your computer and use it in GitHub Desktop.
I was trying to get a list of buckets (and eventually upload one file), but I couldn't get this to return more than one bucket until I specified the right region.
# docs here:
# https://github.com/nodejitsu/pkgcloud/blob/master/docs/providers/rackspace/storage.md
pkgcloud = require('pkgcloud')
client = pkgcloud.storage.createClient
provider: 'rackspace'
username: process.env.RACKSPACE_USERNAME
apiKey: process.env.RACKSPACE_API_KEY
authUrl: 'https://auth.api.rackspacecloud.com'
region: 'ORD'
client.getContainers
limit: 10
,
(err, containers) ->
console.log(err, 'containers...')
for container in containers
console.log container.name
client.getFiles container, (err, files) ->
console.log err, 'files...'
for file in files
console.log file.name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment